Index: /branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4/CVRPPDTWView.cs
===================================================================
--- /branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4/CVRPPDTWView.cs	(revision 7857)
+++ /branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4/CVRPPDTWView.cs	(revision 7858)
@@ -42,11 +42,4 @@
       IntArray pickupDeliveryLocation = Content.PickupDeliveryLocation;
 
-      Pen[] pens = {new Pen(Color.FromArgb(92,20,237)), new Pen(Color.FromArgb(237,183,20)), new Pen(Color.FromArgb(237,20,219)), new Pen(Color.FromArgb(20,237,76)),
-                    new Pen(Color.FromArgb(237,61,20)), new Pen(Color.FromArgb(115,78,26)), new Pen(Color.FromArgb(20,237,229)), new Pen(Color.FromArgb(39,101,19)),
-                    new Pen(Color.FromArgb(230,170,229)), new Pen(Color.FromArgb(142,136,89)), new Pen(Color.FromArgb(157,217,166)), new Pen(Color.FromArgb(31,19,101)),
-                    new Pen(Color.FromArgb(173,237,20)), new Pen(Color.FromArgb(230,231,161)), new Pen(Color.FromArgb(142,89,89)), new Pen(Color.FromArgb(93,89,142)),
-                    new Pen(Color.FromArgb(146,203,217)), new Pen(Color.FromArgb(101,19,75)), new Pen(Color.FromArgb(198,20,237)), new Pen(Color.FromArgb(185,185,185)),
-                    new Pen(Color.FromArgb(179,32,32)), new Pen(Color.FromArgb(18,119,115)), new Pen(Color.FromArgb(104,158,239)), new Pen(Color.Black)};
-
       Pen flowPen = new Pen(Brushes.Red, 3);
       flowPen.EndCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor;
