Index: branches/HeuristicLab.Analysis.AlgorithmBehavior/AlgorithmBehaviorUnitTests/AlgorithmBehaviorUnitTests.csproj
===================================================================
--- branches/HeuristicLab.Analysis.AlgorithmBehavior/AlgorithmBehaviorUnitTests/AlgorithmBehaviorUnitTests.csproj	(revision 10026)
+++ 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 10026)
+++ 	(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);
-    }
-  }
-}
