Index: branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Algorithms/ExtremePointAlgorithm.cs
===================================================================
--- branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Algorithms/ExtremePointAlgorithm.cs	(revision 15617)
+++ branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Algorithms/ExtremePointAlgorithm.cs	(revision 15646)
@@ -202,8 +202,8 @@
     /// <param name="token"></param>
     /// <returns></returns>
-    private Tuple<Solution, double, SortingMethod?, FittingMethod?, ExtremePointCreationMethod?> 
-          GetBest(PackingShape bin, 
-                  IList<PackingItem> items, 
-                  SortingMethod[] sortings, 
+    private Tuple<Solution, double, SortingMethod?, FittingMethod?, ExtremePointCreationMethod?>
+          GetBest(PackingShape bin,
+                  IList<PackingItem> items,
+                  SortingMethod[] sortings,
                   FittingMethod[] fittings,
                   ExtremePointCreationMethod[] epCreationMethods,
@@ -222,5 +222,5 @@
             };
             Permutation sortedItems;
-                    
+
             if (SortByMaterialParameter.Value.Value) {
               sortedItems = SortItemsByMaterialAndSortingMethod(bin, items, sort, DeltaParameter.Value.Value);
@@ -229,5 +229,5 @@
             }
 
-            var result = Optimize(new OptimaizationParamters() {
+            var solution = Optimize(new OptimaizationParamters() {
               SortedItems = sortedItems,
               Bin = bin,
@@ -238,5 +238,17 @@
               ExtremePointGeneration = epCreation
             });
-          
+
+            if (solution.IsBetterThan(bestSolution, Problem.SolutionEvaluator, Problem.Maximization)) {
+              bestSolution = solution;
+              best = Problem.SolutionEvaluator.Evaluate(solution);
+              bestSorting = sort;
+              bestFitting = fit;
+              bestEPCreation = epCreation;
+            }
+
+
+            var x = Problem.SolutionEvaluator.Evaluate1(solution);
+
+            /*
             if (double.IsNaN(result.Item2) || double.IsInfinity(result.Item2)) {
               continue;
@@ -250,4 +262,6 @@
               bestEPCreation = epCreation;
             }
+            return true;*/
+
             if (token.IsCancellationRequested) {
               return Tuple.Create(bestSolution, best, bestSorting, bestFitting, bestEPCreation);
@@ -267,10 +281,10 @@
     /// <param name="parameters"></param>
     /// <returns></returns>
-    private static Tuple<Solution, double> Optimize(OptimaizationParamters parameters) { 
-      
+    private static Solution Optimize(OptimaizationParamters parameters) {
+
       var sol = parameters.Decoder.Decode(parameters.SortedItems, parameters.Bin, parameters.Items, parameters.StackingConstraints);
-      var fit = parameters.Evaluator.Evaluate(sol);
-
-      return Tuple.Create(sol, fit);
+      //var fit = parameters.Evaluator.Evaluate(sol);
+
+      return sol; //Tuple.Create(sol, fit);
     }
 
@@ -284,8 +298,47 @@
       public ExtremePointCreationMethod ExtremePointGeneration { get; set; }
     }
-    
+
 
     /// <summary>
     /// Returns a new permutation of the given items depending on the sorting method
+    /// </summary>
+    /// <param name="bin"></param>
+    /// <param name="items"></param>
+    /// <param name="sortingMethod"></param>
+    /// <param name="delta"></param>
+    /// <returns></returns>
+    private Permutation SortItemsByMaterialAndSortingMethod(PackingShape bin, IList<PackingItem> items, SortingMethod sortingMethod, double delta) {
+      Permutation sorted = null;
+
+      switch (sortingMethod) {
+        case SortingMethod.Given:
+          sorted = new Permutation(PermutationTypes.Absolute, Enumerable.Range(0, items.Count).ToArray());
+          break;
+        case SortingMethod.VolumeHeight:
+          sorted = items.SortByVolumeHeight();
+          break;
+        case SortingMethod.HeightVolume:
+          sorted = items.SortByMaterialHeightVolume();
+          break;
+        case SortingMethod.AreaHeight:
+          sorted = items.SortByMaterialAreaHeight();
+          break;
+        case SortingMethod.HeightArea:
+          sorted = items.SortByMaterialHeightArea();
+          break;
+        case SortingMethod.ClusteredAreaHeight:
+          sorted = items.SortByMaterialClusteredAreaHeight(bin, delta);
+          break;
+        case SortingMethod.ClusteredHeightArea:
+          sorted = items.SortByMaterialClusteredHeightArea(bin, delta);
+          break;
+        default:
+          throw new ArgumentException("Unknown sorting method: " + sortingMethod);
+      }
+      return sorted;
+    }
+
+    /// <summary>
+    /// Returns a new permutation of the given items depending on the material and sorting method
     /// </summary>
     /// <param name="bin"></param>
@@ -296,5 +349,5 @@
     private Permutation SortItemsBySortingMethod(PackingShape bin, IList<PackingItem> items, SortingMethod sortingMethod, double delta) {
       Permutation sorted = null;
-      
+
       switch (sortingMethod) {
         case SortingMethod.Given:
@@ -305,17 +358,17 @@
           break;
         case SortingMethod.HeightVolume:
-          sorted = items.SortByMaterialHeightVolume();
+          sorted = items.SortByHeightVolume();
           break;
         case SortingMethod.AreaHeight:
-          sorted = items.SortByMaterialAreaHeight();
+          sorted = items.SortByAreaHeight();
           break;
         case SortingMethod.HeightArea:
-          sorted = items.SortByMaterialHeightArea();
+          sorted = items.SortByHeightArea();
           break;
         case SortingMethod.ClusteredAreaHeight:
-          sorted = items.SortByMaterialClusteredAreaHeight(bin, delta);
+          sorted = items.SortByClusteredAreaHeight(bin, delta);
           break;
         case SortingMethod.ClusteredHeightArea:
-          sorted = items.SortByMaterialClusteredHeightArea(bin, delta);
+          sorted = items.SortByClusteredHeightArea(bin, delta);
           break;
         default:
@@ -324,43 +377,4 @@
       return sorted;
     }
-
-    /// <summary>
-    /// Returns a new permutation of the given items depending on the material and sorting method
-    /// </summary>
-    /// <param name="bin"></param>
-    /// <param name="items"></param>
-    /// <param name="sortingMethod"></param>
-    /// <param name="delta"></param>
-    /// <returns></returns>
-    private Permutation SortItemsByMaterialAndSortingMethod(PackingShape bin, IList<PackingItem> items, SortingMethod sortingMethod, double delta) {
-      Permutation sorted = null;
-
-      switch (sortingMethod) {
-        case SortingMethod.Given:
-          sorted = new Permutation(PermutationTypes.Absolute, Enumerable.Range(0, items.Count).ToArray());
-          break;
-        case SortingMethod.VolumeHeight:
-          sorted = items.SortByVolumeHeight();
-          break;
-        case SortingMethod.HeightVolume:
-          sorted = items.SortByHeightVolume();
-          break;
-        case SortingMethod.AreaHeight:
-          sorted = items.SortByAreaHeight();
-          break;
-        case SortingMethod.HeightArea:
-          sorted = items.SortByHeightArea();
-          break;
-        case SortingMethod.ClusteredAreaHeight:
-          sorted = items.SortByClusteredAreaHeight(bin, delta);
-          break;
-        case SortingMethod.ClusteredHeightArea:
-          sorted = items.SortByClusteredHeightArea(bin, delta);
-          break;
-        default:
-          throw new ArgumentException("Unknown sorting method: " + sortingMethod);
-      }
-      return sorted;
-    }
   }
 }
