Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeTile.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeTile.cs	(revision 10832)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeTile.cs	(revision 10833)
@@ -40,5 +40,5 @@
     public int PreferredNodeHeight { get; set; }
 
-    private const int labelHeight = 30;
+    private const int labelHeight = 60;
 
     private readonly SolidBrush defaultBrush;
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphChart.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphChart.cs	(revision 10832)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphChart.cs	(revision 10833)
@@ -132,4 +132,5 @@
         if (!node.InArcs.Any()) continue;
         var visualNode = GetMappedNode(node);
+
         if (visualNode == null) continue;
         foreach (var arc in node.InArcs) {
@@ -139,4 +140,5 @@
           var pen = Pens.Transparent;
           var visualArc = AddArc(Chart, visualParent, visualNode, pen);
+          visualArc.OneLayerDown(); // send it behind the visual nodes
           if (!arcMap.ContainsKey(Tuple.Create(visualParent, visualNode))) {
             arcMap.Add(Tuple.Create(visualParent, visualNode), visualArc);
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Analyzers/GenealogyAnalyzer.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Analyzers/GenealogyAnalyzer.cs	(revision 10832)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Analyzers/GenealogyAnalyzer.cs	(revision 10833)
@@ -205,11 +205,7 @@
         if (EnableCrossoverTracking.Value) {
           if (BeforeCrossoverOperator != null) {
-            //            BeforeCrossoverOperator.ParentsParameter.ActualName = CrossoverParentsParameterName;
-            //            BeforeCrossoverOperator.ChildParameter.ActualName = CrossoverChildParameterName;
             instrumentedCrossover.BeforeExecutionOperators.Add(BeforeCrossoverOperator);
           }
           if (AfterCrossoverOperator != null) {
-            //            AfterCrossoverOperator.ParentsParameter.ActualName = CrossoverParentsParameterName;
-            //            AfterCrossoverOperator.ChildParameter.ActualName = CrossoverChildParameterName;
             instrumentedCrossover.AfterExecutionOperators.Add(AfterCrossoverOperator);
           }
@@ -224,9 +220,7 @@
         if (EnableManipulatorTracking.Value) {
           if (BeforeManipulatorOperator != null) {
-            //            BeforeManipulatorOperator.ChildParameter.ActualName = ManipulatorChildParameterName;
             instrumentedManipulator.BeforeExecutionOperators.Add(BeforeManipulatorOperator);
           }
           if (AfterManipulatorOperator != null) {
-            //            AfterManipulatorOperator.ChildParameter.ActualName = ManipulatorChildParameterName;
             instrumentedManipulator.AfterExecutionOperators.Add(AfterManipulatorOperator);
           }
@@ -257,6 +251,15 @@
             IsElite = true
           };
+          // add new vertex to the graph
+          GenealogyGraph.AddVertex(vertex);
+          // swap content between current vertex and previous vertex
           var previousVertex = (IGenealogyGraphNode<T>)GenealogyGraph[elite];
-          GenealogyGraph.AddVertex(vertex);
+          var tmp = vertex.Content;
+          vertex.Content = previousVertex.Content;
+          previousVertex.Content = tmp;
+          // adjust graph content map
+          GenealogyGraph[vertex.Content] = vertex;
+          GenealogyGraph[previousVertex.Content] = previousVertex;
+          // connect current elite with previous elite
           previousVertex.AddForwardArc(vertex);
           vertex.AddReverseArc(previousVertex);
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/DirectedGraph/DirectedGraph.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/DirectedGraph/DirectedGraph.cs	(revision 10832)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/DirectedGraph/DirectedGraph.cs	(revision 10833)
@@ -68,4 +68,7 @@
         return result;
       }
+      set {
+        contentMap[key] = value;
+      }
     }
     public virtual bool Any(Func<IVertex, bool> predicate) {
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/DirectedGraph/Interfaces/IDirectedGraph.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/DirectedGraph/Interfaces/IDirectedGraph.cs	(revision 10832)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/DirectedGraph/Interfaces/IDirectedGraph.cs	(revision 10833)
@@ -32,5 +32,5 @@
     void RemoveVertex(IVertex vertex);
     List<IVertex> Nodes { get; }
-    IVertex this[object content] { get; }
+    IVertex this[object content] { get; set; }
     bool Contains(object content);
   }
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraph.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraph.cs	(revision 10832)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraph.cs	(revision 10833)
@@ -76,4 +76,5 @@
         return result == null ? null : (IGenealogyGraphNode)result;
       }
