Index: branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphChart.cs
===================================================================
--- branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphChart.cs	(revision 11866)
+++ branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphChart.cs	(revision 11881)
@@ -43,4 +43,12 @@
     private Dictionary<Tuple<VisualGenealogyGraphNode, VisualGenealogyGraphNode>, VisualGenealogyGraphArc> arcMap;
 
+    #region chart modes
+    public bool SimpleLineages { get; set; }
+    public bool LockGenealogy { get; set; }
+    public bool TraceFragments { get; set; }
+    #endregion
+
+    private bool DrawInProgress { get; set; } // do not try to update the chart while the drawing is not finished
+
     public IGenealogyGraph GenealogyGraph {
       get { return genealogyGraph; }
@@ -79,12 +87,5 @@
     }
 
-    #region chart modes
-    public bool SimpleLineages { get; set; }
-    public bool LockGenealogy { get; set; }
-    public bool TraceFragments { get; set; }
-    #endregion
-
     private Visualization.Rectangle TargetRectangle { get; set; }
-    private bool DrawInProgress { get; set; } // do not try to update the chart while the drawing is not finished
     protected VisualGenealogyGraphNode SelectedVisualNode { get; set; }
 
@@ -163,5 +164,4 @@
         }
       }
-      // TODO: connect elites
 
       Chart.UpdateEnabled = true;
@@ -200,4 +200,5 @@
       base.pictureBox_MouseMove(sender, e);
     }
+
     protected override void pictureBox_MouseUp(object sender, MouseEventArgs e) {
       Cursor = Cursors.Default;
@@ -252,4 +253,5 @@
     #endregion
 
+    #region drawing routines
     private static void DrawLineage(VisualGenealogyGraphNode node, Func<VisualGenealogyGraphNode, IEnumerable<VisualGenealogyGraphArc>> arcSelector, Func<VisualGenealogyGraphArc, VisualGenealogyGraphNode> nodeSelector) {
       var brush = (SolidBrush)node.Brush;
@@ -269,33 +271,4 @@
     }
 
-    public void HighlightHotPaths() {
-      Chart.UpdateEnabled = false;
-      ClearPrimitives();
-      var arcs = GenealogyGraph.Vertices.SelectMany(n => n.InArcs).ToList();
-      foreach (var arc in arcs) { arc.Weight = 1.0; } // reset weights
-      var rank = GenealogyGraph.Ranks.Max(x => x.Key);
-      foreach (var graphNode in GenealogyGraph.GetByRank(rank)) {
-        foreach (var ancestor in graphNode.Ancestors) {
-          foreach (var arc in ancestor.InArcs) {
-            arc.Weight++;
-          }
-        }
-      }
-      double max = arcs.Max(a => a.Weight);
-      double min = arcs.Min(a => a.Weight);
-
-      if (min.IsAlmost(max)) return;
-      //translate interval (min,max) to interval (0,255)
-      foreach (var arc in arcs) {
-        var vArc = GetMappedArc(arc.Source, arc.Target);
-        int colorIndex = (int)Math.Round((arc.Weight - min) * 255 / (max - min));
-        if (colorIndex > 254) colorIndex = 254;
-        vArc.Pen = new Pen(ColorGradient.Colors[colorIndex]);
-        //        vArc.Pen.Brush = new SolidBrush(ColorGradient.Colors[colorIndex]);
-      }
-      Chart.UpdateEnabled = true;
-      Chart.EnforceUpdate();
-    }
-
     void MarkSelectedNode() {
       var center = SelectedVisualNode.Center;
@@ -342,5 +315,4 @@
           primitive.Brush = new SolidBrush(Color.Transparent);
           primitive.Pen = new Pen(Color.DarkGray);
-          //          primitive.Pen = Pens.Transparent; // remove the node contour
         }
       }
@@ -387,4 +359,5 @@
       arc.Pen.Brush = new LinearGradientBrush(start, end, source.GetColor(), target.GetColor());
     }
+    #endregion
   }
 
Index: branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/SymbolicDataAnalysisGenealogyGraphView.cs
===================================================================
--- branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/SymbolicDataAnalysisGenealogyGraphView.cs	(revision 11866)
+++ branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/SymbolicDataAnalysisGenealogyGraphView.cs	(revision 11881)
@@ -26,4 +26,5 @@
 using System.Windows.Forms;
 using HeuristicLab.Common;