@@ -69,5 +62,9 @@
           if (Solution != null) {
             int currentTour = 0;
-            foreach (Tour tour in Solution.GetTours()) {
+
+            List<Tour> tours = Solution.GetTours();
+            List<Pen> pens = GetColors(tours.Count);
+
+            foreach (Tour tour in tours) {
               double t = 0.0;
               Point[] tourPoints = new Point[tour.Stops.Count + 2];
@@ -122,5 +119,5 @@
 
               if (!drawFlow)
-                graphics.DrawPolygon(pens[((currentTour >= pens.Length) ? (pens.Length - 1) : (currentTour))], tourPoints);
+                graphics.DrawPolygon(pens[currentTour], tourPoints);
 
               for (int i = 0; i < tour.Stops.Count; i++) {
@@ -142,4 +139,7 @@
               currentTour++;
             }
+
+            for (int i = 0; i < pens.Count; i++)
+              pens[i].Dispose();
           } else {
             {
@@ -170,7 +170,4 @@
       }
 
-      for (int i = 0; i < pens.Length; i++)
-        pens[i].Dispose();
-
       flowPen.Dispose();
     }
Index: /branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4/CVRPTWView.cs
===================================================================
--- /branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4/CVRPTWView.cs	(revision 7857)
+++ /branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4/CVRPTWView.cs	(revision 7858)
@@ -31,11 +31,4 @@
       DoubleArray readyTime = Content.ReadyTime;
 
-      Pen[] pens = {new Pen(Color.FromArgb(92,20,237)), new Pen(Color.FromArgb(237,183,20)), new Pen(Color.FromArgb(237,20,219)), new Pen(Color.FromArgb(20,237,76)),
-                    new Pen(Color.FromArgb(237,61,20)), new Pen(Color.FromArgb(115,78,26)), new Pen(Color.FromArgb(20,237,229)), new Pen(Color.FromArgb(39,101,19)),
-                    new Pen(Color.FromArgb(230,170,229)), new Pen(Color.FromArgb(142,136,89)), new Pen(Color.FromArgb(157,217,166)), new Pen(Color.FromArgb(31,19,101)),
-                    new Pen(Color.FromArgb(173,237,20)), new Pen(Color.FromArgb(230,231,161)), new Pen(Color.FromArgb(142,89,89)), new Pen(Color.FromArgb(93,89,142)),
-                    new Pen(Color.FromArgb(146,203,217)), new Pen(Color.FromArgb(101,19,75)), new Pen(Color.FromArgb(198,20,237)), new Pen(Color.FromArgb(185,185,185)),
-                    new Pen(Color.FromArgb(179,32,32)), new Pen(Color.FromArgb(18,119,115)), new Pen(Color.FromArgb(104,158,239)), new Pen(Color.Black)};
-
       if ((coordinates != null) && (coordinates.Rows > 0) && (coordinates.Columns == 2)) {
         double xMin = double.MaxValue, yMin = double.MaxValue, xMax = double.MinValue, yMax = double.MinValue;
@@ -54,5 +47,9 @@
           if (Solution != null) {
             int currentTour = 0;
-            foreach (Tour tour in Solution.GetTours()) {
+
+            List<Tour> tours = Solution.GetTours();
+            List<Pen> pens = GetColors(tours.Count);
+
+            foreach (Tour tour in tours) {
               double t = 0.0;
               Point[] tourPoints = new Point[tour.Stops.Count + 2];
@@ -91,5 +88,5 @@
               }
 
-              graphics.DrawPolygon(pens[((currentTour >= pens.Length) ? (pens.Length - 1) : (currentTour))], tourPoints);
+              graphics.DrawPolygon(pens[currentTour], tourPoints);
 
               for (int i = 0; i < tour.Stops.Count; i++) {
@@ -101,4 +98,7 @@
               currentTour++;
             }
+
+            for (int i = 0; i < pens.Count; i++)
+              pens[i].Dispose();
           } else {
             Point locationPoint;
@@ -117,7 +117,4 @@
         }
       }
-
-      for (int i = 0; i < pens.Length; i++)
-        pens[i].Dispose();
     }
   }
Index: /branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4/MDCVRPPDTWView.cs
===================================================================
--- /branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4/MDCVRPPDTWView.cs	(revision 7857)
+++ /branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4/MDCVRPPDTWView.cs	(revision 7858)
@@ -46,11 +46,4 @@
       int cities = Content.Cities.Value;
 
-      Pen[] pens = {new Pen(Color.FromArgb(92,20,237)), new Pen(Color.FromArgb(237,183,20)), new Pen(Color.FromArgb(237,20,219)), new Pen(Color.FromArgb(20,237,76)),
-                    new Pen(Color.FromArgb(237,61,20)), new Pen(Color.FromArgb(115,78,26)), new Pen(Color.FromArgb(20,237,229)), new Pen(Color.FromArgb(39,101,19)),
-                    new Pen(Color.FromArgb(230,170,229)), new Pen(Color.FromArgb(142,136,89)), new Pen(Color.FromArgb(157,217,166)), new Pen(Color.FromArgb(31,19,101)),
-                    new Pen(Color.FromArgb(173,237,20)), new Pen(Color.FromArgb(230,231,161)), new Pen(Color.FromArgb(142,89,89)), new Pen(Color.FromArgb(93,89,142)),
-                    new Pen(Color.FromArgb(146,203,217)), new Pen(Color.FromArgb(101,19,75)), new Pen(Color.FromArgb(198,20,237)), new Pen(Color.FromArgb(185,185,185)),
-                    new Pen(Color.FromArgb(179,32,32)), new Pen(Color.FromArgb(18,119,115)), new Pen(Color.FromArgb(104,158,239)), new Pen(Color.Black)};
-
       Pen flowPen = new Pen(Brushes.Red, 3);
       flowPen.EndCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor;
@@ -79,5 +72,9 @@
 
             int currentTour = 0;
-            foreach (Tour tour in Solution.GetTours()) {
+
+            List<Tour> tours = Solution.GetTours();
+            List<Pen> pens = GetColors(tours.Count);
+
+            foreach (Tour tour in tours) {
               int tourIndex = Solution.GetTourIndex(tour);
               int vehicle = Solution.GetVehicleAssignment(tourIndex);
@@ -148,5 +145,5 @@
 
               if (!drawFlow)
-                graphics.DrawPolygon(pens[((currentTour >= pens.Length) ? (pens.Length - 1) : (currentTour))], tourPoints);
+                graphics.DrawPolygon(pens[currentTour], tourPoints);
 
               for (int i = 0; i < tour.Stops.Count; i++) {
@@ -168,4 +165,7 @@
               currentTour++;
             }
+
+            for (int i = 0; i < pens.Count; i++)
+              pens[i].Dispose();
           } else {
             {
@@ -197,7 +197,4 @@
       }
 
-      for (int i = 0; i < pens.Length; i++)
-        pens[i].Dispose();
-
       flowPen.Dispose();
     }
Index: /branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4/MDCVRPTWView.cs
===================================================================
--- /branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4/MDCVRPTWView.cs	(revision 7857)
+++ /branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4/MDCVRPTWView.cs	(revision 7858)
@@ -34,11 +34,4 @@
       int depots = Content.Depots.Value;
 
-      Pen[] pens = {new Pen(Color.FromArgb(92,20,237)), new Pen(Color.FromArgb(237,183,20)), new Pen(Color.FromArgb(237,20,219)), new Pen(Color.FromArgb(20,237,76)),
-                    new Pen(Color.FromArgb(237,61,20)), new Pen(Color.FromArgb(115,78,26)), new Pen(Color.FromArgb(20,237,229)), new Pen(Color.FromArgb(39,101,19)),
-                    new Pen(Color.FromArgb(230,170,229)), new Pen(Color.FromArgb(142,136,89)), new Pen(Color.FromArgb(157,217,166)), new Pen(Color.FromArgb(31,19,101)),
-                    new Pen(Color.FromArgb(173,237,20)), new Pen(Color.FromArgb(230,231,161)), new Pen(Color.FromArgb(142,89,89)), new Pen(Color.FromArgb(93,89,142)),
-                    new Pen(Color.FromArgb(146,203,217)), new Pen(Color.FromArgb(101,19,75)), new Pen(Color.FromArgb(198,20,237)), new Pen(Color.FromArgb(185,185,185)),
-                    new Pen(Color.FromArgb(179,32,32)), new Pen(Color.FromArgb(18,119,115)), new Pen(Color.FromArgb(104,158,239)), new Pen(Color.Black)};
-
       if ((coordinates != null) && (coordinates.Rows > 0) && (coordinates.Columns == 2)) {
         double xMin = double.MaxValue, yMin = double.MaxValue, xMax = double.MinValue, yMax = double.MinValue;
@@ -63,5 +56,9 @@
 
             int currentTour = 0;
-            foreach (Tour tour in Solution.GetTours()) {
+
+            List<Tour> tours = Solution.GetTours();
+            List<Pen> pens = GetColors(tours.Count);
+
+            foreach (Tour tour in tours) {
               int tourIndex = Solution.GetTourIndex(tour);
               int vehicle = Solution.GetVehicleAssignment(tourIndex);
@@ -116,5 +113,5 @@
               }
 
-              graphics.DrawPolygon(pens[((currentTour >= pens.Length) ? (pens.Length - 1) : (currentTour))], tourPoints);
+              graphics.DrawPolygon(pens[currentTour], tourPoints);
 
               for (int i = 0; i < tour.Stops.Count; i++) {
@@ -126,4 +123,7 @@
               currentTour++;
             }
+
+            for (int i = 0; i < pens.Count; i++)
+              pens[i].Dispose();
           } else {
             Point locationPoint;
@@ -144,7 +144,4 @@
         }
       }
-
-      for (int i = 0; i < pens.Length; i++)
-        pens[i].Dispose();
     }
   }
