Index: branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Evaluation/Evaluation.cs
===================================================================
--- branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Evaluation/Evaluation.cs	(revision 15512)
+++ branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Evaluation/Evaluation.cs	(revision 15553)
@@ -1,3 +1,24 @@
-﻿using System.Collections.Generic;
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2017 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 System.Linq;
 using HeuristicLab.Common;
Index: branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/GQAPInstance.cs
===================================================================
--- branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/GQAPInstance.cs	(revision 15512)
+++ branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/GQAPInstance.cs	(revision 15553)
@@ -191,6 +191,7 @@
 
     public Evaluation Evaluate(IntegerVector assignment) {
-      return EvaluateIntegerVector(assignment, Demands, Capacities,
+      var evaluation = EvaluateIntegerVector(assignment, Demands, Capacities,
         InstallationCosts, Weights, Distances);
+      return evaluation;
     }
 
@@ -217,4 +218,22 @@
     }
 
+    public GQAPSolution ToEvaluatedSolution(IntegerVector assignment) {
+      var evaluation = EvaluateIntegerVector(assignment, Demands, Capacities,
+InstallationCosts, Weights, Distances);
+      return new GQAPSolution(assignment, evaluation);
+    }
+
+    public bool IsFeasible(IntegerVector assignment) {
+      int len = assignment.Length;
+      var utilization = new double[Capacities.Length];
+      for (var equip = 0; equip < len; equip++) {
+        var loc = assignment[equip];
+        utilization[loc] += Demands[equip];
+        if (utilization[loc] > Capacities[loc])
+          return false;
+      }
+      return true;
+    }
+
     public double ToSingleObjective(Evaluation fitness) {
       return fitness.IsFeasible
Index: branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/GQAPSolution.cs
===================================================================
--- branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/GQAPSolution.cs	(revision 15512)
+++ branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/GQAPSolution.cs	(revision 15553)
@@ -36,7 +36,7 @@
       get { return assignment; }
       set {
-        bool changed = (assignment != value);
+        if (assignment == value) return;
         assignment = value;
-        if (changed) OnPropertyChanged("Assignment");
+        OnPropertyChanged(nameof(Assignment));
       }
     }
Index: branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/HeuristicLab.Problems.GeneralizedQuadraticAssignment-3.3.csproj
===================================================================
--- branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/HeuristicLab.Problems.GeneralizedQuadraticAssignment-3.3.csproj	(revision 15512)
+++ branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/HeuristicLab.Problems.GeneralizedQuadraticAssignment-3.3.csproj	(revision 15553)
@@ -41,6 +41,6 @@
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="HeuristicLab.Analysis-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=x86">
-      <SpecificVersion>False</SpecificVersion>
+    <Reference Include="HeuristicLab.Analysis-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Analysis-3.3.dll</HintPath>
       <Private>False</Private>
     </Reference>
@@ -69,5 +69,6 @@
       <Private>False</Private>
     </Reference>
-    <Reference Include="HeuristicLab.Optimization.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+    <Reference Include="HeuristicLab.Optimization.Operators-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization.Operators-3.3.dll</HintPath>
       <Private>False</Private>
     </Reference>
@@ -84,10 +85,10 @@
       <Private>False</Private>
     </Reference>
-    <Reference Include="HeuristicLab.Problems.Instances-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
+    <Reference Include="HeuristicLab.Problems.Instances-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath>
       <Private>False</Private>
     </Reference>
-    <Reference Include="HeuristicLab.Random-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
+    <Reference Include="HeuristicLab.Random-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Random-3.3.dll</HintPath>
       <Private>False</Private>
     </Reference>
@@ -170,5 +171,4 @@
     </ProjectReference>
   </ItemGroup>
-  <ItemGroup />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <PropertyGroup>
Index: branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Moves/StochasticNMoveSingleMoveGenerator.cs
===================================================================
--- branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Moves/StochasticNMoveSingleMoveGenerator.cs	(revision 15512)
+++ branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Moves/StochasticNMoveSingleMoveGenerator.cs	(revision 15553)
@@ -57,16 +57,55 @@
     }
 
