Index: branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Packer/BinPacker.cs
===================================================================
--- branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Packer/BinPacker.cs	(revision 15554)
+++ branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Packer/BinPacker.cs	(revision 15617)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2016 Joseph Helm and Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
@@ -49,4 +49,5 @@
     public BinPacker() { }
 
+   
     /// <summary>
     /// Packs all items of the bin packer and returns a collection of BinPacking3D objects
@@ -57,5 +58,5 @@
     /// <param name="useStackingConstraints">Flag for using stacking constraints</param>
     /// <returns>Returns a collection of bin packing 3d objects. Each object represents a bin and the packed items</returns>
-    public abstract IList<BinPacking3D> PackItems(Permutation sortedItems, PackingShape binShape, IList<PackingItem> items, ExtremePointCreationMethod epCreationMethod, bool useStackingConstraints);
+    public abstract IList<BinPacking3D> PackItems(Permutation sortedItems, PackingShape binShape, IList<PackingItem> items, ExtremePointCreationMethod epCreationMethod, ExtremePointPruningMethod epPruningMethod, bool useStackingConstraints);
     
     /// <summary>
@@ -66,10 +67,5 @@
     /// <param name="packingItem"></param>
     /// <param name="position"></param>
-    protected virtual void PackItem(BinPacking3D packingBin, int itemId, PackingItem packingItem, PackingPosition position, IExtremePointCreator extremePointCreator, bool useStackingConstraints) {
-      if (!CheckItemDimensions(packingBin, packingItem, position)) {
-        throw new BinPacking3DException($"The dimensions of the given item exceeds the bin dimensions. " +
-          $"Bin: ({packingBin.BinShape.Width} {packingBin.BinShape.Depth} {packingBin.BinShape.Height})" +
-          $"Item: ({packingItem.Width} {packingItem.Depth} {packingItem.Height})");
-      }
+    protected virtual void PackItem(BinPacking3D packingBin, int itemId, PackingItem packingItem, PackingPosition position, IExtremePointCreator extremePointCreator, bool useStackingConstraints) {      
       packingBin.PackItem(itemId, packingItem, position);
       extremePointCreator.UpdateBinPacking(packingBin, packingItem, position);
@@ -82,11 +78,16 @@
     /// <param name="packingItem"></param>
     /// <param name="useStackingConstraints"></param>
-    /// <param name="rotated"></param>
     /// <returns>Returns the packing position for an given item. If there could not be found a valid position it returns null</returns>
-    protected PackingPosition FindPackingPositionForItem(BinPacking3D packingBin, PackingItem packingItem, bool useStackingConstraints, bool rotated) {
+    protected virtual PackingPosition FindPackingPositionForItem(BinPacking3D packingBin, PackingItem packingItem, bool useStackingConstraints) {
+      if (!CheckItemDimensions(packingBin, packingItem)) {
+        throw new BinPacking3DException($"The dimensions of the given item exceeds the bin dimensions. " +
+          $"Bin: ({packingBin.BinShape.Width} {packingBin.BinShape.Depth} {packingBin.BinShape.Height})" +
+          $"Item: ({packingItem.Width} {packingItem.Depth} {packingItem.Height})");
+      }
+
       PackingItem newItem = new PackingItem(
-        rotated ? packingItem.Depth : packingItem.Width,
+        packingItem.Width,
         packingItem.Height,
-        rotated ? packingItem.Width : packingItem.Depth,
+        packingItem.Depth,
         packingItem.TargetBin, packingItem.Weight, packingItem.Material);
 
@@ -102,9 +103,23 @@
     /// <param name="item"></param>
     /// <returns>Returns true if the dimensions of an given item are less or equal to the bin.</returns>
-    private bool CheckItemDimensions(BinPacking3D packingBin, PackingItem item, PackingPosition itemPosition) {
-      var width = itemPosition.Rotated ? item.Depth : item.Width;
-      var depth = itemPosition.Rotated ? item.Width : item.Depth;
+    protected virtual bool CheckItemDimensions(BinPacking3D packingBin, PackingItem item) {
+      var width = item.Width;
+      var depth = item.Depth;
       return packingBin.BinShape.Width >= width && packingBin.BinShape.Height >= item.Height && packingBin.BinShape.Depth >= depth;
     }
+
+    /// <summary>
+    /// Clones a given list of packing items.
+    /// </summary>
+    /// <param name="items"></param>
+    /// <returns></returns>
+    protected static IList<PackingItem> CloneItems(IList<PackingItem> items) {
+      var clonedItems = new List<PackingItem>();
+      foreach (var item in items) {
+        clonedItems.Add(item.Clone() as PackingItem);
+      }
+      return clonedItems;
+    }
+
   }
 }
Index: branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Packer/BinPackerFactory.cs
===================================================================
--- branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Packer/BinPackerFactory.cs	(revision 15554)
+++ branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Packer/BinPackerFactory.cs	(revision 15617)
@@ -1,3 +1,24 @@
-﻿using System;
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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;
@@ -29,4 +50,7 @@
           binPacker = new BinPackerResidualSpaceBestFit();
           break;
+        case FittingMethod.MinimumResidualSpaceLeft:
+          binPacker = new BinPackerMinRSLeft();
+          break;
         default:
           throw new ArgumentException("Unknown fitting method: " + fittingMethod);
Index: branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Packer/BinPackerFirstFit.cs
===================================================================
--- branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Packer/BinPackerFirstFit.cs	(revision 15554)
+++ branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Packer/BinPackerFirstFit.cs	(revision 15617)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2016 Joseph Helm and Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
@@ -25,4 +25,5 @@
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
 using HeuristicLab.Problems.BinPacking3D.ExtremePointCreation;
+using HeuristicLab.Problems.BinPacking3D.ExtremePointPruning;
 using System;
 using System.Collections.Generic;
@@ -52,5 +53,5 @@
     /// </summary>
     /// <returns>Returns a collection of bin packing 3d objects. Each object represents a bin and the packed items</returns>
-    public override IList<BinPacking3D> PackItems(Permutation sortedItems, PackingShape binShape, IList<PackingItem> items, ExtremePointCreationMethod epGenerationMethod, bool useStackingConstraints) {
+    public override IList<BinPacking3D> PackItems(Permutation sortedItems, PackingShape binShape, IList<PackingItem> items, ExtremePointCreationMethod epCreationMethod, ExtremePointPruningMethod epPruningMethod, bool useStackingConstraints) {
       IList<BinPacking3D> packingList = new List<BinPacking3D>();
       IList<int> remainingIds = new List<int>(sortedItems);
@@ -58,8 +59,9 @@
       while (remainingIds.Count > 0) {
         BinPacking3D packingBin = new BinPacking3D(binShape);
-        PackRemainingItems(ref remainingIds, ref packingBin, items, epGenerationMethod, useStackingConstraints, null);
+        PackRemainingItems(ref remainingIds, ref packingBin, items, epCreationMethod, useStackingConstraints);
         packingList.Add(packingBin);
       }
 
+      ExtremePointPruningFactory.CreatePruning().PruneExtremePoints(epPruningMethod, packingList);
       return packingList;
     }
@@ -69,11 +71,12 @@
     /// </summary>
     /// <param name="remainingIds">List of remaining ids. After the method has been executed the list has to have less items</param>
+    /// <param name="packingBin">This object will be filled with some of the given items</param>
     /// <param name="items">List of packing items. Some of the items will be assigned to the BinPacking3D object</param>
-    /// <param name="packingBin">This object will be filled with some of the given items</param>
-    protected void PackRemainingItems(ref IList<int> remainingIds, ref BinPacking3D packingBin, IList<PackingItem> items, ExtremePointCreationMethod epCreationMethod, bool useStackingConstraints, Dictionary<int, bool> rotationArray) {
+    /// <param name="epCreationMethod"></param>
+    /// <param name="useStackingConstraints"></param>
+    protected void PackRemainingItems(ref IList<int> remainingIds, ref BinPacking3D packingBin, IList<PackingItem> items, ExtremePointCreationMethod epCreationMethod, bool useStackingConstraints) {
       IExtremePointCreator extremePointCreator = ExtremePointCreatorFactory.CreateExtremePointCreator(epCreationMethod, useStackingConstraints);
       foreach (var itemId in new List<int>(remainingIds)) {
-        bool rotated = rotationArray == null ? false : rotationArray[itemId];
-        PackingPosition position = FindPackingPositionForItem(packingBin, items[itemId], useStackingConstraints, rotated);
+        PackingPosition position = FindPackingPositionForItem(packingBin, items[itemId], useStackingConstraints);
         // if a valid packing position could be found, the current item can be added to the given bin
         if (position != null) {
Index: branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Packer/BinPackerFreeVolumeBestFit.cs
===================================================================
--- branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Packer/BinPackerFreeVolumeBestFit.cs	(revision 15554)
+++ branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Packer/BinPackerFreeVolumeBestFit.cs	(revision 15617)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2016 Joseph Helm and Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
@@ -25,4 +25,5 @@
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
 using HeuristicLab.Problems.BinPacking3D.ExtremePointCreation;
+using HeuristicLab.Problems.BinPacking3D.ExtremePointPruning;
 using System;
 using System.Collections.Generic;
@@ -61,5 +62,5 @@
     /// <param name="useStackingConstraints"></param>
     /// <returns>Returns a collection of bin packing 3d objects. Each object represents a bin and the packed items</returns>
-    public override IList<BinPacking3D> PackItems(Permutation sortedItems, PackingShape binShape, IList<PackingItem> items, ExtremePointCreationMethod epGenerationMethod, bool useStackingConstraints) {
+    public override IList<BinPacking3D> PackItems(Permutation sortedItems, PackingShape binShape, IList<PackingItem> items, ExtremePointCreationMethod epGenerationMethod, ExtremePointPruningMethod epPruningMethod, bool useStackingConstraints) {
       IList<BinPacking3D> packingList = new List<BinPacking3D>();
       IList<int> remainingIds = new List<int>(sortedItems);
@@ -73,5 +74,5 @@
 
         foreach (var packingBin in sortedBins) {
-          PackingPosition position = FindPackingPositionForItem(packingBin, item, useStackingConstraints, false);
+          PackingPosition position = FindPackingPositionForItem(packingBin, item, useStackingConstraints);
           positionFound = position != null;
           var bin = packingBin;
@@ -84,5 +85,5 @@
         if (!positionFound) {
           BinPacking3D packingBin = new BinPacking3D(binShape);
-          PackingPosition position = FindPackingPositionForItem(packingBin, item, useStackingConstraints, false);
+          PackingPosition position = FindPackingPositionForItem(packingBin, item, useStackingConstraints);
 
           if (position == null) {
@@ -94,4 +95,5 @@
         }
       }
+      ExtremePointPruningFactory.CreatePruning().PruneExtremePoints(epPruningMethod, packingList);
       return packingList.ToList();
     }
Index: branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Packer/BinPackerResidualSpaceBestFit.cs
===================================================================
--- branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Packer/BinPackerResidualSpaceBestFit.cs	(revision 15554)
+++ branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Packer/BinPackerResidualSpaceBestFit.cs	(revision 15617)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2016 Joseph Helm and Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
@@ -25,4 +25,5 @@
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
 using HeuristicLab.Problems.BinPacking3D.ExtremePointCreation;
+using HeuristicLab.Problems.BinPacking3D.ExtremePointPruning;
 using System;
 using System.Collections.Generic;
@@ -55,9 +56,8 @@
     /// </summary>
     /// <returns>Returns a collection of bin packing 3d objects. Each object represents a bin and the packed items</returns>
-    public override IList<BinPacking3D> PackItems(Permutation sortedItems, PackingShape binShape, IList<PackingItem> items, ExtremePointCreationMethod epCreationMethod, bool useStackingConstraints) {
+    public override IList<BinPacking3D> PackItems(Permutation sortedItems, PackingShape binShape, IList<PackingItem> items, ExtremePointCreationMethod epCreationMethod, ExtremePointPruningMethod epPruningMethod, bool useStackingConstraints) {
       IList<BinPacking3D> packingList = new List<BinPacking3D>();
       IList<int> remainingIds = new List<int>(sortedItems);
       IExtremePointCreator extremePointCreator = ExtremePointCreatorFactory.CreateExtremePointCreator(epCreationMethod, useStackingConstraints);
-      bool rotated = false;
 
       foreach (var remainingId in remainingIds) {
@@ -78,5 +78,5 @@
         if (!packed) {
           BinPacking3D binPacking = new BinPacking3D(binShape);
-          var position = FindPackingPositionForItem(binPacking, item, useStackingConstraints, rotated);
+          var position = FindPackingPositionForItem(binPacking, item, useStackingConstraints);
           if (position != null) {
             PackItem(binPacking, remainingId, item, position, extremePointCreator, useStackingConstraints);
@@ -87,4 +87,6 @@
         }
       }
+
+      ExtremePointPruningFactory.CreatePruning().PruneExtremePoints(epPruningMethod, packingList);
       return packingList;
     }
Index: branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Packer/IBinPacker.cs
===================================================================
--- branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Packer/IBinPacker.cs	(revision 15554)
+++ branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Packer/IBinPacker.cs	(revision 15617)
@@ -1,3 +1,24 @@
-﻿using HeuristicLab.Encodings.PermutationEncoding;
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2018 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.Encodings.PermutationEncoding;
 using System;
 using System.Collections.Generic;
@@ -16,5 +37,5 @@
     /// <param name="useStackingConstraints">Flag for using stacking constraints</param>
     /// <returns>Returns a collection of bin packing 3d objects. Each object represents a bin and the packed items</returns>
-    IList<BinPacking3D> PackItems(Permutation sortedItems, PackingShape binShape, IList<PackingItem> items, ExtremePointCreationMethod epCreationMethod, bool useStackingConstraints);
+    IList<BinPacking3D> PackItems(Permutation sortedItems, PackingShape binShape, IList<PackingItem> items, ExtremePointCreationMethod epCreationMethod, ExtremePointPruningMethod epPruningMethod, bool useStackingConstraints);
 
   }