Index: /branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4/MultiDepotVRPView.cs
===================================================================
--- /branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4/MultiDepotVRPView.cs	(revision 7857)
+++ /branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4/MultiDepotVRPView.cs	(revision 7858)
@@ -28,12 +28,4 @@
       BoolValue useDistanceMatrix = Content.UseDistanceMatrix;
 
-      Pen[] pens = {new Pen(Color.FromArgb(92,20,237)), new Pen(Color.FromArgb(237,183,20)), new Pen(Color.FromArgb(237,20,219)), new Pen(Color.FromArgb(20,237,76)),
-                    new Pen(Color.FromArgb(237,61,20)), new Pen(Color.FromArgb(115,78,26)), new Pen(Color.FromArgb(20,237,229)), new Pen(Color.FromArgb(39,101,19)),
-                    new Pen(Color.FromArgb(230,170,229)), new Pen(Color.FromArgb(142,136,89)), new Pen(Color.FromArgb(157,217,166)), new Pen(Color.FromArgb(31,19,101)),
-                    new Pen(Color.FromArgb(173,237,20)), new Pen(Color.FromArgb(230,231,161)), new Pen(Color.FromArgb(142,89,89)), new Pen(Color.FromArgb(93,89,142)),
-                    new Pen(Color.FromArgb(146,203,217)), new Pen(Color.FromArgb(101,19,75)), new Pen(Color.FromArgb(198,20,237)), new Pen(Color.FromArgb(185,185,185)),
-                    new Pen(Color.FromArgb(179,32,32)), new Pen(Color.FromArgb(18,119,115)), new Pen(Color.FromArgb(104,158,239)), new Pen(Color.Black)};
-
-
       if ((coordinates != null) && (coordinates.Rows > 0) && (coordinates.Columns == 2)) {
         double xMin = double.MaxValue, yMin = double.MaxValue, xMax = double.MinValue, yMax = double.MinValue;
@@ -58,5 +50,9 @@
 
             int currentTour = 0;
-            foreach (Tour tour in Solution.GetTours()) {
+
+            List<Tour> tours = Solution.GetTours();
+            List<Pen> pens = GetColors(tours.Count);
+
+            foreach (Tour tour in tours) {
               Point[] tourPoints = new Point[tour.Stops.Count + 2];
               Brush[] customerBrushes = new Brush[tour.Stops.Count];
@@ -93,5 +89,5 @@
               }
 
-              graphics.DrawPolygon(pens[((currentTour >= pens.Length) ? (pens.Length - 1) : (currentTour))], tourPoints);
+              graphics.DrawPolygon(pens[currentTour], tourPoints);
 
               for (int i = 0; i < tour.Stops.Count; i++) {
@@ -103,4 +99,7 @@
               currentTour++;
             }
+
+            for (int i = 0; i < pens.Count; i++)
+              pens[i].Dispose();
           } else {
             Point locationPoint;
@@ -121,7 +120,4 @@
         }
       }
