Index: branches/PTSP/HeuristicLab.Problems.PTSP/3.3/AnalyticalPTSP.cs
===================================================================
--- branches/PTSP/HeuristicLab.Problems.PTSP/3.3/AnalyticalPTSP.cs	(revision 12191)
+++ branches/PTSP/HeuristicLab.Problems.PTSP/3.3/AnalyticalPTSP.cs	(revision 12219)
@@ -33,12 +33,42 @@
     public override double Evaluate(Individual individual, IRandom random) {
       Permutation p = individual.Permutation();
+      // Compute A and B matrices
+      DoubleMatrix A = new DoubleMatrix(p.Length, p.Length - 1);
+      DoubleMatrix B = new DoubleMatrix(p.Length, p.Length - 1);
+      //for (int i = 0; i < p.Length; i++) {
+      //  for (int k = 0; k < p.Length - 1; k++) {
+      //    double firstPartial = 0;
+      //    for (int r = k; k < p.Length - 1; r++) {
+      //       double sum0 = DistanceMatrix[p[i],p[i+r]]* ProbabilityMatrix[0, p[i]] * ProbabilityMatrix[0, p[i+r]];
+      //       for(int s = i+1; s < i+r; s++) {
+      //         sum0 = sum0 * (1 - ProbabilityMatrix[0, p[s]]);
+      //       }
+      //       firstPartial+=sum0;
+      //    }
+      //    double secondPartial = 0;
+      //    for (int r = k; k < p.Length - 1; r++) {
+      //       double sum1 = DistanceMatrix[p[i-r],p[i]]* ProbabilityMatrix[0, p[i-r]] * ProbabilityMatrix[0, p[i]];
+      //       for (int s = i + 1; s < p.Length-1; s++) {
+      //         sum1 = sum1 * (1 - ProbabilityMatrix[0, p[s]]);
+      //       }
+      //       for (int t = 1; t < i-1; t++) {
+      //         sum1 = sum1 * (1 - ProbabilityMatrix[0, p[t]]);
+      //       }
+      //       secondPartial+=sum1;
+      //    }
+      //    A[i, k] = firstPartial;
+      //    B[i, k] = secondPartial;
+      //  }
+      //}
+      
       // Analytical evaluation
       double firstSum = 0;
       for (int i = 0; i < p.Length - 1; i++) {
         for (int j = i + 1; j < p.Length - 1; j++) {
-          double sum1 = DistanceMatrix[p[i], p[j]] * ProbabilityMatrix[0, p[i]] * ProbabilityMatrix[0, p[j]];
+          double sum1 = DistanceMatrix[p[i], p[j]] * ProbabilityMatrix[p[i]].Value * ProbabilityMatrix[p[j]].Value;
           for (int k = i + 1; k < j; k++) {
-            sum1 = sum1 * (1 - ProbabilityMatrix[0, p[k]]);
+            sum1 = sum1 * (1 - ProbabilityMatrix[p[k]].Value);
           }
+          A[i, j - 1] = sum1;
           firstSum += sum1;
         }
@@ -47,13 +77,18 @@
       for (int j = 0; j < p.Length - 1; j++) {
         for (int i = 0; i < j; i++) {
-          double sum2 = DistanceMatrix[p[j], p[i]] * ProbabilityMatrix[0, p[i]] * ProbabilityMatrix[0, p[j]];
+          double sum2 = DistanceMatrix[p[j], p[i]] * ProbabilityMatrix[p[i]].Value * ProbabilityMatrix[p[j]].Value;
           for (int k = j + 1; k < p.Length - 1; k++) {
-            sum2 = sum2 * (1 - ProbabilityMatrix[0, p[k]]);
+            sum2 = sum2 * (1 - ProbabilityMatrix[p[k]].Value);
           }
           for (int k = 1; k < i; k++) {
-            sum2 = sum2 * (1 - ProbabilityMatrix[0, p[k]]);
+            sum2 = sum2 * (1 - ProbabilityMatrix[p[k]].Value);
           }
+          B[i, j] = sum2;
           secondSum += sum2;
         }
+      }
+      foreach (var op in Operators.OfType<PTSPAnalyticalInversionMovePathEvaluator>()) {
+        op.AParameter.Value = A;
+        op.BParameter.Value = B;
       }
       return firstSum + secondSum;
@@ -61,10 +96,12 @@
 
     public AnalyticalProbabilisticTravelingSalesmanProblem() {
-      Operators.Add(new PTSPInversionMovePathEvaluator());
+      Operators.Add(new PTSPAnalyticalInversionMovePathEvaluator());
     }
 
     public override void Load(TSPData data) {
       base.Load(data);
-      // Compute A and B matrices
+      foreach (var op in Operators.OfType<PTSPAnalyticalInversionMovePathEvaluator>()) {
+        op.ProbabilitiesParameter.Value = ProbabilityMatrix;
+      }
     }
 
Index: branches/PTSP/HeuristicLab.Problems.PTSP/3.3/EstimatedPTSP.cs
===================================================================
--- branches/PTSP/HeuristicLab.Problems.PTSP/3.3/EstimatedPTSP.cs	(revision 12191)
+++ branches/PTSP/HeuristicLab.Problems.PTSP/3.3/EstimatedPTSP.cs	(revision 12219)
@@ -11,4 +11,6 @@
 using HeuristicLab.Data;
 using System;
+using System.Linq;
+using HeuristicLab.Problems.PTSP.MoveEvaluators.OneShift;
 
 namespace HeuristicLab.Problems.PTSP {
@@ -18,4 +20,6 @@
   public sealed class EstimatedProbabilisticTravelingSalesmanProblem : ProbabilisticTravelingSalesmanProblem, IStorableContent,
   IProblemInstanceConsumer<TSPData> {
+
+    private ItemList<ItemList<IntValue>> realizations;
 
     [StorableConstructor]
@@ -34,8 +38,8 @@
       Random r = new Random();
       double estimatedSum = 0;
-      for (int i = 0; i < SampleSize.Value; i++) {
+      for (int i = 0; i < realizations.Count; i++) {
         int singleRealization = -1;
-        for (int j = 0; j < p.Length - 1; j++) {
-          if (ProbabilityMatrix[0, p[j]] > r.NextDouble()) {
+        for (int j = 0; j < realizations[i].Count; j++) {
+          if (realizations[i][j].Value == 1) {
             if (singleRealization != -1) {
               estimatedSum += DistanceMatrix[singleRealization, p[j]];
@@ -50,5 +54,7 @@
     public EstimatedProbabilisticTravelingSalesmanProblem() {
       Parameters.Add(new ValueParameter<IntValue>("SampleSize", "Size of the sample for the estimation-based evaluation"));
-      Operators.Add(new PTSPInversionMovePathEvaluator());
+      Operators.Add(new PTSPEstimatedInversionMovePathEvaluator());
+      Operators.Add(new PTSPEstimatedInsertionEvaluator());
+      Encoding.ConfigureOperators(Operators.OfType<IOperator>());
     }
 
@@ -57,4 +63,20 @@
       // For now uses sample size of 20 but should use Student's t-test
       SampleSize = new IntValue(20);
+      realizations = new ItemList<ItemList<IntValue>>(SampleSize.Value);
+      Random r = new Random();
+      for (int i = 0; i < SampleSize.Value; i++) {
+        realizations.Add(new ItemList<IntValue>());
+        for (int j = 0; j < data.Dimension; j++) {
+          if (ProbabilityMatrix[j].Value > r.NextDouble()) {
+            realizations.ElementAt(i).Add(new IntValue(1));
+          } else {
+            realizations.ElementAt(i).Add(new IntValue(0));
+          }
+        }
+        
+      }
+      foreach (var op in Operators.OfType<PTSPPathMoveEvaluator>()) {
+        op.RealizationsParameter.Value = realizations;
+      }
     }
   }
Index: branches/PTSP/HeuristicLab.Problems.PTSP/3.3/HeuristicLab.Problems.PTSP-3.3.csproj
===================================================================
--- branches/PTSP/HeuristicLab.Problems.PTSP/3.3/HeuristicLab.Problems.PTSP-3.3.csproj	(revision 12191)
+++ branches/PTSP/HeuristicLab.Problems.PTSP/3.3/HeuristicLab.Problems.PTSP-3.3.csproj	(revision 12219)
@@ -114,7 +114,9 @@
     <Compile Include="Interfaces\IPTSPPathMoveEvaluator.cs" />
     <Compile Include="Interfaces\IPTSPMoveEvaluator.cs" />
+    <Compile Include="MoveEvaluators\OneShift\PTSPEstimatedInsertionEvaluator.cs" />
     <Compile Include="MoveEvaluators\PTSPMoveEvaluator.cs" />
     <Compile Include="MoveEvaluators\PTSPPathMoveEvaluator.cs" />
-    <Compile Include="MoveEvaluators\TwoOpt\PTSPInversionMovePathEvaluator.cs" />
+    <Compile Include="MoveEvaluators\TwoOpt\PTSPAnalyticalInversionMovePathEvaluator.cs" />
+    <Compile Include="MoveEvaluators\TwoOpt\PTSPEstimatedInversionMovePathEvaluator.cs" />
     <Compile Include="PTSP.cs" />
     <Compile Include="Plugin.cs" />
@@ -124,7 +126,5 @@
     <None Include="HeuristicLab.snk" />
   </ItemGroup>
-  <ItemGroup>
-    <Folder Include="MoveEvaluators\OneShift\" />
-  </ItemGroup>
+  <ItemGroup />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <PropertyGroup>
Index: branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Interfaces/IPTSPPathMoveEvaluator.cs
===================================================================
--- branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Interfaces/IPTSPPathMoveEvaluator.cs	(revision 12191)
+++ branches/PTSP/HeuristicLab.Problems.PTSP/3.3/Interfaces/IPTSPPathMoveEvaluator.cs	(revision 12219)
@@ -29,4 +29,5 @@
     ILookupParameter<DistanceMatrix> DistanceMatrixParameter { get; }
     ILookupParameter<BoolValue> UseDistanceMatrixParameter { get; }
+
   }
 }
Index: branches/PTSP/HeuristicLab.Problems.PTSP/3.3/MoveEvaluators/OneShift/PTSPEstimatedInsertionEvaluator.cs
===================================================================
--- branches/PTSP/HeuristicLab.Problems.PTSP/3.3/MoveEvaluators/OneShift/PTSPEstimatedInsertionEvaluator.cs	(revision 12219)
+++ branches/PTSP/HeuristicLab.Problems.PTSP/3.3/MoveEvaluators/OneShift/PTSPEstimatedInsertionEvaluator.cs	(revision 12219)
@@ -0,0 +1,131 @@
+﻿using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using System;
+
+namespace HeuristicLab.Problems.PTSP.MoveEvaluators.OneShift {
+  class PTSPEstimatedInsertionEvaluator : PTSPPathMoveEvaluator, IPermutationTranslocationMoveOperator {
+
+    public override Type EvaluatorType {
+      get { return typeof(PTSPEstimatedInversionMovePathEvaluator); }
+    }
+    public ILookupParameter<TranslocationMove> TranslocationMoveParameter {
+      get { return (ILookupParameter<TranslocationMove>)Parameters["TranslocationMove"]; }
+    }
+
+    public IValueParameter<ItemList<ItemList<IntValue>>> RealizationsParameter {
+      get { return (IValueParameter<ItemList<ItemList<IntValue>>>)Parameters["Realizations"]; }
+    }
+
+    [StorableConstructor]
+    protected PTSPEstimatedInsertionEvaluator(bool deserializing) : base(deserializing) { }
+    protected PTSPEstimatedInsertionEvaluator(PTSPEstimatedInsertionEvaluator original, Cloner cloner) : base(original, cloner) { }
+    public PTSPEstimatedInsertionEvaluator()
+      : base() {
+      Parameters.Add(new LookupParameter<TranslocationMove>("TranslocationMove", "The move to evaluate."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new PTSPEstimatedInsertionEvaluator(this, cloner);
+    }
+
+    public static double EvaluateByCoordinates(Permutation permutation, TranslocationMove move, DoubleMatrix coordinates, PTSPEstimatedInsertionEvaluator evaluator) {
+      int edge1source = permutation.GetCircular(move.Index1 - 1);
+      int edge1target = permutation[move.Index1];
+      int edge2source = permutation[move.Index2];
+      int edge2target = permutation.GetCircular(move.Index2 + 1);
+      if (move.Index2 - move.Index1 >= permutation.Length - 2) return 0;
+      double moveQuality = 0;
+      // remove two edges
+      moveQuality -= evaluator.CalculateDistance(coordinates[edge1source, 0], coordinates[edge1source, 1],
+            coordinates[edge1target, 0], coordinates[edge1target, 1]);
+      moveQuality -= evaluator.CalculateDistance(coordinates[edge2source, 0], coordinates[edge2source, 1],
+        coordinates[edge2target, 0], coordinates[edge2target, 1]);
+      // add two edges
+      moveQuality += evaluator.CalculateDistance(coordinates[edge1source, 0], coordinates[edge1source, 1],
+        coordinates[edge2source, 0], coordinates[edge2source, 1]);
+      moveQuality += evaluator.CalculateDistance(coordinates[edge1target, 0], coordinates[edge1target, 1],
+        coordinates[edge2target, 0], coordinates[edge2target, 1]);
+      return moveQuality;
+    }
+
+    public static double EvaluateByDistanceMatrix(Permutation permutation, TranslocationMove move, DistanceMatrix distanceMatrix, ItemList<ItemList<IntValue>> realizations) {
+      //permutation = new Permutation(PermutationTypes.Absolute, new int[]{0,1,2,3,4,5,6,7}); TODO remove test
+      //move = new TranslocationMove(0, 0, 4); TODO remove test
+      double moveQuality = 0;
+      int[] edges = new int[12];
+      int[] indices = new int[12];
+      edges[0] = permutation.GetCircular(move.Index1 - 1);
+      edges[6] = edges[0];
+      indices[0] = move.Index1-1;
+      if (indices[0] == -1) indices[0] = permutation.Length - 1;
+      indices[6] = indices[0];
+      edges[1] = permutation[move.Index1];
+      indices[1] = move.Index1;
+      edges[2] = edges[1];
+      indices[2] = indices[1];
+      edges[9] = edges[1];
+      indices[9] = indices[1];
+      edges[10] = edges[1];
+      indices[10] = indices[1];
+      edges[3] = permutation.GetCircular(move.Index1 + 1);
+      edges[7] = edges[3];
+      indices[3] = move.Index1+1;
+      if (indices[3] == permutation.Length + 1) indices[3] = 0;
+      indices[7] = indices[3];
+      edges[4] = permutation[move.Index3];
+      indices[4] = move.Index3;
+      edges[8] = edges[4];
+      indices[8] = indices[4];
+      edges[5] = permutation.GetCircular(move.Index3 + 1);
+      edges[11] = edges[5];
+      indices[5] = move.Index3+1;
+      if (indices[5] == permutation.Length + 1) indices[5] = 0;
+      indices[11] = indices[5];
+      int[] aPosteriori = new int[12];
+      foreach (ItemList<IntValue> realization in realizations) {
+        //int[] realization2 = new int[] { 1, 0, 1, 1, 0, 0, 1, 1 }; TODO remove test
+        for (int i = 0; i < edges.Length; i++) {
+          if (realization[edges[i]].Value == 1) {
+            aPosteriori[i] = edges[i];
+          } else {
+            int j=1;
+            if (i%2==0) {
+              // find nearest predecessor in realization if source edge
+              while(realization[permutation.GetCircular(indices[i]-j)].Value == 0) {
+                j--;
+              }
+              aPosteriori[i] = permutation.GetCircular(indices[i] - j);
+            } else {
+              // find nearest successor in realization if target edge
+              while(realization[permutation.GetCircular(indices[i]+j)].Value == 0) {
+                j++;
+              }
+              aPosteriori[i] = permutation.GetCircular(indices[i] + j);
+            }
+          }
+        }
+        // compute cost difference between the two a posteriori solutions
+        moveQuality += distanceMatrix[aPosteriori[6], aPosteriori[7]] + distanceMatrix[aPosteriori[8], aPosteriori[9]] + distanceMatrix[aPosteriori[10], aPosteriori[11]];
+        moveQuality -= distanceMatrix[aPosteriori[0], aPosteriori[1]] - distanceMatrix[aPosteriori[2], aPosteriori[3]] - distanceMatrix[aPosteriori[4], aPosteriori[5]];
+      }
+      // return average of cost differences
+      return moveQuality / realizations.Capacity;
+    }
+
+    protected override double EvaluateByCoordinates(Permutation permutation, DoubleMatrix coordinates) {
+      return EvaluateByCoordinates(permutation, TranslocationMoveParameter.ActualValue, coordinates, this);
+    }
+
+    protected override double EvaluateByDistanceMatrix(Permutation permutation, DistanceMatrix distanceMatrix) {
+      return EvaluateByDistanceMatrix(permutation, TranslocationMoveParameter.ActualValue, distanceMatrix, RealizationsParameter.Value);
+    }
+
+    protected override double CalculateDistance(double x1, double y1, double x2, double y2) {
+      return Math.Round(Math.Sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)));
+    }
+  }
+}
Index: branches/PTSP/HeuristicLab.Problems.PTSP/3.3/MoveEvaluators/PTSPPathMoveEvaluator.cs
===================================================================
--- branches/PTSP/HeuristicLab.Problems.PTSP/3.3/MoveEvaluators/PTSPPathMoveEvaluator.cs	(revision 12191)
+++ branches/PTSP/HeuristicLab.Problems.PTSP/3.3/MoveEvaluators/PTSPPathMoveEvaluator.cs	(revision 12219)
@@ -47,4 +47,7 @@
       get { return (ILookupParameter<BoolValue>)Parameters["UseDistanceMatrix"]; }
     }
+    public IValueParameter<ItemList<ItemList<IntValue>>> RealizationsParameter {
+      get { return (IValueParameter<ItemList<ItemList<IntValue>>>)Parameters["Realizations"]; }
+    }
 
     [StorableConstructor]
@@ -57,4 +60,5 @@
       Parameters.Add(new LookupParameter<DistanceMatrix>("DistanceMatrix", "The matrix which contains the distances between the cities."));
       Parameters.Add(new LookupParameter<BoolValue>("UseDistanceMatrix", "True if a distance matrix should be calculated (if it does not exist already) and used for evaluation, otherwise false."));
+      Parameters.Add(new ValueParameter<ItemList<ItemList<IntValue>>>("Realizations", "The concrete..."));
     }
 
Index: branches/PTSP/HeuristicLab.Problems.PTSP/3.3/MoveEvaluators/TwoOpt/PTSPAnalyticalInversionMovePathEvaluator.cs
===================================================================
--- branches/PTSP/HeuristicLab.Problems.PTSP/3.3/MoveEvaluators/TwoOpt/PTSPAnalyticalInversionMovePathEvaluator.cs	(revision 12219)
+++ branches/PTSP/HeuristicLab.Problems.PTSP/3.3/MoveEvaluators/TwoOpt/PTSPAnalyticalInversionMovePathEvaluator.cs	(revision 12219)
@@ -0,0 +1,168 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using System;
+namespace HeuristicLab.Problems.PTSP {
+  /// <summary>
+  /// An operator to evaluate inversion moves (2-opt).
+  /// </summary>
+  [Item("PTSPAnalyticalInversionMovePathEvaluator", "Evaluates an inversion move (2-opt) of the PTSP in with the closed form expression")]
+  [StorableClass]
+  public class PTSPAnalyticalInversionMovePathEvaluator : PTSPPathMoveEvaluator, IPermutationInversionMoveOperator {
+
+    private static ItemList<DoubleValue> probabilities;
+    private static DoubleMatrix A;
+    private static DoubleMatrix B;
+
+    public override Type EvaluatorType {
+      get { return typeof(PTSPAnalyticalInversionMovePathEvaluator); }
+    }
+    public ILookupParameter<InversionMove> InversionMoveParameter {
+      get { return (ILookupParameter<InversionMove>)Parameters["InversionMove"]; }
+    }
+
+    public IValueParameter<ItemList<DoubleValue>> ProbabilitiesParameter {
+      get { return (IValueParameter<ItemList<DoubleValue>>)Parameters["Probabilities"]; }
+    }
+
+    public IValueParameter<DoubleMatrix> AParameter {
+      get { return (IValueParameter<DoubleMatrix>)Parameters["A"]; }
+    }
+
+    public IValueParameter<DoubleMatrix> BParameter {
+      get { return (IValueParameter<DoubleMatrix>)Parameters["B"]; }
+    }
+
+    [StorableConstructor]
+    protected PTSPAnalyticalInversionMovePathEvaluator(bool deserializing) : base(deserializing) { }
+    protected PTSPAnalyticalInversionMovePathEvaluator(PTSPAnalyticalInversionMovePathEvaluator original, Cloner cloner) : base(original, cloner) { }
+    public PTSPAnalyticalInversionMovePathEvaluator()
+      : base() {
+      Parameters.Add(new LookupParameter<InversionMove>("InversionMove", "The move to evaluate."));
+      Parameters.Add(new ValueParameter<ItemList<DoubleValue>>("Probabilities", "The probabilities of the current instance"));
+      Parameters.Add(new ValueParameter<DoubleMatrix>("A", "The matrix A for delta evaluation"));
+      Parameters.Add(new ValueParameter<DoubleMatrix>("B", "The matrix B for delta evaluation"));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new PTSPAnalyticalInversionMovePathEvaluator(this, cloner);
+    }
+
+    public static double EvaluateByCoordinates(Permutation permutation, InversionMove move, DoubleMatrix coordinates, PTSPAnalyticalInversionMovePathEvaluator evaluator) {
+      int edge1source = permutation.GetCircular(move.Index1 - 1);
+      int edge1target = permutation[move.Index1];
+      int edge2source = permutation[move.Index2];
+      int edge2target = permutation.GetCircular(move.Index2 + 1);
+      if (move.Index2 - move.Index1 >= permutation.Length - 2) return 0;
+      double moveQuality = 0;
+      // remove two edges
+      moveQuality -= evaluator.CalculateDistance(coordinates[edge1source, 0], coordinates[edge1source, 1],
+            coordinates[edge1target, 0], coordinates[edge1target, 1]);
+      moveQuality -= evaluator.CalculateDistance(coordinates[edge2source, 0], coordinates[edge2source, 1],
+        coordinates[edge2target, 0], coordinates[edge2target, 1]);
+      // add two edges
+      moveQuality += evaluator.CalculateDistance(coordinates[edge1source, 0], coordinates[edge1source, 1],
+        coordinates[edge2source, 0], coordinates[edge2source, 1]);
+      moveQuality += evaluator.CalculateDistance(coordinates[edge1target, 0], coordinates[edge1target, 1],
+        coordinates[edge2target, 0], coordinates[edge2target, 1]);
+      return moveQuality;
+    }
+
+    public static double EvaluateByDistanceMatrix(Permutation permutation, InversionMove move, DistanceMatrix distanceMatrix) {
+      int i = move.Index1;
+      int j = move.Index2;
+      return RecursiveExpectedCost(1, i, j) + RecursiveExpectedCost(2, i, j) - RecursiveExpectedCost(3, i, j);
+    }
+
+    protected static double RecursiveExpectedCost(int s, int i, int j) {
+      switch (s) {
+        case 1:
+          if (j == i + 1) {
+            return (1/(1-probabilities[i+1].Value))*A[i,2]+(1 - probabilities[i].Value)*(A[i+1,1]-A[i+1,probabilities.Capacity-1]);
+          } else if (i == j) {
+            return A[i,1];
+          } else {
+            // Equation 25
+            return ((1 - probabilities[i].Value) / (1 - probabilities[j].Value)) * RecursiveExpectedCost(1, i + 1, j - 1) + (1 - probabilities[i].Value) * (1);
+          }
+          
+        case 2:
+          if (j == i + 1) {
+            return (1 - probabilities[i + 1].Value) * (B[i, 1] - B[i, probabilities.Capacity - 1]) + (1 / (1 - probabilities[i].Value)) * (B[i + 1, 2]);
+          } else if (i == j) {
+            return B[i,1];
+          } else {
+            return 0;
+            // Equation 26
+          }
+
+        case 3:
+          if (j == i + 1) {
+            return A[i, 2] + A[i + 1, 1] - A[i + 1, probabilities.Capacity - 1] + B[i, 1] - B[i, probabilities.Capacity - 1] + B[i + 1, 2];
+          } else if (i == j) {
+            return A[i,1]+B[i,1];
+          } else {
+            return 0;
+            // Equation 27
+          }
+        default:
+          return 0;
+      }
+    }
+
+    private double Q(int i, int j, DoubleArray probabilities) {
+      double prod = 1;
+      for (int k = i; k <= j; k++) {
+        prod *= (1 - probabilities[k]);
+      }
+      return prod;
+    }
+
+    private double Q_hat(int i, int j, DoubleArray probabilities) {
+      double prod = 1;
+      for (int k = i; k <= j; k++) {
+        prod *= (1-probabilities[k]);
+      }
+      return prod;
+    }
+
+    protected override double EvaluateByCoordinates(Permutation permutation, DoubleMatrix coordinates) {
+      return EvaluateByCoordinates(permutation, InversionMoveParameter.ActualValue, coordinates, this);
+    }
+
+    protected override double EvaluateByDistanceMatrix(Permutation permutation, DistanceMatrix distanceMatrix) {
+      A = AParameter.Value;
+      B = BParameter.Value;
+      probabilities = ProbabilitiesParameter.Value;
+      return EvaluateByDistanceMatrix(permutation, InversionMoveParameter.ActualValue, distanceMatrix);
+    }
+
+    protected override double CalculateDistance(double x1, double y1, double x2, double y2) {
+      return Math.Round(Math.Sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)));
+    }
+  }
+}
Index: branches/PTSP/HeuristicLab.Problems.PTSP/3.3/MoveEvaluators/TwoOpt/PTSPEstimatedInversionMovePathEvaluator.cs
===================================================================
--- branches/PTSP/HeuristicLab.Problems.PTSP/3.3/MoveEvaluators/TwoOpt/PTSPEstimatedInversionMovePathEvaluator.cs	(revision 12219)
+++ branches/PTSP/HeuristicLab.Problems.PTSP/3.3/MoveEvaluators/TwoOpt/PTSPEstimatedInversionMovePathEvaluator.cs	(revision 12219)
@@ -0,0 +1,134 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.PermutationEncoding;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using System;
+
+namespace HeuristicLab.Problems.PTSP {
+  /// <summary>
+  /// An operator to evaluate inversion moves (2-opt).
+  /// </summary>
+  [Item("PTSPInversionMovePathEvaluator", "Evaluates an inversion move (2-opt) by summing up the length of all added edges and subtracting the length of all deleted edges.")]
+  [StorableClass]
+  public class PTSPEstimatedInversionMovePathEvaluator : PTSPPathMoveEvaluator, IPermutationInversionMoveOperator {
+    public override Type EvaluatorType {
+      get { return typeof(PTSPEstimatedInversionMovePathEvaluator); }
+    }
+    public ILookupParameter<InversionMove> InversionMoveParameter {
+      get { return (ILookupParameter<InversionMove>)Parameters["InversionMove"]; }
+    }
+
+    
+
+    [StorableConstructor]
+    protected PTSPEstimatedInversionMovePathEvaluator(bool deserializing) : base(deserializing) { }
+    protected PTSPEstimatedInversionMovePathEvaluator(PTSPEstimatedInversionMovePathEvaluator original, Cloner cloner) : base(original, cloner) { }
+    public PTSPEstimatedInversionMovePathEvaluator()
+      : base() {
+      Parameters.Add(new LookupParameter<InversionMove>("InversionMove", "The move to evaluate."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new PTSPEstimatedInversionMovePathEvaluator(this, cloner);
+    }
+
+    public static double EvaluateByCoordinates(Permutation permutation, InversionMove move, DoubleMatrix coordinates, PTSPEstimatedInversionMovePathEvaluator evaluator) {
+      int edge1source = permutation.GetCircular(move.Index1 - 1);
+      int edge1target = permutation[move.Index1];
+      int edge2source = permutation[move.Index2];
+      int edge2target = permutation.GetCircular(move.Index2 + 1);
+      if (move.Index2 - move.Index1 >= permutation.Length - 2) return 0;
+      double moveQuality = 0;
+      // remove two edges
+      moveQuality -= evaluator.CalculateDistance(coordinates[edge1source, 0], coordinates[edge1source, 1],
+            coordinates[edge1target, 0], coordinates[edge1target, 1]);
+      moveQuality -= evaluator.CalculateDistance(coordinates[edge2source, 0], coordinates[edge2source, 1],
+        coordinates[edge2target, 0], coordinates[edge2target, 1]);
+      // add two edges
+      moveQuality += evaluator.CalculateDistance(coordinates[edge1source, 0], coordinates[edge1source, 1],
+        coordinates[edge2source, 0], coordinates[edge2source, 1]);
+      moveQuality += evaluator.CalculateDistance(coordinates[edge1target, 0], coordinates[edge1target, 1],
+        coordinates[edge2target, 0], coordinates[edge2target, 1]);
+      return moveQuality;
+    }
+
+    public static double EvaluateByDistanceMatrix(Permutation permutation, InversionMove move, DistanceMatrix distanceMatrix, ItemList<ItemList<IntValue>> realizations) {
+      double moveQuality = 0;
+      int[] edges = new int[4];
+      int[] indices = new int[4];
+      edges[0] = permutation.GetCircular(move.Index1 - 1);
+      indices[0] = move.Index1-1;
+      if (indices[0] == -1) indices[0] = permutation.Length - 1;
+      edges[1] = permutation[move.Index1];
+      indices[1] = move.Index1;
+      edges[2] = permutation[move.Index2];
+      indices[2] = move.Index2;
+      edges[3] = permutation.GetCircular(move.Index2 + 1);
+      indices[3] = move.Index2+1; 
+      if (indices[3] == permutation.Length + 1) indices[3] = 0;
+      int[] aPosteriori = new int[4];
+      foreach (ItemList<IntValue> realization in realizations) {
+        for (int i = 0; i < edges.Length; i++) {
+          if (realization[edges[i]].Value == 1) {
+            aPosteriori[i] = edges[i];
+          } else {
+            int j=1;
+            if (i%2==0) {
+              // find nearest predecessor in realization if source edge
+              while(realization[permutation.GetCircular(indices[i]-j)].Value==0) {
+                j--;
+              }
+              aPosteriori[i] = permutation.GetCircular(indices[i] - j);
+            } else {
+              // find nearest successor in realization if target edge
+              while(realization[permutation.GetCircular(indices[i]+j)].Value==0) {
+                j++;
+              }
+              aPosteriori[i] = permutation.GetCircular(indices[i] + j);
+            }
+          }
+        }
+        // compute cost difference between the two a posteriori solutions
+        moveQuality += distanceMatrix[aPosteriori[0], aPosteriori[2]] + distanceMatrix[aPosteriori[1], aPosteriori[3]];
+        moveQuality -= distanceMatrix[aPosteriori[0], aPosteriori[1]] - distanceMatrix[aPosteriori[2], aPosteriori[3]];
+      }
+      // return average of cost differences
+      return moveQuality / realizations.Capacity;
+    }
+
+    protected override double EvaluateByCoordinates(Permutation permutation, DoubleMatrix coordinates) {
+      return EvaluateByCoordinates(permutation, InversionMoveParameter.ActualValue, coordinates, this);
+    }
+
+    protected override double EvaluateByDistanceMatrix(Permutation permutation, DistanceMatrix distanceMatrix) {
+      return EvaluateByDistanceMatrix(permutation, InversionMoveParameter.ActualValue, distanceMatrix, RealizationsParameter.Value);
+    }
+
+    protected override double CalculateDistance(double x1, double y1, double x2, double y2) {
+      return Math.Round(Math.Sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)));
+    }
+  }
+}
Index: branches/PTSP/HeuristicLab.Problems.PTSP/3.3/MoveEvaluators/TwoOpt/PTSPInversionMovePathEvaluator.cs
===================================================================
--- branches/PTSP/HeuristicLab.Problems.PTSP/3.3/MoveEvaluators/TwoOpt/PTSPInversionMovePathEvaluator.cs	(revision 12191)
+++ 	(revision )
@@ -1,104 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Encodings.PermutationEncoding;
-using HeuristicLab.Parameters;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using System;
-
-namespace HeuristicLab.Problems.PTSP {
-  /// <summary>
-  /// An operator to evaluate inversion moves (2-opt).
-  /// </summary>
-  [Item("PTSPInversionMovePathEvaluator", "Evaluates an inversion move (2-opt) by summing up the length of all added edges and subtracting the length of all deleted edges.")]
-  [StorableClass]
-  public class PTSPInversionMovePathEvaluator : PTSPPathMoveEvaluator, IPermutationInversionMoveOperator {
-    public override Type EvaluatorType {
-      get { return typeof(PTSPInversionMovePathEvaluator); }
-    }
-    public ILookupParameter<InversionMove> InversionMoveParameter {
-      get { return (ILookupParameter<InversionMove>)Parameters["InversionMove"]; }
-    }
-
-    [StorableConstructor]
-    protected PTSPInversionMovePathEvaluator(bool deserializing) : base(deserializing) { }
-    protected PTSPInversionMovePathEvaluator(PTSPInversionMovePathEvaluator original, Cloner cloner) : base(original, cloner) { }
-    public PTSPInversionMovePathEvaluator()
-      : base() {
-      Parameters.Add(new LookupParameter<InversionMove>("InversionMove", "The move to evaluate."));
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new PTSPInversionMovePathEvaluator(this, cloner);
-    }
-
-    public static double EvaluateByCoordinates(Permutation permutation, InversionMove move, DoubleMatrix coordinates, PTSPInversionMovePathEvaluator evaluator) {
-      int edge1source = permutation.GetCircular(move.Index1 - 1);
-      int edge1target = permutation[move.Index1];
-      int edge2source = permutation[move.Index2];
-      int edge2target = permutation.GetCircular(move.Index2 + 1);
-      if (move.Index2 - move.Index1 >= permutation.Length - 2) return 0;
-      double moveQuality = 0;
-      // remove two edges
-      moveQuality -= evaluator.CalculateDistance(coordinates[edge1source, 0], coordinates[edge1source, 1],
-            coordinates[edge1target, 0], coordinates[edge1target, 1]);
-      moveQuality -= evaluator.CalculateDistance(coordinates[edge2source, 0], coordinates[edge2source, 1],
-        coordinates[edge2target, 0], coordinates[edge2target, 1]);
-      // add two edges
-      moveQuality += evaluator.CalculateDistance(coordinates[edge1source, 0], coordinates[edge1source, 1],
-        coordinates[edge2source, 0], coordinates[edge2source, 1]);
-      moveQuality += evaluator.CalculateDistance(coordinates[edge1target, 0], coordinates[edge1target, 1],
-        coordinates[edge2target, 0], coordinates[edge2target, 1]);
-      return moveQuality;
-    }
-
-    public static double EvaluateByDistanceMatrix(Permutation permutation, InversionMove move, DistanceMatrix distanceMatrix) {
-      int edge1source = permutation.GetCircular(move.Index1 - 1);
-      int edge1target = permutation[move.Index1];
-      int edge2source = permutation[move.Index2];
-      int edge2target = permutation.GetCircular(move.Index2 + 1);
-      if (move.Index2 - move.Index1 >= permutation.Length - 2) return 0;
-      double moveQuality = 0;
-      // remove two edges
-      moveQuality -= distanceMatrix[edge1source, edge1target];
-      moveQuality -= distanceMatrix[edge2source, edge2target];
-      // add two edges
-      moveQuality += distanceMatrix[edge1source, edge2source];
-      moveQuality += distanceMatrix[edge1target, edge2target];
-      return moveQuality;
-    }
-
-    protected override double EvaluateByCoordinates(Permutation permutation, DoubleMatrix coordinates) {
-      return EvaluateByCoordinates(permutation, InversionMoveParameter.ActualValue, coordinates, this);
-    }
-
-    protected override double EvaluateByDistanceMatrix(Permutation permutation, DistanceMatrix distanceMatrix) {
-      return EvaluateByDistanceMatrix(permutation, InversionMoveParameter.ActualValue, distanceMatrix);
-    }
-
-    protected override double CalculateDistance(double x1, double y1, double x2, double y2) {
-      return Math.Round(Math.Sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)));
-    }
-  }
-}
Index: branches/PTSP/HeuristicLab.Problems.PTSP/3.3/PTSP.cs
===================================================================
--- branches/PTSP/HeuristicLab.Problems.PTSP/3.3/PTSP.cs	(revision 12191)
+++ branches/PTSP/HeuristicLab.Problems.PTSP/3.3/PTSP.cs	(revision 12219)
@@ -53,6 +53,6 @@
       get { return (OptionalValueParameter<Permutation>)Parameters["BestKnownSolution"]; }
     }