+      set { base[content] = value; }
     }
 
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/FragmentGraphView.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/FragmentGraphView.cs	(revision 10832)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/FragmentGraphView.cs	(revision 10833)
@@ -1,3 +1,4 @@
-﻿using System.Collections.Generic;
+﻿using System;
+using System.Collections.Generic;
 using System.Drawing;
 using System.Linq;
@@ -50,5 +51,6 @@
         var tile = new SymbolicExpressionTreeTile(chart);
         tile.LayoutEngine = symbolicExpressionEngine;
-        tile.Label = "Generation " + node.Rank;
+        tile.Label = "Generation " + node.Rank + Environment.NewLine +
+                     "Quality " + String.Format("{0:0.000}", node.Quality);
         tile.Root = node.Content.Root;
         var tileNode = new TileLayoutNode { Tile = tile };
@@ -131,4 +133,6 @@
         }
       }
+      // center display on the root of the fragment graph
+      symbolicExpressionChartControl.Chart.Move(tileDictionary[root].Tile.Position.X, tileDictionary[root].Tile.Position.Y);
       symbolicExpressionChartControl.UpdateEnabled = true;
       symbolicExpressionChartControl.EnforceUpdate();
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/SymboldDataAnalysisGenealogyView.Designer.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/SymboldDataAnalysisGenealogyView.Designer.cs	(revision 10832)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/SymboldDataAnalysisGenealogyView.Designer.cs	(revision 10833)
@@ -19,4 +19,6 @@
  */
 #endregion
+
+using System.Drawing;
 
 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
@@ -100,5 +102,5 @@
       this.symbolicExpressionTreeChart.SuspendRepaint = false;
       this.symbolicExpressionTreeChart.TabIndex = 0;
