Index: branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphChart.cs
===================================================================
--- branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphChart.cs	(revision 8213)
+++ branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphChart.cs	(revision 8236)
@@ -67,26 +67,27 @@
       if (_graph == null) return;
       Chart.UpdateEnabled = false;
-      var layers = Graph.Values.GroupBy(node => node.Rank).OrderBy(g => g.Key);
-      // show elites in every graph level
-      List<GenealogyGraphNode> currLayer = null, prevLayer = null;
-      double currRank = 0.0;
-      int count = layers.Count();
-      for (int i = 0; i != count; ++i) {
-        // propagate elites from successive layers
-        bool f = currRank % 1 == 0;
-        if (f) // if the rank is an integer, then we need to propagate elites 
-          prevLayer = currLayer;
-        currRank = layers.ElementAt(i).Key;
-        currLayer = layers.ElementAt(i).ToList();
-        if (i > 0 && f) {
-          // this following code injects elites that propagate from the previous generation into the current graph layer, 
-          // so that they can be represented as visual nodes
-          int prevEliteCount = prevLayer.Count(node => node.IsElite);
-          int currEliteCount = currLayer.Count(node => node.IsElite);
-          for (int j = currEliteCount; j < prevEliteCount; ++j)
-            currLayer.Add(prevLayer.ElementAt(j));
-        }
-        currLayer.Sort(); // uses the CompareTo() method inside the GenealogyGraphNode class
-        foreach (var node in currLayer) {
+
+      var genealogyGraphNodes = Graph.Values.ToList();
+      var layers = genealogyGraphNodes.GroupBy(n => n.Rank).OrderBy(g => g.Key).Select(g => Tuple.Create(g.Key, g.ToList())).ToList();
+      List<GenealogyGraphNode> currentLayer = null;
+      List<GenealogyGraphNode> previousLayer = null;
+
+      for (int i = 0; i != layers.Count(); ++i) {
+        var layer = layers[i];
+        double currentRank = layer.Item1;
+        if (i > 0 && currentRank % 1 == 0) {
+          previousLayer = currentLayer;
+          currentLayer = layer.Item2;
+          int d = previousLayer.Count - currentLayer.Count;
+          if (d > 0)
+            currentLayer.AddRange(previousLayer.Take(d));
+        } else {
+          currentLayer = layer.Item2;
+        }
+        currentLayer.Sort(); // sort descending by quality (using comparison defined in GenealogyGraphNode class)
+
+        x = 0; // reset horizontal coordinate
+        // start laying out visual nodes
+        foreach (var node in currentLayer) {
           var pen = new Pen(Color.LightGray);
           var nl = Environment.NewLine;
@@ -102,33 +103,27 @@
             _visualNodeMap[node] = new List<VisualGenealogyGraphNode>();
           _visualNodeMap[node].Add(visualNode);
-          // connect visual nodes that actually represent the same individual 
-          // in the genealogy graph (this applies for elites) with a dashed line
-          if (_visualNodeMap[node].Count > 1) {
-            for (int c = _visualNodeMap[node].Count; c >= 2; --c) {
-              var n1 = _visualNodeMap[node][c - 1];
-              var n2 = _visualNodeMap[node][c - 2];
-              var visualArc = AddArc(Chart, n1, n2, new Pen(Color.LightGray) { DashStyle = DashStyle.Dash });
-              _visualArcMap[Tuple.Create(n1, n2)] = visualArc;
-            }
-          }
+
           x += Cx; // increment horizontal coordinate
-          if (node.InEdges == null && _visualNodeMap.ContainsKey(node)) continue;
-          // add visual edges
-          foreach (var arc in node.InEdges) {
-            var parent = arc.Target;
-            // find the visual parent node that is closest to the current node in terms of vertical distance
-            var visualParent = _visualNodeMap[parent].Where(p => p.Center.Y >= visualNode.Center.Y).OrderByDescending(p => p.Center.Y).Last();
-            DashStyle style;
-            if (visualParent.Data == visualNode.Data) { // if the graph nodes represent the same elite individual
-              style = DashStyle.Dash;
-            } else {
-              style = node.InEdges.Count == 2 ? DashStyle.Solid : DashStyle.Dash;
-            }
-            var arcPen = new Pen(Color.Transparent) { DashStyle = style };
-            _visualArcMap[Tuple.Create(visualParent, visualNode)] = AddArc(Chart, visualParent, visualNode, arcPen);
-          }
-        }
+        }
+
         y -= Cy; // decrement vertical coordinate (because the origin is upside down)
-        x = 0; // reset horizontal coordinate
+      }
+      // add arcs separately (to avoid some ordering problems)
+      foreach (var node in _visualNodeMap.Keys) {
+        var visualNode = _visualNodeMap[node][0];
+        if (node.InEdges == null) continue;
+
+        foreach (var arc in node.InEdges) {
+          var visualParent = _visualNodeMap[arc.Target][0];
+          var pen = new Pen(Color.Transparent);
+          _visualArcMap[Tuple.Create(visualParent, visualNode)] = AddArc(Chart, visualParent, visualNode, pen);
+        }
+      }
+      // connect visual nodes representing the same elite individual with a line
+      foreach (var list in _visualNodeMap.Values.Where(l => l.Count > 1)) {
+        for (int i = 1; i != list.Count; ++i) {
+          var pen = new Pen(Color.LightGray);
+          _visualArcMap[Tuple.Create(list[i - 1], list[i])] = AddArc(Chart, list[i - 1], list[i], pen);
+        }
       }
 
@@ -187,10 +182,14 @@
             node.Brush = new SolidBrush(node.ToColor());
             if (node.IncomingArcs != null)
-              foreach (var arc in node.IncomingArcs)
-                if (arc.Source.Data != arc.Target.Data && arc.Source == _visualNodeMap[arc.Source.Data][0]) {
+              foreach (var arc in node.IncomingArcs) {
+                // check if, in case of elites, the target node is the first visual representation of the elite
+                // (for purposes of display consistency)
+                bool isFirst = arc.Source == _visualNodeMap[arc.Source.Data][0];
+                if (arc.Source.Data != arc.Target.Data && isFirst) {
                   var start = new Point((int)arc.Start.X, (int)arc.Start.Y);
                   var end = new Point((int)arc.End.X, (int)arc.End.Y);
                   arc.Pen.Brush = new LinearGradientBrush(start, end, arc.Source.ToColor(), arc.Target.ToColor());
                 }
+              }
           }
           // highlight descendants
@@ -198,10 +197,14 @@
             node.Brush = new SolidBrush(node.ToColor());
             if (node.OutgoingArcs != null)
-              foreach (var arc in node.OutgoingArcs)
-                if (arc.Source.Data != arc.Target.Data && arc.Target == _visualNodeMap[arc.Target.Data][0]) {
+              foreach (var arc in node.OutgoingArcs) {
+                // check if, in case of elites, the target node is the first visual representation of the elite
+                // (for purposes of display consistency)
+                bool isFirst = arc.Target == _visualNodeMap[arc.Target.Data][0];
+                if (arc.Source.Data != arc.Target.Data && isFirst) {
                   var start = new Point((int)arc.Start.X, (int)arc.Start.Y);
                   var end = new Point((int)arc.End.X, (int)arc.End.Y);
                   arc.Pen.Brush = new LinearGradientBrush(start, end, arc.Source.ToColor(), arc.Target.ToColor());
                 }
+              }
           }
         } else {
Index: branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphView.cs
===================================================================
--- branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphView.cs	(revision 8213)
+++ branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphView.cs	(revision 8236)
@@ -115,4 +115,6 @@
           foreach (var node in fragment.IterateNodesBreadth()) {
             var visualNode = symbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNode(node);
+            if (visualNode == null)
+              continue;
             visualNode.FillColor = Color.LightGreen;
           }
Index: branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/VisualGenealogyGraphNode.cs
===================================================================
--- branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/VisualGenealogyGraphNode.cs	(revision 8213)
+++ branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/VisualGenealogyGraphNode.cs	(revision 8236)
@@ -23,4 +23,5 @@
 using System.Collections.Generic;
 using System.Drawing;
+using HeuristicLab.Common;
 using HeuristicLab.Visualization;
 
@@ -76,5 +77,8 @@
 
     public Color ToColor() {
-      return Color.FromArgb((int)((1 - Data.Quality) * 255), (int)(Data.Quality * 255), 0);
+      //      return Color.FromArgb((int)((1 - Data.Quality) * 255), (int)(Data.Quality * 255), 0);
+      int i = (int)(Data.Quality * ColorGradient.Colors.Count);
+      if (i == ColorGradient.Colors.Count) --i;
+      return ColorGradient.Colors[i];
     }
 
