Index: /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/Crossovers/PotvinCrossover.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/Crossovers/PotvinCrossover.cs	(revision 6458)
+++ /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/Crossovers/PotvinCrossover.cs	(revision 6459)
@@ -36,4 +36,18 @@
     }
 
+    public IValueParameter<BoolValue> AllowInfeasibleSolutions {
+      get { return (IValueParameter<BoolValue>)Parameters["AllowInfeasibleSolutions"]; }
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      // BackwardsCompatibility3.3
+      #region Backwards compatible code (remove with 3.4)
+      if (!Parameters.ContainsKey("AllowInfeasibleSolutions")) {
+        Parameters.Add(new ValueParameter<BoolValue>("AllowInfeasibleSolutions", "Indicates if infeasible solutions should be allowed.", new BoolValue(false)));
+      }
+      #endregion
+    }
+
     [StorableConstructor]
     protected PotvinCrossover(bool deserializing) : base(deserializing) { }
@@ -44,4 +58,5 @@
     public PotvinCrossover() {
       Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator which should be used for stochastic manipulation operators."));
+      Parameters.Add(new ValueParameter<BoolValue>("AllowInfeasibleSolutions", "Indicates if infeasible solutions should be allowed.", new BoolValue(false)));
     }
 
@@ -50,10 +65,11 @@
     protected static bool FindInsertionPlace(PotvinEncoding individual, int city, 
       DoubleArray dueTime, DoubleArray serviceTime, DoubleArray readyTime, DoubleArray demand,
-      DoubleValue capacity, DistanceMatrix distMatrix, 
+      DoubleValue capacity, DistanceMatrix distMatrix, bool allowInfeasible,
       out int route, out int place) {
       return individual.FindInsertionPlace(
         dueTime, serviceTime, readyTime,
         demand, capacity, distMatrix,
-        city, -1, out route, out place);
+        city, -1, allowInfeasible,
+        out route, out place);
     }
 