-      this.symbolicExpressionTreeChart.TextFont = new System.Drawing.Font("Microsoft Sans Serif", 12F);
+      this.symbolicExpressionTreeChart.TextFont = new System.Drawing.Font(FontFamily.GenericSansSerif, 10);
       this.symbolicExpressionTreeChart.Tree = null;
       // 
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Matching/SymbolicExpressionTreeMaxCommonSequenceCalculator.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Matching/SymbolicExpressionTreeMaxCommonSequenceCalculator.cs	(revision 10832)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Matching/SymbolicExpressionTreeMaxCommonSequenceCalculator.cs	(revision 10833)
@@ -1,16 +1,47 @@
-﻿using System;
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
 using System.Collections.Generic;
 
 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Matching {
-  public class MaxCommonSequenceCalculator<T, U>
+  public class MaxCommonSequenceCalculator<T, TComp>
     where T : class
-    where U : IEqualityComparer<T> {
+    where TComp : IEqualityComparer<T> {
 
-    public U Comparer { get; set; }
+    private TComp comparer;
+    public TComp Comparer {
+      get { return comparer; }
+      set { comparer = value; }
+    }
+
     private int[,] matrix;
     private List<T> sequence;
 
+    public MaxCommonSequenceCalculator(TComp comparer) {
+      this.comparer = comparer;
+    }
+
     /// <summary>
-    /// Calculate the maximal common subsequence between arrays a and b and return it
+    /// Calculate the maximal common subsequence between arrays a and b and return it.
+    /// THIS DOES NOT WORK FOR TREES
     /// </summary>
     /// <param name="a"></param>
@@ -27,7 +58,5 @@
       for (int i = 0; i <= m; ++i) {
         for (int j = 0; j <= n; ++j) {
-          if (i == 0 || j == 0) {
-            matrix[i, j] = 0;
-          } else if (Comparer.Equals(a[i - 1], b[j - 1])) {
+          if (comparer.Equals(a[i - 1], b[j - 1])) {
             matrix[i, j] = matrix[i - 1, j - 1] + 1;
           } else {
@@ -36,13 +65,12 @@
         }
       }
-      recon(a, b, n, m);
+      Recon(a, b, n, m); // build the common subsequence
       return sequence;
     }
 
-    private void recon(T[] a, T[] b, int i, int j) {
-      while (true) {
-        if (i == 0 || j == 0) return;
-        if (Comparer.Equals(a[i - 1], b[j - 1])) {
-          recon(a, b, i - 1, j - 1);
+    private void Recon(T[] a, T[] b, int i, int j) {
+      while (i > 0 && j > 0) {
+        if (comparer.Equals(a[i - 1], b[j - 1])) {
+          Recon(a, b, i - 1, j - 1);
           sequence.Add(a[i - 1]);
         } else if (matrix[i - 1, j] > matrix[i, j - 1]) {
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionAfterCrossoverOperator.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionAfterCrossoverOperator.cs	(revision 10832)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionAfterCrossoverOperator.cs	(revision 10833)
@@ -46,8 +46,4 @@
         break;
       }
-      //
-      //      if (fragment == null) {
-      //        throw new Exception("SymbolicDataAnalysisExpressionAfterCrossoverOperator: Could not identify fragment");
-      //      }
 
       arcs[0].Data = null;
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionAfterManipulatorOperator.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionAfterManipulatorOperator.cs	(revision 10832)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionAfterManipulatorOperator.cs	(revision 10833)
@@ -57,8 +57,4 @@
       }
 
-      //      if (fragment == null) {
-      //        throw new Exception("SymbolicDataAnalysisExpressionAfterManipulatorOperator: Could not identify fragment");
-      //      }
-
       vChild.InArcs.First().Data = fragment;
       return base.Apply();
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionBeforeCrossoverOperator.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionBeforeCrossoverOperator.cs	(revision 10832)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionBeforeCrossoverOperator.cs	(revision 10833)
@@ -20,5 +20,4 @@
 #endregion
 
-using System;
 using System.Linq;
 using HeuristicLab.Core;
@@ -35,11 +34,12 @@
 
       for (int i = 0; i < parents.Count; ++i) {
-        var nodes = parents[i].IterateNodesPrefix().ToList();
-        arcs[i].Data = nodes;
+        arcs[i].Data = parents[i].IterateNodesPrefix().ToList();
       }
-      var parentVertices = childVertex.Parents.ToList();
-      if (parents[0].Length != parentVertices[0].Content.Length || parents[1].Length != parentVertices[1].Content.Length) {
-        throw new Exception("Inconsistency detected in GenealogyGraph.");
-      }
+
+      //      var parentVertices = childVertex.Parents.ToList();
+      //
+      //      if (parents[0].Length != parentVertices[0].Content.Length || parents[1].Length != parentVertices[1].Content.Length) {
+      //        throw new Exception("Inconsistency detected in GenealogyGraph.");
+      //      }
 
       return result;
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionBeforeManipulatorOperator.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionBeforeManipulatorOperator.cs	(revision 10832)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionBeforeManipulatorOperator.cs	(revision 10833)
@@ -33,4 +33,12 @@
       vChild.InArcs.First().Data = vChild.Content.IterateNodesPrefix().ToList();
 
+      var vClone = (IGenealogyGraphNode<ISymbolicExpressionTree>)vChild.InArcs.Last().Source;
+      var fragment = (IFragment<ISymbolicExpressionTreeNode>)vClone.InArcs.Last().Data;
+      if (fragment != null) {
+        // this step must be performed because the fragment root actually references the original child (not the clone). 
+        // then, a mutation operation (acting on the original child), could disrupt it
+        fragment.Root = vClone.Content.IterateNodesPrefix().ElementAt(fragment.Index1);
+      }
+
       return result;
     }
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionTracing.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionTracing.cs	(revision 10832)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionTracing.cs	(revision 10833)
@@ -30,5 +30,6 @@
           var fragmentNode = new FragmentNode {
             Content = new Fragment<ISymbolicExpressionTreeNode> { Root = node.Content.NodeAt(index) },
-            Rank = node.Rank
+            Rank = node.Rank,
+            Quality = node.Quality
           };
           if (parent != null) {
@@ -98,5 +99,6 @@
               var fragmentNode = new FragmentNode {
                 Content = new Fragment<ISymbolicExpressionTreeNode> { Root = subtree },
-                Rank = node.Rank
+                Rank = node.Rank,
+                Quality = node.Quality
               };
               if (parent != null) {
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Tracking.sln
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Tracking.sln	(revision 10832)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Tracking.sln	(revision 10833)
@@ -2,5 +2,5 @@
 Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio 2013
-VisualStudioVersion = 12.0.30110.0
+VisualStudioVersion = 12.0.21005.1
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C80F4C35-CB87-4695-8A53-6F2D08275253}"
@@ -170,7 +170,4 @@
 		HideSolutionNode = FALSE
 	EndGlobalSection
-	GlobalSection(Performance) = preSolution
-		HasPerformanceSessions = true
-	EndGlobalSection
 	GlobalSection(TestCaseManagementSettings) = postSolution
 		CategoryFile = HeuristicLab.Tracking.vsmdi