+    public static NMove GenerateOneMove(IRandom random, IntegerVector assignment, DoubleArray capacities) {
+      var locations = capacities.Length;
+      if (locations <= 1) throw new ArgumentException("There must be at least two locations.");
+      var dim = assignment.Length;
+      var equip = random.Next(dim);
+      var equipments = new List<int>(1) { equip };
+
+      var reassignment = new int[dim];
+      reassignment[equip] = ReassignEquipment(random, equip, assignment[equip], locations);
+
+      return new NMove(reassignment, equipments);
+    }
+
+    public static NMove GenerateTwoMove(IRandom random, IntegerVector assignment, DoubleArray capacities) {
+      var locations = capacities.Length;
+      if (locations <= 1) throw new ArgumentException("There must be at least two locations.");
+      var dim = assignment.Length;
+      var equipments = new List<int>(2) { random.Next(dim), -1 };
+      do {
+        equipments[1] = random.Next(dim);
+      } while (equipments[0] == equipments[1]);
+
+      var reassignment = new int[dim];
+      for (var i = 0; i < 2; i++) {
+        var equip = equipments[i];
+        reassignment[equip] = ReassignEquipment(random, equip, assignment[equip], locations);
+      }
+      return new NMove(reassignment, equipments);
+    }
+
     public static NMove GenerateExactlyN(IRandom random, IntegerVector assignment, int n, DoubleArray capacities) {
-      if (capacities.Length <= 1) throw new ArgumentException("There must be at least two locations.");
+      if (n == 1) return GenerateOneMove(random, assignment, capacities);
+      if (n == 2) return GenerateTwoMove(random, assignment, capacities);
+      var locations = capacities.Length;
+      if (locations <= 1) throw new ArgumentException("There must be at least two locations.");
       var dim = assignment.Length;
+      var equipments = Enumerable.Range(0, dim).SampleRandomWithoutRepetition(random, n, dim).ToList();
+
       var reassignment = new int[dim];
-      var equipments = Enumerable.Range(0, dim).SampleRandomWithoutRepetition(random, n, dim).ToList();
       for (var i = 0; i < n; i++) {
         var equip = equipments[i];
-        do {
-          reassignment[equip] = random.Next(capacities.Length) + 1;
-        } while (reassignment[equip] == assignment[equip] + 1);
+        reassignment[equip] = ReassignEquipment(random, equip, assignment[equip], locations);
       }
       return new NMove(reassignment, equipments);
+    }
+
+    private static int ReassignEquipment(IRandom random, int equip, int prevLocation, int locations) {
+      var newLoc = random.Next(locations) + 1;
+      while (newLoc == prevLocation + 1)
+        newLoc = random.Next(locations) + 1;
+      return newLoc;
     }
 
Index: branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Operators/Crossovers/GQAPPathRelinking.cs
===================================================================
--- branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Operators/Crossovers/GQAPPathRelinking.cs	(revision 15512)
+++ branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Operators/Crossovers/GQAPPathRelinking.cs	(revision 15553)
@@ -61,128 +61,122 @@
     }
 
