Index: branches/HeuristicLab.Analysis.AlgorithmBehavior/AlgorithmBehaviorUnitTests/AlgorithmBehaviorUnitTests.csproj
===================================================================
--- branches/HeuristicLab.Analysis.AlgorithmBehavior/AlgorithmBehaviorUnitTests/AlgorithmBehaviorUnitTests.csproj	(revision 10059)
+++ branches/HeuristicLab.Analysis.AlgorithmBehavior/AlgorithmBehaviorUnitTests/AlgorithmBehaviorUnitTests.csproj	(revision 10060)
@@ -76,5 +76,8 @@
   </Choose>
   <ItemGroup>
-    <Compile Include="UnitTest2.cs" />
+    <Compile Include="LPConvexHullSortingTest.cs" />
+    <Compile Include="LPConvexHullTest.cs" />
+    <Compile Include="PermutationCacheTest.cs" />
+    <Compile Include="DistanceMatrixToPointsTest.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="ConvexHullTest.cs" />
Index: branches/HeuristicLab.Analysis.AlgorithmBehavior/AlgorithmBehaviorUnitTests/DistanceMatrixToPointsTest.cs
===================================================================
--- branches/HeuristicLab.Analysis.AlgorithmBehavior/AlgorithmBehaviorUnitTests/DistanceMatrixToPointsTest.cs	(revision 10060)
+++ branches/HeuristicLab.Analysis.AlgorithmBehavior/AlgorithmBehaviorUnitTests/DistanceMatrixToPointsTest.cs	(revision 10060)
@@ -0,0 +1,79 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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 System;
+using HeuristicLab.Analysis.AlgorithmBehavior.Analyzers;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace AlgorithmBehaviorUnitTests {
+  [TestClass]
+  public class DistanceMatrixToPointsTest {
+    [TestMethod]
+    public void TestDistanceMatrixConversion() {
+      int nrOfPoints = 5;
+      int dim = 2;
+      double[][] orgPoints = new double[nrOfPoints][];
+      double[][] orgDm = new double[nrOfPoints][];
+      double[][] newDm = new double[nrOfPoints][];
+      double[][] newPoints = null;
+
+
+      AllocArray(orgPoints, dim);
+      AllocArray(orgDm, nrOfPoints);
+      AllocArray(newDm, nrOfPoints);
+      SamplePoints(orgPoints);
+      CalculateDistanceMatrix(orgDm, orgPoints);
+
+      newPoints = DistanceMatrixToPoints.ConvertDistanceMatrixToPoints(orgDm);
+      CalculateDistanceMatrix(newDm, newPoints);
+      //TODO
+
+    }
+
+    private static void SamplePoints(double[][] points) {
+      Random rand = new Random();
+
+      for (int i = 0; i < points.Length; i++) {
+        for (int j = 0; j < points[i].Length; j++) {
+          points[i][j] = rand.NextDouble() * 100;
+        }
+      }
+    }
+
+    private static void CalculateDistanceMatrix(double[][] dm, double[][] points) {
+      for (int i = 0; i < points.Length; i++) {
+        for (int j = 0; j < points.Length; j++) {
+          dm[i][j] = CalcEuclideanDistance(points[i], points[j]);
+        }
+      }
+    }
+
+    private static double CalcEuclideanDistance(double[] p1, double[] p2) {
+      return Math.Sqrt(Math.Pow(p1[0] - p2[0], 2) + Math.Pow(p1[1] - p2[1], 2));
+    }
+
+    private static void AllocArray(double[][] arr, int size) {
+      for (int i = 0; i < arr.Length; i++) {
+        arr[i] = new double[size];
+      }
+    }
+  }
+}
Index: branches/HeuristicLab.Analysis.AlgorithmBehavior/AlgorithmBehaviorUnitTests/LPConvexHullSortingTest.cs
===================================================================
--- branches/HeuristicLab.Analysis.AlgorithmBehavior/AlgorithmBehaviorUnitTests/LPConvexHullSortingTest.cs	(revision 10060)
+++ branches/HeuristicLab.Analysis.AlgorithmBehavior/AlgorithmBehaviorUnitTests/LPConvexHullSortingTest.cs	(revision 10060)
@@ -0,0 +1,86 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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.Analysis.AlgorithmBehavior.Analyzers;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace AlgorithmBehaviorUnitTests {
+  [TestClass]
+  public class LPConvexHullSortingTest {
+    [TestMethod]
+    public void TestSorting() {
+      int size = 4;
+      int dimension = 2;
+
+      double[][] points = new double[size][];
+      points[0] = new double[] { 2, 3 };
+      points[1] = new double[] { 6, 4 };
+      points[2] = new double[] { 12, 13 };
+      points[3] = new double[] { 21, 31 };
+
+      var result = LPHull.SortA(points);
+
+      for (int i = 0; i < size; i++) {
+        for (int j = 0; j < dimension; j++) {
+          Assert.AreEqual(points[i][j], result[size - i - 1][j]);
+        }
+      }
+    }
+
+    [TestMethod]
+    public void TestSortingNegative() {
+      int size = 4;
+      int dimension = 2;
+
+      double[][] points = new double[size][];
+      points[0] = new double[] { -6, -4 };
+      points[1] = new double[] { -2, -3 };
+      points[2] = new double[] { 12, 13 };
+      points[3] = new double[] { 21, 31 };
+
+      var result = LPHull.SortA(points);
+
+      for (int i = 0; i < size; i++) {
+        for (int j = 0; j < dimension; j++) {
+          Assert.AreEqual(points[i][j], result[size - i - 1][j]);
+        }
+      }
+    }
+
+    [TestMethod]
+    public void TestSortingMixed() {
+      int size = 4;
+
+      double[][] points = new double[size][];
+      points[0] = new double[] { -6, -4 };
+      points[2] = new double[] { 5, 13 };
+      points[1] = new double[] { -2, -3 };
+      points[3] = new double[] { 21, 31 };
+
+      var result = LPHull.SortA(points);
+
+      Assert.AreEqual(21, result[0][0]);
+      Assert.AreEqual(5, result[1][0]);
+      Assert.AreEqual(-2, result[2][0]);
+      Assert.AreEqual(-6, result[3][0]);
+    }
+  }
+}
Index: branches/HeuristicLab.Analysis.AlgorithmBehavior/AlgorithmBehaviorUnitTests/LPConvexHullTest.cs
===================================================================
--- branches/HeuristicLab.Analysis.AlgorithmBehavior/AlgorithmBehaviorUnitTests/LPConvexHullTest.cs	(revision 10060)
+++ branches/HeuristicLab.Analysis.AlgorithmBehavior/AlgorithmBehaviorUnitTests/LPConvexHullTest.cs	(revision 10060)
@@ -0,0 +1,98 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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 System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using HeuristicLab.Analysis.AlgorithmBehavior.Analyzers;
+using MIConvexHull;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace Visualization {
+  [TestClass]
+  public class LPConvexHullTest {
+    [TestMethod]
+    public void TestMethod1() {
+      int nrOfSamples = 10;
+      int sampleSize = 2;
+      double[][] inputs = CreateRandomData(nrOfSamples, sampleSize);
+      var convAlgData = ConvertPermutationToVertex(inputs);
+
+      Stopwatch watch = new Stopwatch();
+      watch.Start();
+      var result2 = LPHull.Calculate(inputs);
+      watch.Stop();
+      Console.WriteLine("LPHull: " + watch.ElapsedMilliseconds);
+      watch.Restart();
+      var result1 = ConvexHull.Create(convAlgData).Points.Select(x => x.Position).ToList();
+      watch.Stop();
+      Console.WriteLine("MIConvexHull: " + watch.ElapsedMilliseconds);
+
+      int k = 0;
+      foreach (var d in result1) {
+        bool found = false;
+        foreach (var e in result2) {
+          int i = 0;
+          for (i = 0; i < e.Count(); i++) {
+            if (d[i] != e[i]) {
+              break;
+            }
+          }
+          if (i == e.Count()) {
+            found = true;
+            k++;
+            break;
+          }
+        }
+        Assert.IsTrue(found);
+      }
+      Console.WriteLine("Ratio: " + k + "/" + result1.Count);
+      Assert.AreEqual(k, result1.Count);
+    }
+
+    private List<DefaultVertex> ConvertPermutationToVertex(double[][] data) {
+      List<DefaultVertex> result = new List<DefaultVertex>();
+      for (int i = 0; i < data.Count(); i++) {
+        double[] d = data[i];
+        for (int j = 0; j < d.Length; j++) {
+          DefaultVertex vertex = new DefaultVertex();
+          vertex.Position = d.Select(x => x).ToArray();
+          result.Add(vertex);
+        }
+      }
+      return result;
+    }
+
+    private double[][] CreateRandomData(int n, int m) {
+      double[][] result = new double[n][];
+      Random rand = new Random();
+
+      for (int i = 0; i < n; i++) {
+        result[i] = new double[m];
+        for (int j = 0; j < m; j++) {
+          result[i][j] = (double)rand.Next(1, 60);
+        }
+      }
+      return result;
+    }
+  }
+}
Index: branches/HeuristicLab.Analysis.AlgorithmBehavior/AlgorithmBehaviorUnitTests/PermutationCacheTest.cs
===================================================================
--- branches/HeuristicLab.Analysis.AlgorithmBehavior/AlgorithmBehaviorUnitTests/PermutationCacheTest.cs	(revision 10060)
+++ branches/HeuristicLab.Analysis.AlgorithmBehavior/AlgorithmBehaviorUnitTests/PermutationCacheTest.cs	(revision 10060)
@@ -0,0 +1,75 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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 System.Linq;
+using HeuristicLab.Analysis.SolutionCaching;
+using HeuristicLab.Analysis.SolutionCaching.PermutationEncoding;
+using HeuristicLab.Encodings.PermutationEncoding;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace AlgorithmBehaviorUnitTests {
+  [TestClass]
+  public class PermutationCacheTest {
+    [TestMethod]
+    public void TestPermutationSolutionDictionary() {
+      var rand = new HeuristicLab.Random.FastRandom();
+      PermutationEqualityComparer comp = new PermutationEqualityComparer();
+      PermutationSolutionCache dict = new PermutationSolutionCache();
+      int realDuplicates = 0;
+      int noDuplicates = 0;
+
+      Permutation[] permutations = new Permutation[500];
+      for (int i = 0; i < permutations.Length; i += 2) {
+        var p = new Permutation(PermutationTypes.RelativeUndirected, 21, rand);
+        permutations[i] = p;
+        permutations[i + 1] = p;
+
+        PermutationSolutionInformation pi = new PermutationSolutionInformation();
+        pi.Generation = rand.Next(0, 100);
+        pi.ProducedBy = ProducedBy.Mutation;
+
+        dict.Add(p, pi);
+      }
+
+      for (int i = 0; i < permutations.Length; i++) {
+        for (int j = i + 1; j < permutations.Length; j++) {
+          if (comp.Equals(permutations[i], permutations[j])) {
+            realDuplicates++;
+            break;
+          }
+        }
+      }
+
+      for (int i = 0; i < dict.SolutionDictionary.Keys.Count; i++) {
+        for (int j = i + 1; j < dict.SolutionDictionary.Keys.Count; j++) {
+          if (comp.Equals(dict.SolutionDictionary.Keys.ElementAt(i), dict.SolutionDictionary.Keys.ElementAt(j))) {
+            noDuplicates++;
+            break;
+          }
+        }
+      }
+
+      Assert.AreNotEqual(0, realDuplicates);
+      Assert.AreEqual(0, noDuplicates);
+      Assert.AreEqual(250, dict.SolutionDictionary.Keys.Count);
+    }
+  }
+}
Index: branches/HeuristicLab.Analysis.AlgorithmBehavior/AlgorithmBehaviorUnitTests/UnitTest2.cs
===================================================================
--- branches/HeuristicLab.Analysis.AlgorithmBehavior/AlgorithmBehaviorUnitTests/UnitTest2.cs	(revision 10059)
+++ 	(revision )
@@ -1,54 +1,0 @@
-﻿using System.Linq;
-using HeuristicLab.Analysis.SolutionCaching;
-using HeuristicLab.Analysis.SolutionCaching.PermutationEncoding;
-using HeuristicLab.Encodings.PermutationEncoding;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-
-namespace AlgorithmBehaviorUnitTests {
-  [TestClass]
-  public class UnitTest2 {
-    [TestMethod]
-    public void TestPermutationSolutionDictionary() {
-      var rand = new HeuristicLab.Random.FastRandom();
-      PermutationEqualityComparer comp = new PermutationEqualityComparer();
-      PermutationSolutionCache dict = new PermutationSolutionCache();
-      int realDuplicates = 0;
-      int noDuplicates = 0;
-
-      Permutation[] permutations = new Permutation[500];
-      for (int i = 0; i < permutations.Length; i += 2) {
-        var p = new Permutation(PermutationTypes.RelativeUndirected, 21, rand);
-        permutations[i] = p;
-        permutations[i + 1] = p;
-
-        PermutationSolutionInformation pi = new PermutationSolutionInformation();
-        pi.Generation = rand.Next(0, 100);
-        pi.ProducedBy = ProducedBy.Mutation;
-
-        dict.Add(p, pi);
-      }
-
-      for (int i = 0; i < permutations.Length; i++) {
-        for (int j = i + 1; j < permutations.Length; j++) {
-          if (comp.Equals(permutations[i], permutations[j])) {
-            realDuplicates++;
-            break;
-          }
-        }
-      }
-
-      for (int i = 0; i < dict.SolutionDictionary.Keys.Count; i++) {
-        for (int j = i + 1; j < dict.SolutionDictionary.Keys.Count; j++) {
-          if (comp.Equals(dict.SolutionDictionary.Keys.ElementAt(i), dict.SolutionDictionary.Keys.ElementAt(j))) {
-            noDuplicates++;
-            break;
-          }
-        }
-      }
-
-      Assert.AreNotEqual(0, realDuplicates);
-      Assert.AreEqual(0, noDuplicates);
-      Assert.AreEqual(250, dict.SolutionDictionary.Keys.Count);
-    }
-  }
-}
Index: branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/ConvexHullView.Designer.cs
===================================================================
--- branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/ConvexHullView.Designer.cs	(revision 10059)
+++ branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/ConvexHullView.Designer.cs	(revision 10060)
@@ -40,6 +40,6 @@
       // resultsTextBox
       // 