-
-      for (int i = 0; i < pens.Length; i++)
-        pens[i].Dispose();
     }
   }
Index: /branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4/SingleDepotVRPView.cs
===================================================================
--- /branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4/SingleDepotVRPView.cs	(revision 7857)
+++ /branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4/SingleDepotVRPView.cs	(revision 7858)
@@ -28,12 +28,4 @@
       BoolValue useDistanceMatrix = Content.UseDistanceMatrix;
 
-      Pen[] pens = {new Pen(Color.FromArgb(92,20,237)), new Pen(Color.FromArgb(237,183,20)), new Pen(Color.FromArgb(237,20,219)), new Pen(Color.FromArgb(20,237,76)),
-                    new Pen(Color.FromArgb(237,61,20)), new Pen(Color.FromArgb(115,78,26)), new Pen(Color.FromArgb(20,237,229)), new Pen(Color.FromArgb(39,101,19)),
-                    new Pen(Color.FromArgb(230,170,229)), new Pen(Color.FromArgb(142,136,89)), new Pen(Color.FromArgb(157,217,166)), new Pen(Color.FromArgb(31,19,101)),
-                    new Pen(Color.FromArgb(173,237,20)), new Pen(Color.FromArgb(230,231,161)), new Pen(Color.FromArgb(142,89,89)), new Pen(Color.FromArgb(93,89,142)),
-                    new Pen(Color.FromArgb(146,203,217)), new Pen(Color.FromArgb(101,19,75)), new Pen(Color.FromArgb(198,20,237)), new Pen(Color.FromArgb(185,185,185)),
-                    new Pen(Color.FromArgb(179,32,32)), new Pen(Color.FromArgb(18,119,115)), new Pen(Color.FromArgb(104,158,239)), new Pen(Color.Black)};
-
-
       if ((coordinates != null) && (coordinates.Rows > 0) && (coordinates.Columns == 2)) {
         double xMin = double.MaxValue, yMin = double.MaxValue, xMax = double.MinValue, yMax = double.MinValue;
@@ -51,6 +43,9 @@
         using (Graphics graphics = Graphics.FromImage(bitmap)) {
           if (Solution != null) {
+             List<Tour> tours = Solution.GetTours();
+             List<Pen> pens = GetColors(tours.Count);
+
             int currentTour = 0;
-            foreach (Tour tour in Solution.GetTours()) {
+            foreach (Tour tour in tours) {
               Point[] tourPoints = new Point[tour.Stops.Count + 2];
               Brush[] customerBrushes = new Brush[tour.Stops.Count];
@@ -76,5 +71,5 @@
               }
 
-              graphics.DrawPolygon(pens[((currentTour >= pens.Length) ? (pens.Length - 1) : (currentTour))], tourPoints);
+              graphics.DrawPolygon(pens[currentTour], tourPoints);
 
               for (int i = 0; i < tour.Stops.Count; i++) {
@@ -86,4 +81,7 @@
               currentTour++;
             }
+
+            for (int i = 0; i < pens.Count; i++)
+               pens[i].Dispose();
           } else {
             Point locationPoint;
@@ -102,7 +100,4 @@
         }
       }
-
-      for (int i = 0; i < pens.Length; i++)
-        pens[i].Dispose();
     }
   }