+using HeuristicLab.Core;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
@@ -81,5 +82,6 @@
         // get the ancestors into a new view
         var cloner = new Cloner();
-
+        // clone arcs and vertices and use them to create a new graph 
+        // that will include just the individual and its ancestors
         var graph = new GenealogyGraph<ISymbolicExpressionTree>();
         var ancestors = new[] { graphNode }.Concat(graphNode.Ancestors);
@@ -89,21 +91,17 @@
           graph.AddArc(cloner.Clone(arc));
         }
-        //        graph.AddVertices(graphNode.Ancestors);
         MainFormManager.MainForm.ShowContent(graph);
       }
 
       if (graphNode.InArcs.Any()) {
-        var fragment = graphNode.InArcs.Last().Data as IFragment<ISymbolicExpressionTreeNode>;
+        var data = graphNode.InArcs.Last().Data;
+        var fragment = data as IFragment<ISymbolicExpressionTreeNode>;
+        var td = data as TraceData;
         if (fragment != null) {
           treeChart_HighlightSubtree(graphNode.Data.NodeAt(fragment.Index1));
-        }
-      }
-      if (graphNode.OutArcs.Any()) {
-        var td = graphNode.OutArcs.Last().Data as Tuple<int, int, int, int>;
-        if (td != null) {
-          var s = graphNode.Data.NodeAt(td.Item3); // subtree index
-          var f = graphNode.Data.NodeAt(td.Item4); // fragment index 
-          treeChart_HighlightSubtree(s, Color.Orange);
-          treeChart_HighlightSubtree(f, Color.RoyalBlue);
+        } else if (td != null) {
+          var nodes = graphNode.Data.IterateNodesPrefix().ToList();
+          treeChart_HighlightSubtree(nodes[td.LastSubtreeIndex], Color.Orange);
+          treeChart_HighlightSubtree(nodes[td.LastFragmentIndex], Color.DodgerBlue);
         }
       }
@@ -127,11 +125,6 @@
           genealogyGraphChart.UpdateEnabled = false;
           genealogyGraphChart.ClearArcs();
-          //          genealogyGraphChart.ClearPrimitives();
           var genealogyNodes = traceGraph.Vertices.Select(v => Content.GetByContent(v.Data));
-          //          genealogyGraphChart.HighlightNodes(graphNode.Ancestors, Color.Gray, false);
           genealogyGraphChart.HighlightNodes(genealogyNodes, Color.Black, false);
-          //          foreach (var a in traceGraph.Arcs) {
-          //            genealogyGraphChart.HighlightArc(Content.GetByContent(a.Target.Data), Content.GetByContent(a.Source.Data));
-          //          }
           genealogyGraphChart.UpdateEnabled = true;
           genealogyGraphChart.EnforceUpdate();