-      this.resultsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
-            | System.Windows.Forms.AnchorStyles.Left)
+      this.resultsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
       this.resultsTextBox.Location = new System.Drawing.Point(3, 33);
@@ -64,6 +64,6 @@
     #endregion
 
-    private System.Windows.Forms.Button testConvexHullButton;
-    private System.Windows.Forms.TextBox resultsTextBox;
+    protected System.Windows.Forms.Button testConvexHullButton;
+    protected System.Windows.Forms.TextBox resultsTextBox;
 
   }
Index: branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/ConvexHullView.cs
===================================================================
--- branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/ConvexHullView.cs	(revision 10059)
+++ branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/ConvexHullView.cs	(revision 10060)
@@ -42,5 +42,5 @@
     }
 
-    protected void testConvexHullButton_Click(object sender, System.EventArgs e) {
+    protected virtual void testConvexHullButton_Click(object sender, System.EventArgs e) {
       for (int i = 0; i < 20; i++) {
         var sols = Content.GetSolutionsFromGeneration(i);
Index: branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views-3.3.csproj
===================================================================
--- branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views-3.3.csproj	(revision 10059)
+++ branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views-3.3.csproj	(revision 10060)
@@ -93,4 +93,9 @@
       <Private>False</Private>
     </Reference>
+    <Reference Include="HeuristicLab.Optimization.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization.Operators-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
     <Reference Include="HeuristicLab.Optimization.Views-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
       <Private>False</Private>
@@ -117,4 +122,9 @@
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.TravelingSalesman-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.TravelingSalesman-3.3.dll</HintPath>
       <Private>False</Private>
     </Reference>
Index: branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/PermutationConvexHullView.cs
===================================================================
--- branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/PermutationConvexHullView.cs	(revision 10059)
+++ branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/PermutationConvexHullView.cs	(revision 10060)
@@ -20,8 +20,10 @@
 #endregion
 
+using System;
 using System.Linq;
 using HeuristicLab.Analysis.SolutionCaching.PermutationEncoding;
 using HeuristicLab.Encodings.PermutationEncoding;
 using HeuristicLab.MainForm;
+using HeuristicLab.Problems.TravelingSalesman;
 
 namespace HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views {
@@ -34,4 +36,30 @@
       return vertex;
     }
+
+    protected override void testConvexHullButton_Click(object sender, System.EventArgs e) {
+      for (int i = 0; i < 20; i++) {
+        var sols = Content.GetSolutionsFromGeneration(i);
+        //double[][] pop = sols.Select(x => ConvertPermutationToVertex(x)).ToArray();  
+        //TODO: simCalculators should be somehow be selected based on problem
+
+        double[][] dm = new double[sols.Count][];
+        for (int j = 0; j < sols.Count; j++) {
+          dm[j] = new double[sols.Count];
+        }
+
+        for (int j = 0; j < sols.Count; j++) {
+          for (int k = 0; k < sols.Count; k++) {
+            dm[j][k] = TSPSimilarityCalculator.CalculateSimilarity(sols[j], sols[k]);
+          }
+        }
+
+        double[][] popPoints = DistanceMatrixToPoints.ConvertDistanceMatrixToPoints(dm);
+
+        var convexHull = HyperHull.CalculateUsingSMO(popPoints);
+        resultsTextBox.Text += "Nr. of Points in Generation " + i + ": " + convexHull.Count + Environment.NewLine;
+        resultsTextBox.Text += "Volume of Convex Hull in Generation " + i + " is: " +
+                               ConvexHullMeasures.CalculateVolume(convexHull) + Environment.NewLine;
+      }
+    }
   }
 }
Index: branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/ConvexHullMeasures.cs
===================================================================
--- branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/ConvexHullMeasures.cs	(revision 10059)
+++ branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/ConvexHullMeasures.cs	(revision 10060)
@@ -51,10 +51,10 @@
     }
 