-    public static IntegerVector Apply(IRandom random, ItemArray<IntegerVector> parents, ItemArray<DoubleValue> qualities,
-      GQAPInstance problemInstance, double candidateSizeFactor) {
-      if (random == null) throw new ArgumentNullException("random", "No IRandom provider is given.");
-      if (parents == null || !parents.Any()) throw new ArgumentException("No parents given for path relinking.", "parents");
-      if (parents.Length != 2) throw new ArgumentException(String.Format("Two parents were expected for path relinking, but {0} was/were given.", parents.Length.ToString()), "parents");
-      if (parents[0].Length != parents[1].Length) throw new ArgumentException("The length of the parents is not equal.", "parents");
-      if (qualities == null || qualities.Length == 0) throw new ArgumentException("The qualities are not given.", "qualities");
-      if (qualities.Length != parents.Length) throw new ArgumentException(String.Format("There are a different number of parents ({0}) than quality values ({1})", parents.Length.ToString(), qualities.Length.ToString()));
-      
-      var source = parents[0];
-      var target = parents[1];
-      IntegerVector result;
-      double resultQuality;
-
-      int betterParent = (qualities[0].Value <= qualities[1].Value) ? 0 : 1;
-
-      result = (IntegerVector)parents[betterParent].Clone();
-      resultQuality = qualities[betterParent].Value;
-
+    public static GQAPSolution Apply(IRandom random,
+      IntegerVector source, Evaluation sourceEval,
+      IntegerVector target, Evaluation targetEval,
+      GQAPInstance problemInstance, double candidateSizeFactor,
+      out int evaluatedSolutions) {
+      evaluatedSolutions = 0;
       var demands = problemInstance.Demands;
       var capacities = problemInstance.Capacities;
-
       var cmp = new IntegerVectorEqualityComparer();
 
-      var pi_prime = (IntegerVector)source.Clone();
-      var fix = new HashSet<int>();
-      var nonFix = new HashSet<int>(Enumerable.Range(0, demands.Length));
-      var phi = new HashSet<int>((IntegerVectorEqualityComparer.GetDifferingIndices(pi_prime, target)));
+      var sFit = problemInstance.ToSingleObjective(sourceEval);
+      var tFit = problemInstance.ToSingleObjective(targetEval);
+      GQAPSolution pi_star = sFit < tFit ? new GQAPSolution(source, sourceEval) : new GQAPSolution(target, targetEval); // line 1 of Algorithm 4
+      double pi_star_Fit = problemInstance.ToSingleObjective(pi_star.Evaluation); // line 2 of Algorithm 4
+      
+      var pi_prime = (IntegerVector)source.Clone(); // line 3 of Algorithm 4
+      //var fix = new bool[demands.Length]; // line 3 of Algorithm 4, note that according to the description it is not necessary to track the fixed equipments
+      var nonFix = Enumerable.Range(0, demands.Length).ToList(); // line 3 of Algorithm 4
+      var phi = new HashSet<int>(IntegerVectorEqualityComparer.GetDifferingIndices(pi_prime, target)); // line 4 of Algorithm 4
 
-      while (phi.Any()) {
-        var B = new List<Tuple<GQAPSolution, double>>();
-        foreach (var v in phi) {
+      while (phi.Count > 0) { // line 5 of Algorithm 4
+        var B = new List<GQAPSolution>((int)Math.Ceiling(phi.Count * candidateSizeFactor)); // line 6 of Algorithm 4
+        var B_fit = new List<double>(B.Capacity); // line 6 of Algorithm 4 (B is split into two synchronized lists)
+        foreach (var v in phi) { // line 7 of Algorithm 4
           int oldLocation = pi_prime[v];
-          pi_prime[v] = target[v];
-          var pi2 = MakeFeasible(random, pi_prime, v, nonFix, demands, capacities);
-          pi_prime[v] = oldLocation;
+          pi_prime[v] = target[v]; // line 8 of Algorithm 4
+          var pi_dash = MakeFeasible(random, pi_prime, v, nonFix, demands, capacities); // line 9 of Algorithm 4
+          pi_prime[v] = oldLocation; // not mentioned in Algorithm 4, but seems reasonable
+          var pi_dash_eval = problemInstance.Evaluate(pi_dash);
+          evaluatedSolutions++;
+          var pi_dash_fit = problemInstance.ToSingleObjective(pi_dash_eval);
 
-          var currentEval = problemInstance.Evaluate(pi2);
+          if (problemInstance.IsFeasible(pi_dash)) { // line 10 of Algorithm 4
+            if (B.Any(x => cmp.Equals(x.Assignment, pi_dash))) continue; // cond. 2 of line 12 and cond. 1 of line 16 in Algorithm 4
 
-          if (currentEval.ExcessDemand <= 0.0) {
-            var quality = problemInstance.ToSingleObjective(currentEval);
-
-            var solution = new GQAPSolution(pi2, currentEval);
-            if (B.Count >= candidateSizeFactor * phi.Count) {
-              int mostSimilarIndex = -1;
-              double mostSimilarValue = 1.0;
-              for (int i = 0; i < B.Count; i++) {
-                if (quality < B[i].Item2) {
-                  var similarity = HammingSimilarityCalculator.CalculateSimilarity(solution.Assignment, B[i].Item1.Assignment);
-                  if (similarity == 1.0) {
-                    mostSimilarIndex = -1;
-                    break;
-                  } else if (similarity < mostSimilarValue) {
-                    mostSimilarValue = similarity;
-                    mostSimilarIndex = i;
-                  }
-                }
+            if (B.Count >= candidateSizeFactor * phi.Count) { // line 11 of Algorithm 4
+              var replacement = B_fit.Select((val, idx) => new { Index = idx, Fitness = val })
+                                            .Where(x => x.Fitness >= pi_dash_fit) // cond. 1 in line 12 of Algorithm 4
+                                            .Select(x => new { Index = x.Index, Fitness = x.Fitness, Similarity = HammingSimilarityCalculator.CalculateSimilarity(B[x.Index].Assignment, pi_dash) })
+                                            .ToArray();
+              if (replacement.Length > 0) {
+                var mostSimilar = replacement.MaxItems(x => x.Similarity).First().Index;
+                B[mostSimilar].Assignment = pi_dash; // line 13 of Algorithm 4
+                B[mostSimilar].Evaluation = pi_dash_eval; // line 13 of Algorithm 4
+                B_fit[mostSimilar] = pi_dash_fit; // line 13 of Algorithm 4
               }
-              if (mostSimilarIndex >= 0)
-                B[mostSimilarIndex] = Tuple.Create(solution, quality);
-            } else {
-              bool contains = false;
-              foreach (var b in B) {
-                if (cmp.Equals(solution.Assignment, b.Item1.Assignment)) {
-                  contains = true;
-                  break;
-                }
-              }
-              if (!contains) B.Add(Tuple.Create(solution, quality));
+            } else { // line 16, condition has been checked above already
+              B.Add(new GQAPSolution(pi_dash, pi_dash_eval)); // line 17 of Algorithm 4
+              B_fit.Add(pi_dash_fit); // line 17 of Algorithm 4
             }
           }
         }
-        if (B.Any()) {
-          var pi = B.SampleProportional(random, 1, B.Select(x => 1.0 / x.Item2), false).First();
-          var diff = IntegerVectorEqualityComparer.GetDifferingIndices(pi.Item1.Assignment, target);
-          var I = phi.Except(diff);
-          var i = I.SampleRandom(random);
-          fix.Add(i);
-          nonFix.Remove(i);
-          pi_prime = pi.Item1.Assignment;
-          if (pi.Item2 < resultQuality) {
-            result = pi.Item1.Assignment;
-            resultQuality = pi.Item2;
+        if (B.Count > 0) { // line 21 of Algorithm 4
+          var pi = B.SampleProportional(random, 1, B_fit.Select(x => 1.0 / x), false).First(); // line 22 of Algorithm 4
+          var diff = IntegerVectorEqualityComparer.GetDifferingIndices(pi.Assignment, target); // line 23 of Algorithm 4
+          var I = phi.Except(diff); // line 24 of Algorithm 4
+          var i = I.SampleRandom(random); // line 25 of Algorithm 4
+          //fix[i] = true; // line 26 of Algorithm 4
+          nonFix.Remove(i); // line 26 of Algorithm 4
+          pi_prime = pi.Assignment; // line 27 of Algorithm 4
+          var fit = problemInstance.ToSingleObjective(pi.Evaluation);
+          if (fit < pi_star_Fit) { // line 28 of Algorithm 4
+            pi_star_Fit = fit; // line 29 of Algorithm 4
+            pi_star = pi; // line 30 of Algorithm 4
           }
-        } else return result;
+        } else return pi_star ?? new GQAPSolution((IntegerVector)source.Clone(), (Evaluation)sourceEval.Clone());
         phi = new HashSet<int>(IntegerVectorEqualityComparer.GetDifferingIndices(pi_prime, target));
       }
 
-      return result;
+      return pi_star ?? new GQAPSolution((IntegerVector)source.Clone(), (Evaluation)sourceEval.Clone());
     }
 
     protected override IntegerVector Cross(IRandom random, ItemArray<IntegerVector> parents,
       GQAPInstance problemInstance) {
-      return Apply(random, parents, QualityParameter.ActualValue, problemInstance,
-        CandidateSizeFactorParameter.Value.Value);
+
+      var qualities = QualityParameter.ActualValue;
+      var evaluations = EvaluationParameter.ActualValue;
+      var betterParent = qualities[0].Value <= qualities[1].Value ? 0 : 1;
+      var worseParent = 1 - betterParent;
+      var source = parents[betterParent];
+      var target = parents[worseParent];
+
+      int evaluatedSolution;
+      return Apply(random, source, evaluations[betterParent],
+        target, evaluations[worseParent], problemInstance,
+        CandidateSizeFactorParameter.Value.Value, out evaluatedSolution).Assignment;
     }
 
-    private static IntegerVector MakeFeasible(IRandom random, IntegerVector assignment, int equipment, HashSet<int> nonFix, DoubleArray demands, DoubleArray capacities, int maximumTries = 1000) {
-      int l = assignment[equipment];
-      var slack = ComputeSlack(assignment, demands, capacities);
-      if (slack[l] >= 0) return (IntegerVector)assignment.Clone();
+    private static IntegerVector MakeFeasible(IRandom random, IntegerVector pi, int equipment, List<int> nonFix, DoubleArray demands, DoubleArray capacities, int maximumTries = 1000) {
+      int l = pi[equipment];
+      var slack = ComputeSlack(pi, demands, capacities);
+      if (slack[l] >= 0) // line 1 of Algorithm 5
+        return new IntegerVector(pi); // line 2 of Algorithm 5
 
-      IntegerVector result = null;
-      int k = 0;
-      while (k < maximumTries && slack[l] < 0) {
-        result = (IntegerVector)assignment.Clone();
-        do {
-          var maxSlack = slack.Max();
-          var T = nonFix.Where(x => x != equipment && assignment[x] == l && demands[x] <= maxSlack);
-          if (T.Any()) {
-            int i = T.SampleProportional(random, 1, T.Select(x => demands[x]), false).First();
-            var j = Enumerable.Range(0, capacities.Length).Where(x => slack[x] >= demands[i]).SampleRandom(random);
-            result[i] = j;
-            slack[j] -= demands[i];
-            slack[l] += demands[i];
-          } else break;
-        } while (slack[l] < 0);
-        k++;
+      IntegerVector pi_prime = null;
+      int k = 0; // line 4 of Algorithm 5
+      while (k < maximumTries && slack[l] < 0) {  // line 5 of Algorithm 5
+        pi_prime = new IntegerVector(pi); // line 6 of Algorithm 5
+        do {  // line 7 of Algorithm 5
+          var maxSlack = slack.Max(); // line 8-9 of Algorithm 5
+          var T = nonFix.Where(x => pi[x] == l && demands[x] <= maxSlack).ToList(); // line 8-9 of Algorithm 5
+          if (T.Count > 0) { // line 10 of Algorithm 5
+            int i = T.SampleProportional(random, 1, T.Select(x => demands[x]), false).First(); // line 11 of Algorithm 5
+            var j = Enumerable.Range(0, capacities.Length)
+              .Where(x => slack[x] >= demands[i]) // line 12 of Algorithm 5
+              .SampleRandom(random);  // line 13 of Algorithm 5
+            pi_prime[i] = j; // line 14 of Algorithm 5
+            slack[j] -= demands[i]; // line 14 of Algorithm 5
+            slack[l] += demands[i]; // line 14 of Algorithm 5
+          } else break; // cond. 1 in line 16 of Algorithm 5
+        } while (slack[l] < 0); // cond. 2 in line 16 of Algorithm 5
+        k++; // line 17 of Algorithm 5
       }
-      return result;
+      return pi_prime; // line 19-23 of Algorithm 5
     }
 
-    private static DoubleArray ComputeSlack(IntegerVector assignment, DoubleArray demands, DoubleArray capacities) {
-      var slack = (DoubleArray)capacities.Clone();
+    private static double[] ComputeSlack(IntegerVector assignment, DoubleArray demands, DoubleArray capacities) {
+      var slack = new double[capacities.Length];
       for (int i = 0; i < assignment.Length; i++) {
         slack[assignment[i]] -= demands[i];
Index: branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Operators/LocalImprovers/ApproximateLocalSearch.cs
===================================================================
--- branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Operators/LocalImprovers/ApproximateLocalSearch.cs	(revision 15512)
+++ branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Operators/LocalImprovers/ApproximateLocalSearch.cs	(revision 15553)
@@ -94,21 +94,33 @@
     }
 
-    /// <summary>
-    /// The implementation differs slightly from Mateus et al. in that the maximumIterations parameter defines a cap
-    /// on the number of steps that the local search can perform. While the maxSampleSize parameter corresponds to
-    /// the maxItr parameter defined by Mateus et al.
-    /// </summary>
-    /// <param name="random">The random number generator to use.</param>
-    /// <param name="assignment">The equipment-location assignment vector.</param>
-    /// <param name="quality">The solution quality.</param>
-    /// <param name="evaluation">The evaluation result of the solution.</param>
-    /// <param name="maxCLS">The maximum number of candidates that should be found in each step.</param>
-    /// <param name="maximumIterations">The maximum number of iterations that should be performed each time the candidate list is generated.</param>
-    /// <param name="problemInstance">The problem instance that contains the data.</param>
-    /// <param name="evaluatedSolutions">The number of evaluated solutions.</param>
-    /// <param name="oneMoveProbability">The probability for performing a 1-move, which is the opposite of performing a 2-move.</param>
-    public static void Apply(IRandom random, IntegerVector assignment,
-      DoubleValue quality, ref Evaluation evaluation, IntValue maxCLS, IntValue maximumIterations,
-      GQAPInstance problemInstance, IntValue evaluatedSolutions, PercentValue oneMoveProbability) {
+    public static void Apply(IRandom random, GQAPSolution sol, int maxCLS,
+      double oneMoveProbability, int maximumIterations,
+      GQAPInstance problemInstance, out int evaluatedSolutions) {
+      var fit = problemInstance.ToSingleObjective(sol.Evaluation);
+      var eval = sol.Evaluation;
+      Apply(random, sol.Assignment, ref fit, ref eval, maxCLS, oneMoveProbability, maximumIterations, problemInstance,
+        out evaluatedSolutions);
+      sol.Evaluation = eval;
+    }
+
+      /// <summary>
+      /// The implementation differs slightly from Mateus et al. in that the maximumIterations parameter defines a cap
+      /// on the number of steps that the local search can perform. While the maxSampleSize parameter corresponds to
+      /// the maxItr parameter defined by Mateus et al.
+      /// </summary>
+      /// <param name="random">The random number generator to use.</param>
+      /// <param name="assignment">The equipment-location assignment vector.</param>
+      /// <param name="quality">The solution quality.</param>
+      /// <param name="evaluation">The evaluation result of the solution.</param>
+      /// <param name="maxCLS">The maximum number of candidates that should be found in each step.</param>
+      /// <param name="oneMoveProbability">The probability for performing a 1-move, which is the opposite of performing a 2-move.</param>
+      /// <param name="maximumIterations">The maximum number of iterations that should be performed each time the candidate list is generated.</param>
+      /// <param name="problemInstance">The problem instance that contains the data.</param>
+      /// <param name="evaluatedSolutions">The number of evaluated solutions.</param>
+      public static void Apply(IRandom random, IntegerVector assignment,
+      ref double quality, ref Evaluation evaluation, int maxCLS,
+      double oneMoveProbability, int maximumIterations,
+      GQAPInstance problemInstance, out int evaluatedSolutions) {
+      evaluatedSolutions = 0;
       var capacities = problemInstance.Capacities;
       var demands = problemInstance.Demands;
@@ -121,7 +133,7 @@
         do {
           NMove move;
-          if (random.NextDouble() < oneMoveProbability.Value)
-            move = StochasticNMoveSingleMoveGenerator.GenerateExactlyN(random, assignment, 1, capacities);
-          else move = StochasticNMoveSingleMoveGenerator.GenerateExactlyN(random, assignment, 2, capacities);
+          if (random.NextDouble() < oneMoveProbability)
+            move = StochasticNMoveSingleMoveGenerator.GenerateOneMove(random, assignment, capacities);
+          else move = StochasticNMoveSingleMoveGenerator.GenerateTwoMove(random, assignment, capacities);
           
           var moveEval = GQAPNMoveEvaluator.Evaluate(move, assignment, evaluation, problemInstance);
@@ -129,13 +141,13 @@
           double moveQuality = problemInstance.ToSingleObjective(moveEval);
 
-          if (moveEval.ExcessDemand <= 0.0 && moveQuality < quality.Value) {
+          if (moveEval.ExcessDemand <= 0.0 && moveQuality < quality) {
             CLS.Add(Tuple.Create(move, moveQuality, moveEval));
             sum += 1.0 / moveQuality;
           }
           count++;
-        } while (CLS.Count < maxCLS.Value && count < maximumIterations.Value);
+        } while (CLS.Count < maxCLS && count < maximumIterations);
 
         if (CLS.Count == 0) {
-          evaluatedSolutions.Value += (int)Math.Ceiling(evaluations);
+          evaluatedSolutions += (int)Math.Ceiling(evaluations);
           return; // END
         } else {
@@ -150,5 +162,5 @@
           }
           NMoveMaker.Apply(assignment, selected.Item1);
-          quality.Value = selected.Item2;
+          quality = selected.Item2;
           evaluation = selected.Item3;
         }
@@ -158,14 +170,21 @@
     public override IOperation Apply() {
       var evaluation = EvaluationParameter.ActualValue;
+      var quality = QualityParameter.ActualValue;
+      var fit = quality.Value;
+      var evaluatedSolutions = 0;
+
       Apply(RandomParameter.ActualValue,
         AssignmentParameter.ActualValue,
-        QualityParameter.ActualValue,
+        ref fit,
         ref evaluation,
-        MaximumCandidateListSizeParameter.ActualValue,
-        MaximumIterationsParameter.ActualValue,
+        MaximumCandidateListSizeParameter.ActualValue.Value,
+        OneMoveProbabilityParameter.ActualValue.Value,
+        MaximumIterationsParameter.ActualValue.Value,
         ProblemInstanceParameter.ActualValue,
-        EvaluatedSolutionsParameter.ActualValue,
-        OneMoveProbabilityParameter.ActualValue);
+        out evaluatedSolutions);
+
       EvaluationParameter.ActualValue = evaluation;
+      quality.Value = fit;
+      EvaluatedSolutionsParameter.ActualValue.Value += evaluatedSolutions;
       return base.Apply();
     }
Index: branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/SolutionCreators/GreedyRandomizedSolutionCreator.cs
===================================================================
--- branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/SolutionCreators/GreedyRandomizedSolutionCreator.cs	(revision 15512)
+++ branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/SolutionCreators/GreedyRandomizedSolutionCreator.cs	(revision 15553)
@@ -61,49 +61,55 @@
       int maximumTries, bool createMostFeasibleSolution, CancellationToken cancelToken) {
       var demands = problemInstance.Demands;
-      var capacities = problemInstance.Capacities;
+      var capacities = problemInstance.Capacities.ToArray();
+      var equipments = demands.Length;
+      var locations = capacities.Length;
       int tries = 0;
-      var assignment = new Dictionary<int, int>(demands.Length);
-      DoubleArray slack = new DoubleArray(capacities.Length);
+      var assignment = new int[equipments];
+      var slack = new double[locations];
       double minViolation = double.MaxValue;
-      Dictionary<int, int> bestAssignment = null;
-      HashSet<int> CF = new HashSet<int>(), // set of chosen facilities / equipments
-          T = new HashSet<int>(), // set of facilities / equpiments that can be assigned to the set of chosen locations (CL)
-          CL = new HashSet<int>(), // set of chosen locations
-          F = new HashSet<int>(Enumerable.Range(0, demands.Length)), // set of (initially) all facilities / equipments
-          L = new HashSet<int>(Enumerable.Range(0, capacities.Length)); // set of (initially) all locations
-
+      int[] bestAssignment = null;
+      var CF = new bool[equipments]; // set of chosen facilities / equipments
+      var T = new List<int>(equipments); // set of facilities / equpiments that can be assigned to the set of chosen locations (CL)
+      var CL_list = new List<int>(locations); // list of chosen locations
+      var CL_selected = new bool[locations]; // bool decision if location is chosen
+      var F = new List<int>(equipments); // set of (initially) all facilities / equipments
+      var L = new List<int>(locations); // set of (initially) all locations
+      
       while (maximumTries <= 0 || tries < maximumTries) {
         cancelToken.ThrowIfCancellationRequested();
 
-        assignment.Clear();
-        for (int i = 0; i < capacities.Length; i++) slack[i] = capacities[i];
-        CF.Clear();
+        Array.Copy(capacities, slack, locations);
+        Array.Clear(CF, 0, equipments);
+        Array.Clear(CL_selected, 0, locations);
+        CL_list.Clear();
         T.Clear();
-        CL.Clear();
-        F.Clear(); F.UnionWith(Enumerable.Range(0, demands.Length));
-        L.Clear(); L.UnionWith(Enumerable.Range(0, capacities.Length));
+
+        F.Clear(); F.AddRange(Enumerable.Range(0, equipments));
+        L.Clear(); L.AddRange(Enumerable.Range(0, locations));
 
         double threshold = 1.0;
         do {
-          if (L.Any() && random.NextDouble() < threshold) {
+          if (L.Count > 0 && random.NextDouble() < threshold) {
             int l = L.SampleRandom(random);
             L.Remove(l);
-            CL.Add(l);
-            T = new HashSet<int>(WithDemandEqualOrLess(F, GetMaximumSlack(slack, CL), demands));
+            CL_list.Add(l);
+            CL_selected[l] = true;
+            T = new List<int>(WhereDemandEqualOrLess(F, GetMaximumSlack(slack, CL_selected), demands));
           }
-          if (T.Any()) {
-            int f = T.SampleRandom(random);
-            T.Remove(f);
-            F.Remove(f);
-            CF.Add(f);
-            int l = WithSlackGreaterOrEqual(CL, demands[f], slack).SampleRandom(random);
-            assignment.Add(f, l);
+          if (T.Count > 0) {
+            var fidx = Enumerable.Range(0, T.Count).SampleRandom(random);
+            var f = T[fidx];
+            T.RemoveAt(fidx);
+            F.Remove(f); // TODO: slow
+            CF[f] = true;
+            int l = WhereSlackGreaterOrEqual(CL_list, demands[f], slack).SampleRandom(random);
+            assignment[f] = l + 1;
             slack[l] -= demands[f];
-            T = new HashSet<int>(WithDemandEqualOrLess(F, GetMaximumSlack(slack, CL), demands));
+            T = new List<int>(WhereDemandEqualOrLess(F, GetMaximumSlack(slack, CL_selected), demands));
             threshold = 1.0 - (double)T.Count / Math.Max(F.Count, 1.0);
           }
-        } while (T.Any() || L.Any());
+        } while (T.Count > 0 || L.Count > 0);
         if (maximumTries > 0) tries++;
-        if (!F.Any()) {
+        if (F.Count == 0) {
           bestAssignment = assignment;
           break;
@@ -111,18 +117,19 @@
           // complete the solution and remember the one with least violation
           foreach (var l in L.ToArray()) {
-            CL.Add(l);
+            CL_list.Add(l);
+            CL_selected[l] = true;
             L.Remove(l);
           }
-          while (F.Any()) {
-            var f = F.MaxItems(x => demands[x]).SampleRandom(random);
-            var l = CL.MaxItems(x => slack[x]).SampleRandom(random);
-            F.Remove(f);
-            assignment.Add(f, l);
-            slack[l] -= demands[f];
+          while (F.Count > 0) {
+            var f = F.Select((v, i) => new { Index = i, Value = v }).MaxItems(x => demands[x.Value]).SampleRandom(random);
+            var l = CL_list.MaxItems(x => slack[x]).SampleRandom(random);
+            F.RemoveAt(f.Index);
+            assignment[f.Value] = l + 1;
+            slack[l] -= demands[f.Value];
           }
           double violation = slack.Select(x => x < 0 ? -x : 0).Sum();
           if (violation < minViolation) {
             bestAssignment = assignment;
-            assignment = new Dictionary<int, int>(demands.Length);
+            assignment = new int[equipments];
             minViolation = violation;
           }
@@ -130,7 +137,8 @@
       }
 
-      if (bestAssignment == null || bestAssignment.Count != demands.Length) throw new InvalidOperationException(String.Format("No solution could be found in {0} tries.", maximumTries));
+      if (bestAssignment == null || bestAssignment.Any(x => x == 0))
+        throw new InvalidOperationException(String.Format("No solution could be found in {0} tries.", maximumTries));
 
-      return new IntegerVector(bestAssignment.OrderBy(x => x.Key).Select(x => x.Value).ToArray());
+      return new IntegerVector(bestAssignment.Select(x => x - 1).ToArray());
     }
 
@@ -142,5 +150,5 @@
     }
 
-    private static IEnumerable<int> WithDemandEqualOrLess(IEnumerable<int> facilities, double maximum, DoubleArray demands) {
+    private static IEnumerable<int> WhereDemandEqualOrLess(IEnumerable<int> facilities, double maximum, DoubleArray demands) {
       foreach (int f in facilities) {
         if (demands[f] <= maximum) yield return f;
@@ -148,9 +156,13 @@
     }
 
-    private static double GetMaximumSlack(DoubleArray slack, HashSet<int> CL) {
-      return slack.Select((val, idx) => new { idx, val }).Where(x => CL.Contains(x.idx)).Select(x => x.val).Max();
+    private static double GetMaximumSlack(double[] slack, bool[] CL) {
+      var max = double.MinValue;
+      for (var i = 0; i < slack.Length; i++) {
+        if (CL[i] && max < slack[i]) max = slack[i];
+      }
+      return max;
     }
 
-    private static IEnumerable<int> WithSlackGreaterOrEqual(HashSet<int> locations, double minimum, DoubleArray slack) {
+    private static IEnumerable<int> WhereSlackGreaterOrEqual(IEnumerable<int> locations, double minimum, double[] slack) {
       foreach (int l in locations) {
         if (slack[l] >= minimum) yield return l;