-    public OptionalValueParameter<DistanceMatrix> ProbabilityMatrixParameter {
-      get { return (OptionalValueParameter<DistanceMatrix>)Parameters["ProbabilityMatrix"]; }
+    public OptionalValueParameter<ItemList<DoubleValue>> ProbabilityMatrixParameter {
+      get { return (OptionalValueParameter<ItemList<DoubleValue>>)Parameters["ProbabilityMatrix"]; }
     }
     public ValueParameter<IntValue> SampleSizeParameter {
@@ -79,5 +79,5 @@
       set { BestKnownSolutionParameter.Value = value; }
     }
-    public DistanceMatrix ProbabilityMatrix {
+    public ItemList<DoubleValue> ProbabilityMatrix {
       get { return ProbabilityMatrixParameter.Value; }
       set { ProbabilityMatrixParameter.Value = value; }
@@ -105,5 +105,5 @@
       Parameters.Add(new ValueParameter<BoolValue>("UseDistanceMatrix", "True if the coordinates based evaluators should calculate the distance matrix from the coordinates and use it for evaluation similar to the distance matrix evaluator, otherwise false.", new BoolValue(true)));
       Parameters.Add(new OptionalValueParameter<Permutation>("BestKnownSolution", "The best known solution of this TSP instance."));
-      Parameters.Add(new OptionalValueParameter<DistanceMatrix>("ProbabilityMatrix", "The matrix which contains the probabilities of each of the cities."));
+      Parameters.Add(new OptionalValueParameter<ItemList<DoubleValue>>("ProbabilityMatrix", "The matrix which contains the probabilities of each of the cities."));
       
     }
@@ -112,8 +112,8 @@
       DistanceMatrix = new DistanceMatrix(data.GetDistanceMatrix());
       // Get Probabilities of cities using random with seed from hash function on the Name of the instance
-      ProbabilityMatrix = new DistanceMatrix(1, data.Dimension);
+      ProbabilityMatrix = new ItemList<DoubleValue>(data.Dimension);
       Random r = new Random(data.Name.GetHashCode());
       for (int i = 0; i < data.Dimension; i++) {
-        ProbabilityMatrix[0,i] = r.NextDouble();
+        ProbabilityMatrix.Add(new DoubleValue(r.NextDouble()));
       }
       Encoding.Length = data.Dimension;