-    //calculate inner point for boundary triangulation (slowwwww.....)
+    //calculate center for boundary triangulation (slowwwww.....)
     private static double[] CalculateInnerPoint(List<double[]> hyperHull) {
       double[] result = new double[hyperHull[0].Count()];
 
       for (int i = 0; i < hyperHull[0].Count(); i++) {
-        result[i] = hyperHull.Max(x => x[i]) - hyperHull.Min(x => x[i]);
+        result[i] = (hyperHull.Max(x => x[i]) + hyperHull.Min(x => x[i])) / 2.0;
       }
 
Index: branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/DistanceMatrixToPoints.cs
===================================================================
--- branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/DistanceMatrixToPoints.cs	(revision 10060)
+++ branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/DistanceMatrixToPoints.cs	(revision 10060)
@@ -0,0 +1,60 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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 System;
+
+namespace HeuristicLab.Analysis.AlgorithmBehavior.Analyzers {
+  public static class DistanceMatrixToPoints {
+    /*
+     *  Calculates a matrix of n-dimensional points from the distance matrix dm as described in 
+     *  http://math.stackexchange.com/questions/156161/finding-the-coordinates-of-points-from-distance-matrix/423898#423898
+     *  and
+     *  http://stackoverflow.com/questions/10963054/finding-the-coordinates-of-points-from-distance-matrix/17177833#17177833
+     *   
+     */
+    public static double[][] ConvertDistanceMatrixToPoints(double[][] dm) {
+      double[][] points = new double[dm.Length][];
+      for (int i = 0; i < dm.Length; i++) {
+        points[i] = new double[dm.Length];
+      }
+      double[,] m = new double[dm.Length, dm.Length];
+      double[] q = new double[dm.Length]; //eigenvalues
+      double[,] v = new double[dm.Length, dm.Length];  //eigenvectors
+
+      for (int i = 0; i < dm.Length; i++) {
+        for (int j = 0; j < dm.Length; j++) {
+          m[i, j] = 0.5 * (Math.Pow(dm[0][j], 2) + Math.Pow(dm[i][0], 2) - Math.Pow(dm[i][j], 2));
+        }
+      }
+
+      bool res = alglib.smatrixevd(m, dm.Length, 1, true, out q, out v);
+      if (!res) throw new Exception("Eigenvalue computation did not converge!");
+
+      for (int i = 0; i < dm.Length; i++) {
+        for (int j = 0; j < dm.Length; j++) {
+          points[j][i] = Math.Sqrt(q[i]) * v[j, i];
+        }
+      }
+
+      return points;
+    }
+  }
+}
Index: branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers-3.3.csproj
===================================================================
--- branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers-3.3.csproj	(revision 10059)
+++ branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers-3.3.csproj	(revision 10060)
@@ -118,4 +118,6 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="DistanceMatrixToPoints.cs" />
+    <Compile Include="VertexComparer.cs" />
     <Compile Include="CombinedOperator.cs" />
     <Compile Include="AlgorithmBehaviorHelpers.cs" />
@@ -133,4 +135,5 @@
     <Compile Include="ConvexHullMeasures.cs" />
     <Compile Include="IntegerExtensions.cs" />
+    <Compile Include="LPHull.cs" />
     <Compile Include="SelectionPressureAnalyzer.cs" />
     <Compile Include="SVM.cs" />
Index: branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/LPHull.cs
===================================================================
--- branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/LPHull.cs	(revision 10060)
+++ branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/LPHull.cs	(revision 10060)
@@ -0,0 +1,186 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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 System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace HeuristicLab.Analysis.AlgorithmBehavior.Analyzers {
+  /*
+   * Calculate Convex Hull using Linear Programming as described in
+   * J.B. Rosen et. al., 1989,  Efficient computation of convex hull in Rd
+   * and
+   * P.M. Pardalos et. al., 1995, 
+   * Linear programming approaches to the convex hull problem in Rm 
+   * 
+   */
+  public static class LPHull {
+    public static List<double[]> Calculate(double[][] inputs) {
+      List<double[]> C = new List<double[]>();
+      List<double[]> E = new List<double[]>();
+
+      //Phase 1
+      double[][] A = SortA(inputs);
+
+      //Phase 2
+      C.Add(A[0]);
+      for (int i = 1; i < A.Length; i++) {
+        if (EXT(C, A[i])) {
+          C.Add(A[i]);
+        }
+      }
+
+      //Phase 3
+      for (int i = 0; i < C.Count; i++) {
+        //TODO: this is not very efficient
+        if (EXT(ExcludeRow(C, i), C[i], i)) {
+          E.Add(C[i]);
+        }
+      }
+
+      return E;
+    }
+
+    private static List<double[]> ExcludeRow(List<double[]> matrix, int row) {
+      List<double[]> result = new List<double[]>();
+
+      for (int i = 0; i < matrix.Count; i++) {
+        if (i != row) {
+          var tmpRow = new double[matrix[i].Length];
+          result.Add(tmpRow);
+          for (int j = 0; j < matrix[i].Length; j++) {
+            tmpRow[j] = matrix[i][j];
+          }
+        }
+      }
+
+      return result;
+    }
+
+    //sort A decreasing by distance to center of polytope
+    public static double[][] SortA(double[][] A) {
+      //TODO: sort inplace
+      int length = A[0].Length;
+      double[] maxs = new double[length];
+      double[] mins = new double[length];
+      double[][] sortedA = new double[A.Length][];
+
+      for (int i = 0; i < maxs.Length; i++) {
+        maxs[i] = double.MinValue;
+        mins[i] = double.MaxValue;
+      }
+
+      for (int i = 0; i < A.Length; i++) {
+        for (int j = 0; j < A[i].Length; j++) {
+          if (A[i][j] > maxs[j]) maxs[j] = A[i][j];
+          if (A[i][j] < mins[j]) mins[j] = A[i][j];
+        }
+      }
+
+      double[] d = new double[length];
+      double[] r = new double[length];
+
+      //calculate center
+      for (int i = 0; i < length; i++) {
+        d[i] = (maxs[i] + mins[i]) / 2.0;
+      }
+
+      //calculate length of sides of rectangle
+      for (int i = 0; i < length; i++) {
+        r[i] = maxs[i] - mins[i];
+      }
+
+      VertexComparer comparer = new VertexComparer();
+      comparer.d = d;
+      comparer.r = r;
+      sortedA = A.OrderByDescending(x => x, comparer).ToArray();
+
+      return sortedA;
+    }
+
+    /// <summary>
+    /// Checks if alpha is an extreme point (lies on convex hull) of A. 
+    /// Returns true if alpha is an extreme point, else false. 
+    /// </summary>
+    private static bool EXT(List<double[]> A, double[] alpha, int aIdx = -1) {
+      alglib.minbleicstate state;
+      double diffstep = 1.0e-6;
+      int N = alpha.Length;
+      int K = A.Count;
+
+
+      double[] init = new double[N];
+      double[] lowerBound = new double[N];
+      double[] upperBound = new double[N];
+      double[] x;
+      alglib.minbleicreport rep;
+      double[,] c = new double[K + 1, N + 1];
+      int[] ct = new int[K + 1]; //init with 0, means equal
+
+      for (int i = 0; i < N; i++) {
+        //TODO: this should be a feasible solution    
+        init[i] = 1.0;
+        lowerBound[i] = 0.0;
+        upperBound[i] = double.MaxValue;
+      }
+
+      //last column gets b
+      for (int i = 0; i < K; i++) {
+        c[i, N] = alpha[i];
+      }
+      //sum(x) == 1 constraint
+      for (int i = 0; i < N + 1; i++) {
+        c[K, i] = 1.0;
+      }
+
+      for (int i = 0; i < K; i++) {
+        for (int j = 0; j < N; j++) {
+          c[j, i] = A[i][j];
+        }
+      }
+
+      alglib.minbleiccreatef(init, diffstep, out state);
+      alglib.minbleicsetbc(state, lowerBound, upperBound);
+      alglib.minbleicsetlc(state, c, ct);
+      alglib.minbleicsetcond(state, 0.0, 0.0, 0.0, 0);
+      alglib.minbleicoptimize(state, Func, null, new Tuple<List<double[]>, int>(A, aIdx));
+      alglib.minbleicresults(state, out x, out rep);
+
+      return x.Sum() > 0;
+    }
+
+    private static void Func(double[] x, ref double func, object obj) {
+      Tuple<List<double[]>, int> data = obj as Tuple<List<double[]>, int>;
+      int aIdx = data.Item2;
+      List<double[]> A = data.Item1;
+
+      //TODO: I have no idea what I'm doing...
+      func = 0.0;
+      for (int i = 0; i < A.Count; i++) {
+        if (i != aIdx) {
+          for (int j = 0; j < A[i].Length; j++) {
+            func += A[i][j] * x[i];
+          }
+        }
+      }
+    }
+  }
+}
Index: branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/VertexComparer.cs
===================================================================
--- branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/VertexComparer.cs	(revision 10060)
+++ branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/VertexComparer.cs	(revision 10060)
@@ -0,0 +1,50 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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 System.Collections.Generic;
+using HeuristicLab.Common;
+
+namespace HeuristicLab.Analysis.AlgorithmBehavior.Analyzers {
+  public class VertexComparer : Comparer<double[]> {
+    public double[] d;
+    public double[] r;
+
+    private double CalculateWeight(double[] x) {
+      double max = double.MinValue;
+      for (int i = 0; i < x.Length; i++) {
+        double w = (x[i] - d[i]) / r[i];
+        if (w > max) max = w;
+      }
+      return max;
+    }
+
+    public override int Compare(double[] x, double[] y) {
+      double xw = CalculateWeight(x);
+      double yw = CalculateWeight(y);
+
+      if (xw.IsAlmost(yw))
+        return 0;
+      if (xw > yw)
+        return 1;
+      return -1; /*if (xw < yw)*/
+    }
+  }
+}
Index: branches/HeuristicLab.Analysis.AlgorithmBehavior/MIConvexHull/MIConvexHull.csproj
===================================================================
--- branches/HeuristicLab.Analysis.AlgorithmBehavior/MIConvexHull/MIConvexHull.csproj	(revision 10059)
+++ branches/HeuristicLab.Analysis.AlgorithmBehavior/MIConvexHull/MIConvexHull.csproj	(revision 10060)
@@ -30,5 +30,5 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
-    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <OutputPath>..\..\..\trunk\sources\bin\</OutputPath>
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
@@ -38,5 +38,5 @@
     <DebugType>pdbonly</DebugType>
     <Optimize>true</Optimize>
-    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <OutputPath>..\..\..\trunk\sources\bin\</OutputPath>
     <DefineConstants>TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
