Index: branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestSolution/BestVRPSolutionAnalyzer.cs
===================================================================
--- branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestSolution/BestVRPSolutionAnalyzer.cs	(revision 7203)
+++ branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestSolution/BestVRPSolutionAnalyzer.cs	(revision 7854)
@@ -30,4 +30,5 @@
 using HeuristicLab.Problems.VehicleRouting.Variants;
 using HeuristicLab.Common;
+using HeuristicLab.Problems.VehicleRouting.ProblemInstances;
 
 namespace HeuristicLab.Problems.VehicleRouting {
@@ -126,7 +127,4 @@
 
       int i = qualities.Select((x, index) => new { index, x.Value }).OrderBy(x => x.Value).First().index;
-
-      DoubleValue bestKnownQuality = BestKnownQualityParameter.ActualValue;
-
       IVRPEncoding best = solutions[i].Clone() as IVRPEncoding;
       VRPSolution solution = BestSolutionParameter.ActualValue;
@@ -139,5 +137,6 @@
         results.Add(new Result("Best VRP Solution VehicleUtilization", new DoubleValue(vehiclesUtilizations[i].Value)));
       } else {
-        if (qualities[i].Value <= solution.Quality.Value) {
+        VRPEvaluation eval = problemInstance.Evaluate(solution.Solution);
+        if (qualities[i].Value <= eval.Quality) {
           solution.ProblemInstance = problemInstance;
           solution.Solution = best.Clone() as IVRPEncoding;
@@ -148,33 +147,38 @@
       }
 
-      VRPSolution validSolution = BestValidSolutionParameter.ActualValue;
-      if (validSolution == null) {
-        if (ProblemInstanceParameter.ActualValue.Feasible(best)) {
-          validSolution = new VRPSolution(problemInstance, best.Clone() as IVRPEncoding, new DoubleValue(qualities[i].Value));
-          BestValidSolutionParameter.ActualValue = validSolution;
-          if (results.ContainsKey("Best valid VRP Solution"))
-            results["Best valid VRP Solution"].Value = validSolution;
-          else
-            results.Add(new Result("Best valid VRP Solution", validSolution));
+      var idx = qualities.Select((x, index) => new { index, x.Value }).Where(index => problemInstance.Feasible(solutions[index.index])).OrderBy(x => x.Value).FirstOrDefault();
+      if (idx != null) {
+        int j = idx.index;
+        IVRPEncoding bestFeasible = solutions[j].Clone() as IVRPEncoding;
+        VRPSolution validSolution = BestValidSolutionParameter.ActualValue;
+        if (validSolution == null) {
+          if (ProblemInstanceParameter.ActualValue.Feasible(best)) {
+            validSolution = new VRPSolution(problemInstance, best.Clone() as IVRPEncoding, new DoubleValue(qualities[j].Value));
+            BestValidSolutionParameter.ActualValue = validSolution;
+            if (results.ContainsKey("Best valid VRP Solution"))
+              results["Best valid VRP Solution"].Value = validSolution;
+            else
+              results.Add(new Result("Best valid VRP Solution", validSolution));
 
-          results.Add(new Result("Best valid VRP Solution Distance", new DoubleValue(distances[i].Value)));
-          results.Add(new Result("Best valid VRP Solution VehicleUtilization", new DoubleValue(vehiclesUtilizations[i].Value)));
-        }
-      } else {
-        if (qualities[i].Value <= validSolution.Quality.Value) {
-          if (ProblemInstanceParameter.ActualValue.Feasible(best)) {
-            validSolution.ProblemInstance = problemInstance;
-            validSolution.Solution = best.Clone() as IVRPEncoding;
-            validSolution.Quality.Value = qualities[i].Value;
-            (results["Best valid VRP Solution Distance"].Value as DoubleValue).Value = distances[i].Value;
-            (results["Best valid VRP Solution VehicleUtilization"].Value as DoubleValue).Value = vehiclesUtilizations[i].Value;
+            results.Add(new Result("Best valid VRP Solution Distance", new DoubleValue(distances[j].Value)));
+            results.Add(new Result("Best valid VRP Solution VehicleUtilization", new DoubleValue(vehiclesUtilizations[j].Value)));
+          }
+        } else {
+          if (qualities[j].Value <= validSolution.Quality.Value) {
+            if (ProblemInstanceParameter.ActualValue.Feasible(best)) {
+              validSolution.ProblemInstance = problemInstance;
+              validSolution.Solution = best.Clone() as IVRPEncoding;
+              validSolution.Quality.Value = qualities[j].Value;
+              (results["Best valid VRP Solution Distance"].Value as DoubleValue).Value = distances[j].Value;
+              (results["Best valid VRP Solution VehicleUtilization"].Value as DoubleValue).Value = vehiclesUtilizations[j].Value;
+            }
           }
         }
-      }
 
-      if (bestKnownQuality == null ||
-          qualities[i].Value < bestKnownQuality.Value) {
-        BestKnownQualityParameter.ActualValue = new DoubleValue(qualities[i].Value);
-        BestKnownSolutionParameter.ActualValue = (VRPSolution)solution.Clone();
+        DoubleValue bestKnownQuality = BestKnownQualityParameter.ActualValue;
+        if (bestKnownQuality == null || qualities[j].Value < bestKnownQuality.Value) {
+          BestKnownQualityParameter.ActualValue = new DoubleValue(qualities[j].Value);
+          BestKnownSolutionParameter.ActualValue = (VRPSolution)validSolution.Clone();
+        }
       }
 