@@ -184,6 +177,7 @@
     private void navigateLeftButton_Click(object sender, EventArgs e) {
       var graphNode = (IGenealogyGraphNode<ISymbolicExpressionTree>)genealogyGraphChart.SelectedGraphNode;
-      if (graphNode.Parents.Any()) {
-        genealogyGraphChart.SelectedGraphNode = graphNode.Parents.First();
+      var inArcs = (List<IArc>)((IVertex)graphNode).InArcs;
+      if (inArcs.Count > 0) {
+        genealogyGraphChart.SelectedGraphNode = (IGenealogyGraphNode<ISymbolicExpressionTree>)inArcs[0].Source;
       }
     }
@@ -191,6 +185,34 @@
     private void navigateRightButton_Click(object sender, EventArgs e) {
       var graphNode = (IGenealogyGraphNode<ISymbolicExpressionTree>)genealogyGraphChart.SelectedGraphNode;
-      if (graphNode.Parents.Any()) {
-        genealogyGraphChart.SelectedGraphNode = graphNode.Parents.Last(); // this will only work for genealogy graphs (not trace graphs)
+      var inArcs = (List<IArc>)((IVertex)graphNode).InArcs;
+      if (inArcs.Count > 0) {
+        var data = inArcs.Last().Data;
+        var fragment = (data as IFragment<ISymbolicExpressionTreeNode>);
+        var td = data as TraceData;
+        if (fragment != null) {
+          genealogyGraphChart.SelectedGraphNode = (IGenealogyGraphNode<ISymbolicExpressionTree>)inArcs.Last().Source;
+        } else if (td != null) {
+          if (inArcs.Count == 1) {
+            genealogyGraphChart.SelectedGraphNode = (IGenealogyGraphNode<ISymbolicExpressionTree>)inArcs[0].Source;
+            return;
+          }
+          // the first arc from inArcs will always represent the connection to the root parent
+          // (tracing the body of the traced subtree)
+          // therefore, in order to follow the correct non-root parent, we have to find the correct arc
+          // But, the FragmentIndex recorded in the TraceData of the first arc has to match the SubtreeIndex recorded in the TraceData of the searched arc
+          td = (TraceData)inArcs[0].Data;
+          var f1 = (graphNode.Data).NodeAt(td.LastFragmentIndex);
+          for (int i = 1; i < inArcs.Count; ++i) {
+            td = (TraceData)inArcs[i].Data;
+            var f2 = ((ISymbolicExpressionTree)inArcs[i].Source.Data).NodeAt(td.SubtreeIndex);
+            // if the subtrees are the same we have found a match
+            // note: this is not necessarily 100% correct if in the trace graph we have identical fragments on different arcs
+            if (f1.Difference(f2) == null) {
+              genealogyGraphChart.SelectedGraphNode = (IGenealogyGraphNode<ISymbolicExpressionTree>)inArcs[i].Source;
+              return;
+            }
+          }
+          throw new InvalidOperationException("Error calculating the next step.");
+        }
       }
     }
Index: branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/TraceCalculator.cs
===================================================================
--- branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/TraceCalculator.cs	(revision 11866)
+++ branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/TraceCalculator.cs	(revision 11881)
@@ -58,11 +58,4 @@
       tc.Trace(node, subtreeIndex);
       return tc.TraceGraph;
-    }
-
-    public IGenealogyGraph<ISymbolicExpressionTree> PartialTrace(IGenealogyGraphNode<ISymbolicExpressionTree> node,
-      int subtreeIndex, ISymbolicExpressionTreeNode subtree) {
-      traceGraph = new GenealogyGraph<ISymbolicExpressionTree>();
-      traceMap = new Dictionary<IGenealogyGraphNode<ISymbolicExpressionTree>, TraceData>();
-      return null;
     }
 
@@ -97,5 +90,6 @@
     private void TraceRecursive(IGenealogyGraphNode<ISymbolicExpressionTree> node, int subtreeIndex, IGenealogyGraphNode<ISymbolicExpressionTree> last = null) {
       var g = node;
-      int si = subtreeIndex;
+      int si = subtreeIndex; // subtree index
+      int fi = 0; // fragment index
       while (g.Parents.Any()) {
         Debug.Assert(si < g.Data.Length);
@@ -109,5 +103,5 @@
         }
 
-        int fi = fragment.Index1;               // fragment index
+        fi = fragment.Index1;               // fragment index
         int fl = fragment.Root.GetLength();     // fragment length
         int sl = NodeAt(g.Data, si).GetLength(); // subtree length
@@ -137,5 +131,5 @@
             if (fi < si + sl) {
               // subtree contains fragment => branching point in the fragment graph
-              var n = GetTraceNode(g, si, fi); // current node becomes "last" as we restart tracing from the parent
+              var n = AddTraceNode(g, si, fi); // current node becomes "last" as we restart tracing from the parent
               TraceRecursive(parent0, si, n);
               TraceRecursive(parent1, fragment.Index2, n);
@@ -157,5 +151,5 @@
           // check if the subtree and the fragment overlap => branch out
           if ((si == fi) || (si < fi && fi < si + sl) || (fi < si && si < fi + fl)) {
-            var n = GetTraceNode(g, si, fi); // current node becomes "last" as we restart tracing from the parent
+            var n = AddTraceNode(g, si, fi); // current node becomes "last" as we restart tracing from the parent
             int i = si < fi ? si : fi;
             TraceRecursive(parent0, i, n);
@@ -173,5 +167,8 @@
       }
       // when we are out of the while the last vertex must be connected with the current one
-      ConnectLast(g, si, last);
+      // if there is no last vertex, it means the tracing reached the top of the genealogy graph
+      var current = AddTraceNode(g, si, fi);
+      if (last != null)
+        ConnectLast(current, last, si, fi);
     }
 
@@ -184,5 +181,5 @@
     /// <param name="fi">The fragment index</param>
     /// <returns></returns>
-    private IGenealogyGraphNode<ISymbolicExpressionTree> GetTraceNode(IGenealogyGraphNode<ISymbolicExpressionTree> g, int si, int fi) {
+    private IGenealogyGraphNode<ISymbolicExpressionTree> AddTraceNode(IGenealogyGraphNode<ISymbolicExpressionTree> g, int si, int fi) {
       var n = traceGraph.GetByContent(g.Data);
       if (n == null) {
@@ -211,21 +208,16 @@
     /// of the genealogy graph node @g.  
     /// </summary>
-    /// <param name="g">The current node in the genealogy graph</param>
+    /// <param name="current">The current node in the genealogy graph</param>
+    /// <param name="last">The last added node in the trace graph</param>   
     /// <param name="si">The index of the traced subtree</param>
-    /// <param name="last">The last added node in the trace graph</param>
-    private void ConnectLast(IGenealogyGraphNode<ISymbolicExpressionTree> g, int si, IGenealogyGraphNode<ISymbolicExpressionTree> last) {
-      var inArcs = (List<IArc>)((IVertex)g).InArcs;
-      var fragment = g.Parents.Any() ? (IFragment<ISymbolicExpressionTreeNode>)inArcs.Last().Data : null;
-      int fi = fragment == null ? 0 : fragment.Index1; // fragment index
-      var n = GetTraceNode(g, si, fi); // will append n to the trace graph if it does not exist
-      if (last == null)
-        return;
+    /// <param name="fi">The index of the fragment</param>
+    private void ConnectLast(IGenealogyGraphNode<ISymbolicExpressionTree> current, IGenealogyGraphNode<ISymbolicExpressionTree> last, int si, int fi) {
       var lastTraceData = traceMap[last];
       int lastSi = lastTraceData.SubtreeIndex; // last subtree index (index of the traced subtree in the previous trace node)
       int lastFi = lastTraceData.FragmentIndex; // last fragment index (index of the fragment in the previous trace node)
       var td = new TraceData(si, fi, lastSi, lastFi); // trace data
-      var arc = n.OutArcs.SingleOrDefault(a => a.Target == last && a.Data.Equals(td));
+      var arc = current.OutArcs.SingleOrDefault(a => a.Target == last && a.Data.Equals(td));
       if (arc == null) {
-        arc = new GenealogyGraphArc(n, last) { Data = td };
+        arc = new GenealogyGraphArc(current, last) { Data = td };
         traceGraph.AddArc(arc);
       }
@@ -233,5 +225,5 @@
   }
   // this class is here to help clarify the semantics
-  internal class TraceData : Tuple<int, int, int, int> {
+  public class TraceData : Tuple<int, int, int, int> {
     public TraceData(int currentSubtreeIndex, int currentFragmentIndex, int lastSubtreeIndex, int lastFragmentIndex)
       : base(currentSubtreeIndex, currentFragmentIndex, lastSubtreeIndex, lastFragmentIndex) {
Index: branches/HeuristicLab.EvolutionTracking/HeuristicLab.Tracking.sln
===================================================================
--- branches/HeuristicLab.EvolutionTracking/HeuristicLab.Tracking.sln	(revision 11866)
+++ branches/HeuristicLab.EvolutionTracking/HeuristicLab.Tracking.sln	(revision 11881)
@@ -184,7 +184,4 @@
 		HideSolutionNode = FALSE
 	EndGlobalSection
-	GlobalSection(Performance) = preSolution
-		HasPerformanceSessions = true
-	EndGlobalSection
 	GlobalSection(TestCaseManagementSettings) = postSolution
 		CategoryFile = HeuristicLab.Tracking.vsmdi