Index: /branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4/VRPProblemInstanceView.cs
===================================================================
--- /branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4/VRPProblemInstanceView.cs	(revision 7857)
+++ /branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4/VRPProblemInstanceView.cs	(revision 7858)
@@ -74,4 +74,49 @@
     protected abstract void DrawVisualization(Bitmap bitmap);
 
+    protected List<Pen> GetColors(int count) {
+      List<Pen> result = new List<Pen>();
+
+      int i = 0;
+
+      int r = 255;
+      int g = 255;
+      int b = 255;
+
+      int step = Math.Max(1, 200 * 6 / count);
+
+      while (result.Count != count) {
+        switch (i) {
+          case 0: result.Add(new Pen(Color.FromArgb(0, 0, b)));
+            break;
+          case 1: result.Add(new Pen(Color.FromArgb(0, g, 0)));
+            break;
+          case 2: result.Add(new Pen(Color.FromArgb(r, 0, 0)));
+            break;
+          case 3: result.Add(new Pen(Color.FromArgb(0, g, b)));
+            break;
+          case 4: result.Add(new Pen(Color.FromArgb(r, 0, b)));
+            break;
+          case 5: result.Add(new Pen(Color.FromArgb(r, g, 0)));
+            break;
+        }
+        
+        i++;
+        if (i == 6) {
+          i = 0;
+
+          if(r >= step)
+            r -= step;
+
+          if(g >= step)
+           g -= step;
+
+          if(b >= step)
+           b -= step;
+        }       
+      }
+
+      return result;
+    }
+
     protected void GenerateImage() {
       if ((pictureBox.Width > 0) && (pictureBox.Height > 0)) {