@@ -72,5 +88,5 @@
 
     protected static bool RouteUnrouted(PotvinEncoding solution, DistanceMatrix distMatrix,
-      DoubleArray dueTime, DoubleArray readyTime, DoubleArray serviceTime, DoubleArray demand, DoubleValue capacity) {
+      DoubleArray dueTime, DoubleArray readyTime, DoubleArray serviceTime, DoubleArray demand, DoubleValue capacity, bool allowInfeasible) {
       bool success = true;
       int index = 0;
@@ -81,5 +97,5 @@
         if (FindInsertionPlace(solution, unrouted,
           dueTime, serviceTime, readyTime, demand, capacity,
-          distMatrix,
+          distMatrix, allowInfeasible,
           out route, out place)) {
           solution.Tours[route].Cities.Insert(place, unrouted);
@@ -98,5 +114,6 @@
 
     protected static bool Repair(IRandom random, PotvinEncoding solution, Tour newTour, DistanceMatrix distmatrix,
-      DoubleArray dueTime, DoubleArray readyTime, DoubleArray serviceTime, DoubleArray demand, DoubleValue capacity) {
+      DoubleArray dueTime, DoubleArray readyTime, DoubleArray serviceTime, DoubleArray demand, DoubleValue capacity, 
+      bool allowInfeasible) {
       bool success = true;
 
@@ -134,10 +151,10 @@
       }
 
-      if (!newTour.Feasible(
+      if (!allowInfeasible && !newTour.Feasible(
         dueTime, serviceTime, readyTime, demand, capacity, distmatrix))
         return false;
 
       //route unrouted vehicles
-      success = RouteUnrouted(solution, distmatrix, dueTime, readyTime, serviceTime, demand, capacity);
+      success = RouteUnrouted(solution, distmatrix, dueTime, readyTime, serviceTime, demand, capacity, allowInfeasible);
 
       return success;
Index: /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/Crossovers/PotvinInsertionBasedCrossover.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/Crossovers/PotvinInsertionBasedCrossover.cs	(revision 6458)
+++ /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/Crossovers/PotvinInsertionBasedCrossover.cs	(revision 6459)
@@ -157,6 +157,5 @@
       DoubleArray dueTimeArray,
       DoubleArray serviceTimeArray, DoubleArray readyTimeArray, DoubleArray demandArray, DoubleValue capacity,
-      DistanceMatrix distMatrix,
-      int city, out int place) {
+      DistanceMatrix distMatrix, int city, bool allowInfeasible, out int place) {
       place = -1;
       bool bestFeasible = false;
@@ -171,9 +170,10 @@
           capacity, distMatrix);
 
-        if (!bestFeasible || feasible) {
+        if ((!allowInfeasible && feasible) || (allowInfeasible && (!bestFeasible || feasible))) {
           double newLength = tour.GetLength(distMatrix);
           double detour = newLength - length;
 
-          if (place <= 0 || (!(bestFeasible && !feasible)) && detour < minDetour || (feasible && !bestFeasible)) {
+          if (place <= 0 || detour < minDetour ||
+                (allowInfeasible && ((!(bestFeasible && !feasible)) && detour < minDetour || (feasible && !bestFeasible)))) {
             place = i;
             minDetour = detour;
@@ -203,4 +203,6 @@
       DoubleValue capacity = CapacityParameter.ActualValue;
 
+      bool allowInfeasible = AllowInfeasibleSolutions.Value.Value;
+
       List<Tour> R1 = new List<Tour>();
       PotvinEncoding p1Clone = parent1.Clone() as PotvinEncoding;
@@ -247,9 +249,9 @@
 
           int place = -1;
-          if(FindRouteInsertionPlace(childTour, dueTime, serviceTime, readyTime, 
-            demand, capacity, distMatrix, city, out place)) {
+          if(FindRouteInsertionPlace(childTour, dueTime, serviceTime, readyTime,
+            demand, capacity, distMatrix, city, allowInfeasible, out place)) {
             childTour.Cities.Insert(place, city);
 
-            if (!Repair(random, child, childTour, distMatrix, dueTime, readyTime, serviceTime, demand, capacity)) {
+            if (!Repair(random, child, childTour, distMatrix, dueTime, readyTime, serviceTime, demand, capacity, allowInfeasible)) {
               childTour.Cities.RemoveAt(place);
               insertSuccess = false;
@@ -261,5 +263,5 @@
 
         child.Tours.Add(childTour);
-        if (!Repair(random, child, childTour, distMatrix, dueTime, readyTime, serviceTime, demand, capacity)) {
+        if (!Repair(random, child, childTour, distMatrix, dueTime, readyTime, serviceTime, demand, capacity, allowInfeasible)) {
           /*success = false;
           break;*/
@@ -271,5 +273,5 @@
           Tour childTour = p1Clone.Tours[i].Clone() as Tour;
           child.Tours.Add(childTour);
-          if (!Repair(random, child, childTour, distMatrix, dueTime, readyTime, serviceTime, demand, capacity)) {
+          if (!Repair(random, child, childTour, distMatrix, dueTime, readyTime, serviceTime, demand, capacity, allowInfeasible)) {
             /*success = false;
             break;*/
@@ -285,10 +287,10 @@
         }
 
-        if (!RouteUnrouted(child, distMatrix, dueTime, readyTime, serviceTime, demand, capacity)) {
+        if (!RouteUnrouted(child, distMatrix, dueTime, readyTime, serviceTime, demand, capacity, allowInfeasible)) {
           success = false;
         }
       }
 
-      if (success)
+      if (success || allowInfeasible)
         return child;
       else {
Index: /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/Crossovers/PotvinRouteBasedCrossover.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/Crossovers/PotvinRouteBasedCrossover.cs	(revision 6458)
+++ /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/Crossovers/PotvinRouteBasedCrossover.cs	(revision 6459)
@@ -50,4 +50,6 @@
       DoubleValue capacity = CapacityParameter.ActualValue;
 
+      bool allowInfeasible = AllowInfeasibleSolutions.Value.Value;
+
       PotvinEncoding child = parent2.Clone() as PotvinEncoding;
 
@@ -65,5 +67,5 @@
           child.Unrouted.Add(city);
 
-      if (Repair(random, child, replacing, distMatrix, dueTime, readyTime, serviceTime, demand, capacity))
+      if (Repair(random, child, replacing, distMatrix, dueTime, readyTime, serviceTime, demand, capacity, allowInfeasible) || allowInfeasible)
         return child;
       else {
Index: /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/Crossovers/PotvinSequenceBasedCrossover.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/Crossovers/PotvinSequenceBasedCrossover.cs	(revision 6458)
+++ /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/Crossovers/PotvinSequenceBasedCrossover.cs	(revision 6459)
@@ -51,4 +51,6 @@
       DoubleValue capacity = CapacityParameter.ActualValue;
 
+      bool allowInfeasible = AllowInfeasibleSolutions.Value.Value;
+
       PotvinEncoding child = parent1.Clone() as PotvinEncoding;
       Tour newTour = new Tour();
@@ -79,5 +81,5 @@
           child.Unrouted.Add(city);
 
-      if (Repair(random, child, newTour, distMatrix, dueTime, readyTime, serviceTime, demand, capacity)) {
+      if (Repair(random, child, newTour, distMatrix, dueTime, readyTime, serviceTime, demand, capacity, allowInfeasible) || allowInfeasible) {
         return child;
       } else {
Index: /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/Manipulators/PotvinManipulator.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/Manipulators/PotvinManipulator.cs	(revision 6458)
+++ /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/Manipulators/PotvinManipulator.cs	(revision 6459)
@@ -35,4 +35,18 @@
     }
 
+    public IValueParameter<BoolValue> AllowInfeasibleSolutions {
+      get { return (IValueParameter<BoolValue>)Parameters["AllowInfeasibleSolutions"]; }
+    }
+
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      // BackwardsCompatibility3.3
+      #region Backwards compatible code (remove with 3.4)
+      if (!Parameters.ContainsKey("AllowInfeasibleSolutions")) {
+        Parameters.Add(new ValueParameter<BoolValue>("AllowInfeasibleSolutions", "Indicates if infeasible solutions should be allowed.", new BoolValue(false)));
+      }
+      #endregion
+    }
+
     [StorableConstructor]
     protected PotvinManipulator(bool deserializing) : base(deserializing) { }
@@ -42,4 +56,5 @@
     public PotvinManipulator() {
       Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator which should be used for stochastic manipulation operators."));
+      Parameters.Add(new ValueParameter<BoolValue>("AllowInfeasibleSolutions", "Indicates if infeasible solutions should be allowed.", new BoolValue(false)));
     }
 
@@ -75,10 +90,11 @@
     protected static bool FindInsertionPlace(PotvinEncoding individual, int city, int routeToAvoid,
       DoubleArray dueTime, DoubleArray serviceTime, DoubleArray readyTime, DoubleArray demand,
-      DoubleValue capacity, DistanceMatrix distMatrix,
+      DoubleValue capacity, DistanceMatrix distMatrix,  bool allowInfeasible,
       out int route, out int place) {
       return individual.FindInsertionPlace(
         dueTime, serviceTime, readyTime,
         demand, capacity, distMatrix,
-        city, routeToAvoid, out route, out place);
+        city, routeToAvoid, allowInfeasible, 
+        out route, out place);
     }
       
Index: /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/Manipulators/PotvinOneLevelExchangeManipulator.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/Manipulators/PotvinOneLevelExchangeManipulator.cs	(revision 6458)
+++ /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/Manipulators/PotvinOneLevelExchangeManipulator.cs	(revision 6459)
@@ -42,5 +42,5 @@
     public static void Apply(IRandom random, PotvinEncoding individual, 
      DoubleArray dueTime, DoubleArray readyTime, DoubleArray serviceTime, DoubleArray demand,
-      DoubleValue capacity, DistanceMatrix distMatrix) {
+      DoubleValue capacity, DistanceMatrix distMatrix, bool allowInfeasible) {
       int selectedIndex = SelectRandomTourBiasedByLength(random, individual);
       Tour route1 =
@@ -53,5 +53,5 @@
         if (FindInsertionPlace(individual, route1.Cities[i], selectedIndex,
           dueTime, serviceTime, readyTime, demand, capacity,
-          distMatrix,
+          distMatrix, allowInfeasible,
           out insertedRoute, out insertedPlace)) {
           individual.Tours[insertedRoute].Cities.Insert(insertedPlace, route1.Cities[i]);
@@ -82,5 +82,7 @@
       DoubleValue capacity = CapacityParameter.ActualValue;
 
-      Apply(random, individual, dueTime, readyTime, serviceTime, demand, capacity, distMatrix); 
+      bool allowInfeasible = AllowInfeasibleSolutions.Value.Value;
+
+      Apply(random, individual, dueTime, readyTime, serviceTime, demand, capacity, distMatrix, allowInfeasible); 
     }
   }
Index: /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/Manipulators/PotvinTwoLevelExchangeManipulator.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/Manipulators/PotvinTwoLevelExchangeManipulator.cs	(revision 6458)
+++ /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/Manipulators/PotvinTwoLevelExchangeManipulator.cs	(revision 6459)
@@ -39,5 +39,5 @@
     public static void Apply(IRandom random, PotvinEncoding individual, 
       DoubleArray dueTime, DoubleArray readyTime, DoubleArray serviceTime, DoubleArray demand,
-      DoubleValue capacity, DistanceMatrix distMatrix) {
+      DoubleValue capacity, DistanceMatrix distMatrix, bool allowInfeasible) {
       int selectedIndex = SelectRandomTourBiasedByLength(random, individual);
       Tour route1 = individual.Tours[selectedIndex];
@@ -61,5 +61,5 @@
                   customer2, selectedIndex,
                   dueTime, serviceTime, readyTime, demand, capacity,
-                  distMatrix,
+                  distMatrix, allowInfeasible,
                   out routeIdx, out place)) {
                   individual.Tours[routeIdx].Cities.Insert(place, customer2);
@@ -100,5 +100,7 @@
       DoubleValue capacity = CapacityParameter.ActualValue;
 
-      Apply(random, individual, dueTime, readyTime, serviceTime, demand, capacity, distMatrix);
+      bool allowInfeasible = AllowInfeasibleSolutions.Value.Value;
+
+      Apply(random, individual, dueTime, readyTime, serviceTime, demand, capacity, distMatrix, allowInfeasible);
     }
   }
Index: /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/PotvinEncoding.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/PotvinEncoding.cs	(revision 6458)
+++ /trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/PotvinEncoding.cs	(revision 6459)
@@ -69,8 +69,10 @@
       DoubleArray dueTimeArray,
       DoubleArray serviceTimeArray, DoubleArray readyTimeArray, DoubleArray demandArray, DoubleValue capacity,
-      DistanceMatrix distMatrix, 
-      int city, int routeToAvoid, out int route, out int place) {
+      DistanceMatrix distMatrix,
+      int city, int routeToAvoid, bool allowInfeasible,
+      out int route, out int place) {
       route = -1;
       place = -1;
+      bool bestFeasible = false;
       double minDetour = 0;
 
@@ -85,12 +87,16 @@
               capacity, distMatrix);
 
-            if (feasible) {
+            if ((!allowInfeasible && feasible) || (allowInfeasible && (!bestFeasible || feasible))) {
               double newLength = Tours[tour].GetLength(distMatrix);
               double detour = newLength - length;
 
-              if (route <= 0 || detour < minDetour) {
+              if (route <= 0 || detour < minDetour ||
+                (allowInfeasible && ((!(bestFeasible && !feasible)) && detour < minDetour || (feasible && !bestFeasible)))) {
                 route = tour;
                 place = i;
                 minDetour = detour;
+
+                if (feasible)
+                  bestFeasible = true;
               }
             }
