Index: branches/MemPRAlgorithm/HeuristicLab.Optimization/3.3/Algorithms/Algorithm.cs
===================================================================
--- branches/MemPRAlgorithm/HeuristicLab.Optimization/3.3/Algorithms/Algorithm.cs	(revision 14429)
+++ branches/MemPRAlgorithm/HeuristicLab.Optimization/3.3/Algorithms/Algorithm.cs	(revision 14562)
@@ -289,12 +289,23 @@
     public event EventHandler Stopped;
     protected virtual void OnStopped() {
-      foreach (IStatefulItem statefulObject in this.GetObjectGraphObjects(new HashSet<object>() { Runs }).OfType<IStatefulItem>()) {
-        statefulObject.ClearState();
-      }
-      runsCounter++;
-      runs.Add(new Run(string.Format("{0} Run {1}", Name, runsCounter), this));
-      ExecutionState = ExecutionState.Stopped;
-      EventHandler handler = Stopped;
-      if (handler != null) handler(this, EventArgs.Empty);
+      try {
+        foreach (
+          IStatefulItem statefulObject in
+          this.GetObjectGraphObjects(new HashSet<object>() {Runs}).OfType<IStatefulItem>()) {
+          statefulObject.ClearState();
+        }
+        runsCounter++;
+        try {
+          runs.Add(new Run(string.Format("{0} Run {1}", Name, runsCounter), this));
+        }
+        catch (ArgumentException e) {
+          OnExceptionOccurred(new InvalidOperationException("Run creation failed.", e));
+        }
+      }    
+      finally {
+        ExecutionState = ExecutionState.Stopped;
+        EventHandler handler = Stopped;
+        if (handler != null) handler(this, EventArgs.Empty);
+      }
     }
     public event EventHandler<EventArgs<Exception>> ExceptionOccurred;
Index: branches/MemPRAlgorithm/HeuristicLab.Optimization/3.3/Algorithms/BasicAlgorithm.cs
===================================================================
--- branches/MemPRAlgorithm/HeuristicLab.Optimization/3.3/Algorithms/BasicAlgorithm.cs	(revision 14429)
+++ branches/MemPRAlgorithm/HeuristicLab.Optimization/3.3/Algorithms/BasicAlgorithm.cs	(revision 14562)
@@ -24,4 +24,5 @@
 using System.Threading.Tasks;
 using HeuristicLab.Common;
+using HeuristicLab.Core;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
 
@@ -29,8 +30,16 @@
   [StorableClass]
   public abstract class BasicAlgorithm : Algorithm, IStorableContent {
+
+    private bool pausePending;
+    private DateTime lastUpdateTime;
+
     public string Filename { get; set; }
 
+    public abstract bool SupportsPause { get; }
+
     [Storable]
-    private ResultCollection results;
+    private bool initialized;
+    [Storable]
+    private readonly ResultCollection results;
     public override ResultCollection Results {
       get { return results; }
@@ -58,4 +67,5 @@
       base.Prepare();
       results.Clear();
+      initialized = false;
       OnPrepared();
     }
@@ -64,14 +74,17 @@
       base.Start();
       CancellationTokenSource = new CancellationTokenSource();
+      pausePending = false;
+      OnStarted();
 
-      OnStarted();
-      Task task = Task.Factory.StartNew(Run, cancellationTokenSource.Token, cancellationTokenSource.Token);
+      Task task = Task.Factory.StartNew(Run, CancellationTokenSource.Token, CancellationTokenSource.Token);
       task.ContinueWith(t => {
         try {
           t.Wait();
-        } catch (AggregateException ex) {
+        }
+        catch (AggregateException ex) {
           try {
             ex.Flatten().Handle(x => x is OperationCanceledException);
-          } catch (AggregateException remaining) {
+          }
+          catch (AggregateException remaining) {
             if (remaining.InnerExceptions.Count == 1) OnExceptionOccurred(remaining.InnerExceptions[0]);
             else OnExceptionOccurred(remaining);
@@ -80,10 +93,18 @@
         CancellationTokenSource.Dispose();
         CancellationTokenSource = null;
-        OnStopped();
+        if (pausePending) OnPaused();
+        else OnStopped();
       });
     }
 
     public override void Pause() {
-      throw new NotSupportedException("Pause is not supported in basic algorithms.");
+      // CancellationToken.ThrowIfCancellationRequested() must be called from within the Run method, otherwise pause does nothing
+      // alternatively check the IsCancellationRequested property of the cancellation token
+      if (!SupportsPause)
+        throw new NotSupportedException("Pause is not supported by this algorithm.");
+
+      base.Pause();
+      pausePending = true;
+      CancellationTokenSource.Cancel();
     }
 
@@ -92,9 +113,8 @@
       // alternatively check the IsCancellationRequested property of the cancellation token
       base.Stop();
-      CancellationTokenSource.Cancel();
+      if (ExecutionState == ExecutionState.Paused) OnStopped();
+      else CancellationTokenSource.Cancel();
     }
 
-
-    private DateTime lastUpdateTime;
     private void Run(object state) {
       CancellationToken cancellationToken = (CancellationToken)state;
@@ -105,6 +125,10 @@
       timer.Start();
       try {
+        if (!initialized)
+          Initialize(cancellationToken);
+        initialized = true;
         Run(cancellationToken);
-      } finally {
+      }
+      finally {
         timer.Elapsed -= new System.Timers.ElapsedEventHandler(timer_Elapsed);
         timer.Stop();
@@ -113,4 +137,5 @@
     }
 
+    protected virtual void Initialize(CancellationToken cancellationToken) { }
     protected abstract void Run(CancellationToken cancellationToken);
 
