Index: /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/FrequentFragmentsDialog.Designer.cs
===================================================================
--- /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/FrequentFragmentsDialog.Designer.cs	(revision 9420)
+++ /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/FrequentFragmentsDialog.Designer.cs	(revision 9420)
@@ -0,0 +1,53 @@
+﻿namespace HeuristicLab.EvolutionaryTracking.Views {
+  partial class FrequentFragmentsDialog {
+    /// <summary>
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary>
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Windows Form Designer generated code
+
+    /// <summary>
+    /// Required method for Designer support - do not modify
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.fragmentsPanel = new System.Windows.Forms.Panel();
+      this.SuspendLayout();
+      // 
+      // fragmentsPanel
+      // 
+      this.fragmentsPanel.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.fragmentsPanel.Location = new System.Drawing.Point(0, 0);
+      this.fragmentsPanel.Name = "fragmentsPanel";
+      this.fragmentsPanel.Size = new System.Drawing.Size(292, 270);
+      this.fragmentsPanel.TabIndex = 1;
+      // 
+      // FrequentFragmentsDialog
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.ClientSize = new System.Drawing.Size(292, 270);
+      this.Controls.Add(this.fragmentsPanel);
+      this.Name = "FrequentFragmentsDialog";
+      this.Text = "FrequentFragmentsDialog";
+      this.ResumeLayout(false);
+
+    }
+
+    #endregion
+
+    public System.Windows.Forms.Panel fragmentsPanel;
+  }
+}
Index: /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/FrequentFragmentsDialog.cs
===================================================================
--- /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/FrequentFragmentsDialog.cs	(revision 9420)
+++ /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/FrequentFragmentsDialog.cs	(revision 9420)
@@ -0,0 +1,10 @@
+﻿using System.Windows.Forms;
+
+namespace HeuristicLab.EvolutionaryTracking.Views {
+  public partial class FrequentFragmentsDialog : Form {
+    public FrequentFragmentsDialog() {
+      InitializeComponent();
+
+    }
+  }
+}
Index: /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphChart.Designer.cs
===================================================================
--- /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphChart.Designer.cs	(revision 9419)
+++ /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphChart.Designer.cs	(revision 9420)
@@ -45,7 +45,11 @@
     /// </summary>
     private void InitializeComponent() {
-      this.components = new System.ComponentModel.Container();
-      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
+      ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit();
       this.SuspendLayout();
+      // 
+      // pictureBox
+      // 
+      this.pictureBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)));
+      this.pictureBox.Dock = System.Windows.Forms.DockStyle.Fill;
       // 
       // GenealogyGraphChart
@@ -54,4 +58,6 @@
       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
       this.Name = "GenealogyGraphChart";
+      this.Controls.SetChildIndex(this.pictureBox, 0);
+      ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit();
       this.ResumeLayout(false);
 
Index: /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphChart.cs
===================================================================
--- /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphChart.cs	(revision 9419)
+++ /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphChart.cs	(revision 9420)
@@ -28,5 +28,4 @@
 using HeuristicLab.Common;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
-using HeuristicLab.Problems.DataAnalysis.Symbolic;
 using HeuristicLab.Visualization;
 
@@ -42,4 +41,9 @@
     private Visualization.Rectangle targetRectangle; // provides a  rectangle mark of the currently selected genealogy graph node
 
+    public bool SimpleLineages { get; set; }
+    public bool LockGenealogy { get; set; }
+
+    private bool drawing;
+
     private SymbolicExpressionTreeGenealogyGraph graph;
     public SymbolicExpressionTreeGenealogyGraph Graph {
@@ -48,9 +52,4 @@
         graph = value;
         if (graph == null) return;
-        // TODO: should move the subtree sorting code out of here and int the view
-        var canonicalSorter = new SymbolicExpressionTreeCanonicalSorter();
-        // sort subtrees in order to improve matching
-        foreach (var tree in graph.Nodes.Select(n => n.SymbolicExpressionTree))
-          canonicalSorter.SortSubtrees(tree);
 
         visualNodeMap = new Dictionary<string, VisualGenealogyGraphNode>();
@@ -68,4 +67,18 @@
     }
 
+    private VisualGenealogyGraphArc GetVisualGenealogyGraphArc(IVertex source, IVertex target) {
+      VisualGenealogyGraphNode visualSource;
+      VisualGenealogyGraphNode visualTarget;
+      visualNodeMap.TryGetValue(source.Id, out visualSource);
+      visualNodeMap.TryGetValue(target.Id, out visualTarget);
+      if (visualSource != null && visualTarget != null) {
+        VisualGenealogyGraphArc visualArc;
+        visualArcMap.TryGetValue(
+          new Tuple<VisualGenealogyGraphNode, VisualGenealogyGraphNode>(visualSource, visualTarget), out visualArc);
+        if (visualArc != null) return visualArc;
+      }
+      return null;
+    }
+
     public event MouseEventHandler GenealogyGraphNodeClicked;
     private void OnGenealogyGraphNodeClicked(object sender, MouseEventArgs e) {
@@ -84,10 +97,26 @@
       Chart.UpdateEnabled = false;
 
+      drawing = true;
+
       var layers = Graph.Nodes.GroupBy(n => n.Rank).OrderBy(g => g.Key).Select(g => new { Rank = g.Key, Nodes = g.ToList() }).ToList();
 
+      y = PreferredSize.Height + Cx + 2 * Diameter;
+
       for (int i = 0; i != layers.Count; ++i) {
+        x = 0;
+        layers[i].Nodes.Sort((b, a) => Graph.Compare(a, b));
+        double rank = Math.Floor(layers[i].Rank);
+        if (layers[i].Rank.IsAlmost(rank)) {
+          var visualTextNode = new VisualGenealogyGraphTextLabel(Chart, x, y + 2, x + Diameter, y + Diameter) {
+            Brush = new SolidBrush(Color.Black),
+            Font = new Font("Arial", Diameter - 4, FontStyle.Regular, GraphicsUnit.Pixel),
+            Text = String.Format("{0:0}", rank)
+          };
+          Chart.Group.Add(visualTextNode);
+        }
+
         // sort descending by quality (using comparison defined in GenealogyGraphNode class)
-        layers[i].Nodes.Sort((b, a) => Graph.Compare(a, b));
-        x = 0; // reset horizontal coordinate
+        x += (int)Math.Floor(1.5 * Cx); // reset horizontal coordinate
+
         foreach (var node in layers[i].Nodes) {
           var pen = new Pen(Color.LightGray);
@@ -95,6 +124,5 @@
           var visualNode = new VisualGenealogyGraphNode(Chart, x, y, x + Diameter, y + Diameter, pen, null) {
             Data = node,
-            ToolTipText = "Id: " + node.Label + nl +
-                          "Rank: " + node.Rank + nl +
+            ToolTipText = "Rank: " + node.Rank + nl +
                           "Quality: " + String.Format("{0:0.0000}", node.Quality) + nl +
                           "IsElite: " + node.IsElite
@@ -135,6 +163,17 @@
       }
 
-      Chart.UpdateEnabled = true;
-      Chart.EnforceUpdate();
+      // highlight the most recent common ancestor ("eve" individual)
+      //      var eve = graph.MostRecentCommonAncestor();
+      //      if (eve != null) {
+      //        var visualGraphNode = GetVisualGenealogyGraphNode(eve);
+
+      //        var brush = new SolidBrush(Color.BlueViolet);
+      //        visualGraphNode.Brush = brush;
+      //      }
+
+      Chart.UpdateEnabled = true;
+      Chart.EnforceUpdate();
+
+      drawing = false;
     }
 
@@ -150,4 +189,9 @@
     }
 
+    protected override void pictureBox_MouseMove(object sender, MouseEventArgs e) {
+      if (!drawing)
+        base.pictureBox_MouseMove(sender, e);
+    }
+
     protected override void pictureBox_MouseUp(object sender, MouseEventArgs e) {
       if (Chart.Mode != ChartMode.Select) {
@@ -163,16 +207,21 @@
       selectedGenealogyGraphNode = visualNodes[0] as VisualGenealogyGraphNode;
       if (selectedGenealogyGraphNode == null) return;
-      // new node has been selected, clean up
-      Chart.UpdateEnabled = false;
-      // clear colors
-      ClearAllNodes();
-      // use a rectangle to highlight the currently selected genealogy graph node
+
+      if (!LockGenealogy) {
+        // new node has been selected, clean up
+        Chart.UpdateEnabled = false;
+        if (ModifierKeys != Keys.Shift)
+          // clear colors
+          ClearAllNodes();
+        // use a rectangle to highlight the currently selected genealogy graph node
+        var gNode = selectedGenealogyGraphNode.Data;
+        var visualNode = GetVisualGenealogyGraphNode(gNode);
+
+        DrawLineage(visualNode, n => SimpleLineages ? n.IncomingArcs.Take(1) : n.IncomingArcs, a => a.Source);
+        visualNode.Brush = null;
+        DrawLineage(visualNode, n => n.OutgoingArcs, a => a.Target);
+      }
+
       MarkSelectedNode();
-      var gNode = selectedGenealogyGraphNode.Data;
-      var visualNode = GetVisualGenealogyGraphNode(gNode);
-
-      DrawLineage(visualNode, n => n.IncomingArcs, a => a.Source);
-      visualNode.Brush = null;
-      DrawLineage(visualNode, n => n.OutgoingArcs, a => a.Target);
 
       // update
@@ -185,11 +234,10 @@
     }
 
-    private void DrawLineage(VisualGenealogyGraphNode node,
-                             Func<VisualGenealogyGraphNode, IEnumerable<VisualGenealogyGraphArc>> arcSelector,
-                             Func<VisualGenealogyGraphArc, VisualGenealogyGraphNode> nodeSelector) {
+    private void DrawLineage(VisualGenealogyGraphNode node, Func<VisualGenealogyGraphNode, IEnumerable<VisualGenealogyGraphArc>> arcSelector, Func<VisualGenealogyGraphArc, VisualGenealogyGraphNode> nodeSelector) {
       if (node.Brush != null) return;
       node.Brush = new SolidBrush(node.Data.GetColor());
       var arcs = arcSelector(node);
       if (arcs == null) return;
+
       foreach (var arc in arcs) {
         var source = arc.Source.Data;
@@ -198,4 +246,6 @@
         var end = new Point((int)arc.End.X, (int)arc.End.Y);
         arc.Pen.Brush = new LinearGradientBrush(start, end, source.GetColor(), target.GetColor());
+        arc.Pen.Color = Color.Transparent;
+        //        arc.Pen.Brush = new SolidBrush(Color.DarkGray);
         DrawLineage(nodeSelector(arc), arcSelector, nodeSelector);
       }
@@ -231,9 +281,22 @@
 
     // TODO: optimize and reduce complexity of this method
-    public void HighlightNodes(IEnumerable<ISymbolicExpressionTree> trees, Color color) {
+    public void HighlightNodes(IEnumerable<ISymbolicExpressionTree> trees) {
       foreach (var tree in trees) {
         var graphNodes = graph.GetGraphNodes(tree);
         foreach (var graphNode in graphNodes) {
-          GetVisualGenealogyGraphNode(graphNode).Brush = new SolidBrush(color);
+          GetVisualGenealogyGraphNode(graphNode).Brush = new SolidBrush(graphNode.GetColor());
+        }
+      }
+    }
+
+    public void HighlightArcs(IEnumerable<IEdge> arcs, Color color) {
+      foreach (var a in arcs) {
+        var arc = GetVisualGenealogyGraphArc(a.Source, a.Target);
+        if (arc != null) {
+          var source = arc.Source.Data;
+          var target = arc.Target.Data;
+          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, source.GetColor(), target.GetColor());
         }
       }
@@ -242,4 +305,20 @@
     public void HighlightNode(SymbolicExpressionGenealogyGraphNode graphNode, Color color) {
       GetVisualGenealogyGraphNode(graphNode).Brush = new SolidBrush(color);
+    }
+
+    public void HighlightAll() {
+      Chart.UpdateEnabled = false;
+      foreach (var visualNode in visualNodeMap.Values) {
+        visualNode.Brush = new SolidBrush(visualNode.Data.GetColor());
+      }
+      foreach (var arc in visualArcMap.Values) {
+        var source = arc.Source.Data;
+        var target = arc.Target.Data;
+        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, source.GetColor(), target.GetColor());
+      }
+      Chart.UpdateEnabled = true;
+      Chart.EnforceUpdate();
     }
 
Index: /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphView.Designer.cs
===================================================================
--- /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphView.Designer.cs	(revision 9419)
+++ /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphView.Designer.cs	(revision 9420)
@@ -1,3 +1,5 @@
 ﻿
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
+
 namespace HeuristicLab.EvolutionaryTracking.Views {
   partial class GenealogyGraphView {
@@ -26,48 +28,35 @@
     private void InitializeComponent() {
       this.components = new System.ComponentModel.Container();
-      this.mainTableLayout = new System.Windows.Forms.TableLayoutPanel();
       this.splitContainer = new System.Windows.Forms.SplitContainer();
-      this.genealogyTableLayout = new System.Windows.Forms.TableLayoutPanel();
       this.genealogyGraphChart = new HeuristicLab.EvolutionaryTracking.Views.GenealogyGraphChart();
       this.symbolicExpressionTreeChart = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart();
-      this.topControlBox = new System.Windows.Forms.GroupBox();
+      this.topControlBox = new System.Windows.Forms.Panel();
+      this.groupBox1 = new System.Windows.Forms.GroupBox();
+      this.matchConstantsCheckBox = new System.Windows.Forms.CheckBox();
+      this.matchVariableWeightsCheckBox = new System.Windows.Forms.CheckBox();
       this.matchVariableNamesCheckBox = new System.Windows.Forms.CheckBox();
-      this.matchVariableWeightsCheckBox = new System.Windows.Forms.CheckBox();
-      this.matchConstantsCheckBox = new System.Windows.Forms.CheckBox();
-      this.similarityLabel = new System.Windows.Forms.Label();
-      this.graphControlsPanel = new System.Windows.Forms.Panel();
+      this.graphControlsGroupBox = new System.Windows.Forms.GroupBox();
+      this.lockGenealogyCheckBox = new System.Windows.Forms.CheckBox();
+      this.highlightAllButton = new System.Windows.Forms.Button();
+      this.simpleLineagesCheckBox = new System.Windows.Forms.CheckBox();
       this.selectModeButton = new System.Windows.Forms.RadioButton();
       this.moveModeButton = new System.Windows.Forms.RadioButton();
       this.zoomModeButton = new System.Windows.Forms.RadioButton();
-      this.mainTableLayout.SuspendLayout();
+      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
       ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
       this.splitContainer.Panel1.SuspendLayout();
       this.splitContainer.Panel2.SuspendLayout();
       this.splitContainer.SuspendLayout();
-      this.genealogyTableLayout.SuspendLayout();
       this.topControlBox.SuspendLayout();
-      this.graphControlsPanel.SuspendLayout();
+      this.groupBox1.SuspendLayout();
+      this.graphControlsGroupBox.SuspendLayout();
       this.SuspendLayout();
       // 
-      // mainTableLayout
-      // 
-      this.mainTableLayout.ColumnCount = 1;
-      this.mainTableLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
-      this.mainTableLayout.Controls.Add(this.splitContainer, 0, 1);
-      this.mainTableLayout.Controls.Add(this.topControlBox, 0, 0);
-      this.mainTableLayout.Dock = System.Windows.Forms.DockStyle.Fill;
-      this.mainTableLayout.Location = new System.Drawing.Point(0, 0);
-      this.mainTableLayout.Name = "mainTableLayout";
-      this.mainTableLayout.RowCount = 2;
-      this.mainTableLayout.RowStyles.Add(new System.Windows.Forms.RowStyle());
-      this.mainTableLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
-      this.mainTableLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
-      this.mainTableLayout.Size = new System.Drawing.Size(787, 584);
-      this.mainTableLayout.TabIndex = 6;
-      // 
       // splitContainer
       // 
+      this.splitContainer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.splitContainer.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
-      this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
       this.splitContainer.Location = new System.Drawing.Point(3, 53);
       this.splitContainer.Name = "splitContainer";
@@ -75,5 +64,5 @@
       // splitContainer.Panel1
       // 
-      this.splitContainer.Panel1.Controls.Add(this.genealogyTableLayout);
+      this.splitContainer.Panel1.Controls.Add(this.genealogyGraphChart);
       this.splitContainer.Panel1MinSize = 50;
       // 
@@ -82,21 +71,7 @@
       this.splitContainer.Panel2.Controls.Add(this.symbolicExpressionTreeChart);
       this.splitContainer.Panel2MinSize = 50;
-      this.splitContainer.Size = new System.Drawing.Size(781, 528);
-      this.splitContainer.SplitterDistance = 360;
+      this.splitContainer.Size = new System.Drawing.Size(1066, 722);
+      this.splitContainer.SplitterDistance = 489;
       this.splitContainer.TabIndex = 7;
-      // 
-      // genealogyTableLayout
-      // 
-      this.genealogyTableLayout.ColumnCount = 1;
-      this.genealogyTableLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
-      this.genealogyTableLayout.Controls.Add(this.genealogyGraphChart, 0, 1);
-      this.genealogyTableLayout.Dock = System.Windows.Forms.DockStyle.Fill;
-      this.genealogyTableLayout.Location = new System.Drawing.Point(0, 0);
-      this.genealogyTableLayout.Name = "genealogyTableLayout";
-      this.genealogyTableLayout.RowCount = 2;
-      this.genealogyTableLayout.RowStyles.Add(new System.Windows.Forms.RowStyle());
-      this.genealogyTableLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
-      this.genealogyTableLayout.Size = new System.Drawing.Size(358, 526);
-      this.genealogyTableLayout.TabIndex = 4;
       // 
       // genealogyGraphChart
@@ -104,8 +79,10 @@
       this.genealogyGraphChart.BackColor = System.Drawing.SystemColors.Control;
       this.genealogyGraphChart.Dock = System.Windows.Forms.DockStyle.Fill;
-      this.genealogyGraphChart.Location = new System.Drawing.Point(3, 3);
+      this.genealogyGraphChart.Location = new System.Drawing.Point(0, 0);
+      this.genealogyGraphChart.LockGenealogy = false;
       this.genealogyGraphChart.Name = "genealogyGraphChart";
       this.genealogyGraphChart.ScaleOnResize = true;
-      this.genealogyGraphChart.Size = new System.Drawing.Size(352, 520);
+      this.genealogyGraphChart.SimpleLineages = false;
+      this.genealogyGraphChart.Size = new System.Drawing.Size(487, 720);
       this.genealogyGraphChart.TabIndex = 2;
       // 
@@ -117,5 +94,5 @@
       this.symbolicExpressionTreeChart.Location = new System.Drawing.Point(0, 0);
       this.symbolicExpressionTreeChart.Name = "symbolicExpressionTreeChart";
-      this.symbolicExpressionTreeChart.Size = new System.Drawing.Size(415, 526);
+      this.symbolicExpressionTreeChart.Size = new System.Drawing.Size(571, 720);
       this.symbolicExpressionTreeChart.Spacing = 5;
       this.symbolicExpressionTreeChart.SuspendRepaint = false;
@@ -126,16 +103,50 @@
       // topControlBox
       // 
-      this.topControlBox.Controls.Add(this.matchVariableNamesCheckBox);
-      this.topControlBox.Controls.Add(this.matchVariableWeightsCheckBox);
-      this.topControlBox.Controls.Add(this.matchConstantsCheckBox);
-      this.topControlBox.Controls.Add(this.similarityLabel);
-      this.topControlBox.Controls.Add(this.graphControlsPanel);
-      this.topControlBox.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.topControlBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.topControlBox.Controls.Add(this.groupBox1);
+      this.topControlBox.Controls.Add(this.graphControlsGroupBox);
       this.topControlBox.Location = new System.Drawing.Point(3, 3);
       this.topControlBox.Name = "topControlBox";
-      this.topControlBox.Size = new System.Drawing.Size(781, 44);
+      this.topControlBox.Size = new System.Drawing.Size(1066, 44);
       this.topControlBox.TabIndex = 6;
-      this.topControlBox.TabStop = false;
-      this.topControlBox.Text = "Controls";
+      // 
+      // groupBox1
+      // 
+      this.groupBox1.Controls.Add(this.matchConstantsCheckBox);
+      this.groupBox1.Controls.Add(this.matchVariableWeightsCheckBox);
+      this.groupBox1.Controls.Add(this.matchVariableNamesCheckBox);
+      this.groupBox1.Location = new System.Drawing.Point(209, -2);
+      this.groupBox1.Name = "groupBox1";
+      this.groupBox1.Size = new System.Drawing.Size(325, 44);
+      this.groupBox1.TabIndex = 12;
+      this.groupBox1.TabStop = false;
+      this.groupBox1.Text = "Matching constraints";
+      // 
+      // matchConstantsCheckBox
+      // 
+      this.matchConstantsCheckBox.AutoSize = true;
+      this.matchConstantsCheckBox.Checked = true;
+      this.matchConstantsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
+      this.matchConstantsCheckBox.Location = new System.Drawing.Point(6, 19);
+      this.matchConstantsCheckBox.Name = "matchConstantsCheckBox";
+      this.matchConstantsCheckBox.Size = new System.Drawing.Size(102, 17);
+      this.matchConstantsCheckBox.TabIndex = 5;
+      this.matchConstantsCheckBox.Text = "Constant values";
+      this.matchConstantsCheckBox.UseVisualStyleBackColor = true;
+      this.matchConstantsCheckBox.CheckedChanged += new System.EventHandler(this.matchConstantsCheckBox_CheckedChanged);
+      // 
+      // matchVariableWeightsCheckBox
+      // 
+      this.matchVariableWeightsCheckBox.AutoSize = true;
+      this.matchVariableWeightsCheckBox.Checked = true;
+      this.matchVariableWeightsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
+      this.matchVariableWeightsCheckBox.Location = new System.Drawing.Point(114, 19);
+      this.matchVariableWeightsCheckBox.Name = "matchVariableWeightsCheckBox";
+      this.matchVariableWeightsCheckBox.Size = new System.Drawing.Size(103, 17);
+      this.matchVariableWeightsCheckBox.TabIndex = 6;
+      this.matchVariableWeightsCheckBox.Text = "Variable weights";
+      this.matchVariableWeightsCheckBox.UseVisualStyleBackColor = true;
+      this.matchVariableWeightsCheckBox.CheckedChanged += new System.EventHandler(this.matchVariableWeightsCheckBox_CheckedChanged);
       // 
       // matchVariableNamesCheckBox
@@ -144,5 +155,5 @@
       this.matchVariableNamesCheckBox.Checked = true;
       this.matchVariableNamesCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
-      this.matchVariableNamesCheckBox.Location = new System.Drawing.Point(436, 23);
+      this.matchVariableNamesCheckBox.Location = new System.Drawing.Point(223, 19);
       this.matchVariableNamesCheckBox.Name = "matchVariableNamesCheckBox";
       this.matchVariableNamesCheckBox.Size = new System.Drawing.Size(98, 17);
@@ -152,57 +163,61 @@
       this.matchVariableNamesCheckBox.CheckedChanged += new System.EventHandler(this.matchVariableNamesCheckBox_CheckedChanged);
       // 
-      // matchVariableWeightsCheckBox
-      // 
-      this.matchVariableWeightsCheckBox.AutoSize = true;
-      this.matchVariableWeightsCheckBox.Checked = true;
-      this.matchVariableWeightsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
-      this.matchVariableWeightsCheckBox.Location = new System.Drawing.Point(327, 23);
-      this.matchVariableWeightsCheckBox.Name = "matchVariableWeightsCheckBox";
-      this.matchVariableWeightsCheckBox.Size = new System.Drawing.Size(103, 17);
-      this.matchVariableWeightsCheckBox.TabIndex = 6;
-      this.matchVariableWeightsCheckBox.Text = "Variable weights";
-      this.matchVariableWeightsCheckBox.UseVisualStyleBackColor = true;
-      this.matchVariableWeightsCheckBox.CheckedChanged += new System.EventHandler(this.matchVariableWeightsCheckBox_CheckedChanged);
-      // 
-      // matchConstantsCheckBox
-      // 
-      this.matchConstantsCheckBox.AutoSize = true;
-      this.matchConstantsCheckBox.Checked = true;
-      this.matchConstantsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked;
-      this.matchConstantsCheckBox.Location = new System.Drawing.Point(219, 23);
-      this.matchConstantsCheckBox.Name = "matchConstantsCheckBox";
-      this.matchConstantsCheckBox.Size = new System.Drawing.Size(102, 17);
-      this.matchConstantsCheckBox.TabIndex = 5;
-      this.matchConstantsCheckBox.Text = "Constant values";
-      this.matchConstantsCheckBox.UseVisualStyleBackColor = true;
-      this.matchConstantsCheckBox.CheckedChanged += new System.EventHandler(this.matchConstantsCheckBox_CheckedChanged);
-      // 
-      // similarityLabel
-      // 
-      this.similarityLabel.AutoSize = true;
-      this.similarityLabel.Location = new System.Drawing.Point(105, 24);
-      this.similarityLabel.Name = "similarityLabel";
-      this.similarityLabel.Size = new System.Drawing.Size(108, 13);
-      this.similarityLabel.TabIndex = 3;
-      this.similarityLabel.Text = "Matching constraints:";
-      // 
-      // graphControlsPanel
-      // 
-      this.graphControlsPanel.Controls.Add(this.selectModeButton);
-      this.graphControlsPanel.Controls.Add(this.moveModeButton);
-      this.graphControlsPanel.Controls.Add(this.zoomModeButton);
-      this.graphControlsPanel.Location = new System.Drawing.Point(6, 14);
-      this.graphControlsPanel.Name = "graphControlsPanel";
-      this.graphControlsPanel.Size = new System.Drawing.Size(93, 30);
-      this.graphControlsPanel.TabIndex = 2;
+      // graphControlsGroupBox
+      // 
+      this.graphControlsGroupBox.Controls.Add(this.lockGenealogyCheckBox);
+      this.graphControlsGroupBox.Controls.Add(this.highlightAllButton);
+      this.graphControlsGroupBox.Controls.Add(this.simpleLineagesCheckBox);
+      this.graphControlsGroupBox.Controls.Add(this.selectModeButton);
+      this.graphControlsGroupBox.Controls.Add(this.moveModeButton);
+      this.graphControlsGroupBox.Controls.Add(this.zoomModeButton);
+      this.graphControlsGroupBox.Location = new System.Drawing.Point(1, -2);
+      this.graphControlsGroupBox.Name = "graphControlsGroupBox";
+      this.graphControlsGroupBox.Size = new System.Drawing.Size(202, 44);
+      this.graphControlsGroupBox.TabIndex = 11;
+      this.graphControlsGroupBox.TabStop = false;
+      this.graphControlsGroupBox.Text = "Graph controls";
+      // 
+      // lockGenealogyCheckBox
+      // 
+      this.lockGenealogyCheckBox.Appearance = System.Windows.Forms.Appearance.Button;
+      this.lockGenealogyCheckBox.Location = new System.Drawing.Point(156, 14);
+      this.lockGenealogyCheckBox.Name = "lockGenealogyCheckBox";
+      this.lockGenealogyCheckBox.Size = new System.Drawing.Size(24, 24);
+      this.lockGenealogyCheckBox.TabIndex = 17;
+      this.toolTip.SetToolTip(this.lockGenealogyCheckBox, "Lock genealogy");
+      this.lockGenealogyCheckBox.UseVisualStyleBackColor = true;
+      this.lockGenealogyCheckBox.CheckedChanged += new System.EventHandler(this.lockGenealogyCheckBox_CheckedChanged);
+      // 
+      // highlightAllButton
+      // 
+      this.highlightAllButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+      this.highlightAllButton.Location = new System.Drawing.Point(96, 14);
+      this.highlightAllButton.Name = "highlightAllButton";
+      this.highlightAllButton.Size = new System.Drawing.Size(24, 24);
+      this.highlightAllButton.TabIndex = 13;
+      this.toolTip.SetToolTip(this.highlightAllButton, "Fitness gradient");
+      this.highlightAllButton.UseVisualStyleBackColor = true;
+      this.highlightAllButton.Click += new System.EventHandler(this.highlightAllButton_Click);
+      // 
+      // simpleLineagesCheckBox
+      // 
+      this.simpleLineagesCheckBox.Appearance = System.Windows.Forms.Appearance.Button;
+      this.simpleLineagesCheckBox.Location = new System.Drawing.Point(126, 14);
+      this.simpleLineagesCheckBox.Name = "simpleLineagesCheckBox";
+      this.simpleLineagesCheckBox.Size = new System.Drawing.Size(24, 24);
+      this.simpleLineagesCheckBox.TabIndex = 12;
+      this.toolTip.SetToolTip(this.simpleLineagesCheckBox, "Simple lineages");
+      this.simpleLineagesCheckBox.UseVisualStyleBackColor = true;
+      this.simpleLineagesCheckBox.CheckedChanged += new System.EventHandler(this.simpleLineagesCheckBox_CheckedChanged);
       // 
       // selectModeButton
       // 
       this.selectModeButton.Appearance = System.Windows.Forms.Appearance.Button;
-      this.selectModeButton.Location = new System.Drawing.Point(63, 3);
+      this.selectModeButton.Location = new System.Drawing.Point(66, 14);
       this.selectModeButton.Name = "selectModeButton";
       this.selectModeButton.Size = new System.Drawing.Size(24, 24);
-      this.selectModeButton.TabIndex = 11;
+      this.selectModeButton.TabIndex = 16;
       this.selectModeButton.TabStop = true;
+      this.toolTip.SetToolTip(this.selectModeButton, "Select");
       this.selectModeButton.UseVisualStyleBackColor = true;
       this.selectModeButton.CheckedChanged += new System.EventHandler(this.selectModeButton_CheckedChanged);
@@ -211,9 +226,10 @@
       // 
       this.moveModeButton.Appearance = System.Windows.Forms.Appearance.Button;
-      this.moveModeButton.Location = new System.Drawing.Point(3, 3);
+      this.moveModeButton.Location = new System.Drawing.Point(6, 14);
       this.moveModeButton.Name = "moveModeButton";
       this.moveModeButton.Size = new System.Drawing.Size(24, 24);
-      this.moveModeButton.TabIndex = 9;
+      this.moveModeButton.TabIndex = 14;
       this.moveModeButton.TabStop = true;
+      this.toolTip.SetToolTip(this.moveModeButton, "Move");
       this.moveModeButton.UseVisualStyleBackColor = true;
       this.moveModeButton.CheckedChanged += new System.EventHandler(this.moveModeButton_CheckedChanged);
@@ -222,9 +238,10 @@
       // 
       this.zoomModeButton.Appearance = System.Windows.Forms.Appearance.Button;
-      this.zoomModeButton.Location = new System.Drawing.Point(33, 3);
+      this.zoomModeButton.Location = new System.Drawing.Point(36, 14);
       this.zoomModeButton.Name = "zoomModeButton";
       this.zoomModeButton.Size = new System.Drawing.Size(24, 24);
-      this.zoomModeButton.TabIndex = 10;
+      this.zoomModeButton.TabIndex = 15;
       this.zoomModeButton.TabStop = true;
+      this.toolTip.SetToolTip(this.zoomModeButton, "Zoom");
       this.zoomModeButton.UseVisualStyleBackColor = true;
       this.zoomModeButton.CheckedChanged += new System.EventHandler(this.zoomModeButton_CheckedChanged);
@@ -234,16 +251,16 @@
       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-      this.Controls.Add(this.mainTableLayout);
+      this.Controls.Add(this.splitContainer);
+      this.Controls.Add(this.topControlBox);
       this.Name = "GenealogyGraphView";
-      this.Size = new System.Drawing.Size(787, 584);
-      this.mainTableLayout.ResumeLayout(false);
+      this.Size = new System.Drawing.Size(1072, 778);
       this.splitContainer.Panel1.ResumeLayout(false);
       this.splitContainer.Panel2.ResumeLayout(false);
       ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
       this.splitContainer.ResumeLayout(false);
-      this.genealogyTableLayout.ResumeLayout(false);
       this.topControlBox.ResumeLayout(false);
-      this.topControlBox.PerformLayout();
-      this.graphControlsPanel.ResumeLayout(false);
+      this.groupBox1.ResumeLayout(false);
+      this.groupBox1.PerformLayout();
+      this.graphControlsGroupBox.ResumeLayout(false);
       this.ResumeLayout(false);
 
@@ -252,18 +269,21 @@
     #endregion
 
-    private System.Windows.Forms.TableLayoutPanel mainTableLayout;
     private System.Windows.Forms.SplitContainer splitContainer;
-    private System.Windows.Forms.GroupBox topControlBox;
-    private Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart symbolicExpressionTreeChart;
-    private System.Windows.Forms.TableLayoutPanel genealogyTableLayout;
+    private SymbolicExpressionTreeChart symbolicExpressionTreeChart;
+
     private GenealogyGraphChart genealogyGraphChart;
-    private System.Windows.Forms.Panel graphControlsPanel;
+    private System.Windows.Forms.ToolTip toolTip;
+    private System.Windows.Forms.Panel topControlBox;
+    private System.Windows.Forms.GroupBox groupBox1;
+    private System.Windows.Forms.CheckBox matchConstantsCheckBox;
+    private System.Windows.Forms.CheckBox matchVariableWeightsCheckBox;
+    private System.Windows.Forms.CheckBox matchVariableNamesCheckBox;
+    private System.Windows.Forms.GroupBox graphControlsGroupBox;
+    private System.Windows.Forms.Button highlightAllButton;
+    private System.Windows.Forms.CheckBox simpleLineagesCheckBox;
     private System.Windows.Forms.RadioButton selectModeButton;
     private System.Windows.Forms.RadioButton moveModeButton;
     private System.Windows.Forms.RadioButton zoomModeButton;
-    private System.Windows.Forms.Label similarityLabel;
-    private System.Windows.Forms.CheckBox matchVariableNamesCheckBox;
-    private System.Windows.Forms.CheckBox matchVariableWeightsCheckBox;
-    private System.Windows.Forms.CheckBox matchConstantsCheckBox;
+    private System.Windows.Forms.CheckBox lockGenealogyCheckBox;
 
   }
Index: /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphView.cs
===================================================================
--- /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphView.cs	(revision 9419)
+++ /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphView.cs	(revision 9420)
@@ -52,4 +52,8 @@
       this.zoomModeButton.Image = Common.Resources.VSImageLibrary.Zoom;
       this.selectModeButton.Image = Common.Resources.VSImageLibrary.Object;
+      this.highlightAllButton.Image = Common.Resources.VSImageLibrary.Gradient;
+      this.simpleLineagesCheckBox.Image = Common.Resources.VSImageLibrary.ArrowDown;
+      this.lockGenealogyCheckBox.Image = Common.Resources.VSImageLibrary.ProtectForm;
+
       comparer = new SymbolicExpressionTreeNodeSimilarityComparer {
         MatchConstantValues = true,
@@ -63,4 +67,6 @@
       genealogyGraphChart.GenealogyGraphNodeClicked -= graphChart_GenealogyGraphNodeClicked;
       symbolicExpressionTreeChart.SymbolicExpressionTreeNodeClicked -= treeChart_SymbolicExpressionTreeNodeClicked;
+      symbolicExpressionTreeChart.SymbolicExpressionTreeNodeDoubleClicked -= treeChart_SymbolicExpressionTreeNodeDoubleClicked;
+      Content.GraphUpdated -= genealogyGraphUpdated;
       base.DeregisterContentEvents();
     }
@@ -72,4 +78,5 @@
       symbolicExpressionTreeChart.SymbolicExpressionTreeNodeClicked += treeChart_SymbolicExpressionTreeNodeClicked;
       symbolicExpressionTreeChart.SymbolicExpressionTreeNodeDoubleClicked += treeChart_SymbolicExpressionTreeNodeDoubleClicked;
+      Content.GraphUpdated += genealogyGraphUpdated;
     }
 
@@ -82,6 +89,6 @@
       else {
         genealogyGraphChart.Graph = Content;
-        var best = Content.Nodes.OrderByDescending(x => x.Quality).First();
-        symbolicExpressionTreeChart.Tree = best.SymbolicExpressionTree;
+        //        var best = Content.Nodes.OrderByDescending(x => x.Quality).First();
+        //        symbolicExpressionTreeChart.Tree = best.SymbolicExpressionTree;
       }
     }
@@ -105,5 +112,5 @@
       symbolicExpressionTreeChart.Tree = genealogyGraphNode.SymbolicExpressionTree;
       if (genealogyGraphNode.InEdges == null) return;
-      var arc = genealogyGraphNode.InEdges.First(x => x.Source != x.Target);
+      var arc = genealogyGraphNode.InEdges.Last(x => x.Source != x.Target);
       if (arc == null || arc.Data == null) return;
       var fragment = (IFragment)arc.Data;
@@ -113,5 +120,5 @@
         visualSymbExprTreeNode.LineColor = Color.OrangeRed;
       }
-      symbolicExpressionTreeChart.Repaint(); // pain orange nodes
+      symbolicExpressionTreeChart.Repaint();
     }
 
@@ -129,4 +136,8 @@
       var btn = (RadioButton)sender;
       if (btn.Checked) { genealogyGraphChart.Chart.Mode = ChartMode.Select; }
+    }
+
+    private void genealogyGraphUpdated(object sender, EventArgs args) {
+      genealogyGraphChart.Graph = Content;
     }
 
@@ -159,4 +170,7 @@
               var selectedClone = clonedNodes[selectedNode];
               var parent = selectedClone.Parent;
+              if (parent == null) break;
+              int index = parent.IndexOfSubtree(selectedClone);
+              if (index == -1) break;
               parent.RemoveSubtree(parent.IndexOfSubtree(selectedClone));
               foreach (var node in selectedNode.IterateNodesPrefix()) {
@@ -179,9 +193,20 @@
       var fragment = new Fragment(clonedNodes[selectedVisualSymbExprTreeNode.SymbolicExpressionTreeNode]);
       var fragmentLength = fragment.Length;
+      // highlight nodes
       genealogyGraphChart.HighlightNodes(from node in genealogyGraphChart.Graph.Nodes
                                          let tree = node.SymbolicExpressionTree
                                          where tree.Length >= fragmentLength
                                          where tree.Root.ContainsFragment(fragment, comparer)
-                                         select tree, Color.DodgerBlue);
+                                         select tree);
+      // highlight edges that contain a matching fragment
+      var fragmentSimilarityComparer = new SymbolicExpressionTreeFragmentSimilarityComparer {
+        SimilarityComparer = comparer
+      };
+      var matchingEdges = genealogyGraphChart.Graph.Nodes.Where(n => n.InEdges != null)
+                           .SelectMany(n => n.InEdges).Where(edge => edge.Data != null && ((IFragment)edge.Data).Root != null)
+                           .Where(edge => fragmentSimilarityComparer.Equals(fragment, (IFragment)edge.Data));
+      genealogyGraphChart.HighlightArcs(matchingEdges, Color.DodgerBlue);
+
+
       genealogyGraphChart.Chart.UpdateEnabled = true;
       genealogyGraphChart.Chart.EnforceUpdate();
@@ -191,4 +216,5 @@
     }
     #endregion
+
     private void matchConstantsCheckBox_CheckedChanged(object sender, EventArgs e) {
       comparer.MatchConstantValues = matchConstantsCheckBox.Checked;
@@ -208,4 +234,17 @@
         MatchNodesAndRepaint();
     }
+
+    private void simpleLineagesCheckBox_CheckedChanged(object sender, EventArgs e) {
+      genealogyGraphChart.SimpleLineages = simpleLineagesCheckBox.Checked;
+    }
+
+    private void highlightAllButton_Click(object sender, EventArgs e) {
+      symbolicExpressionTreeChart.Repaint();
+      genealogyGraphChart.HighlightAll();
+    }
+
+    private void lockGenealogyCheckBox_CheckedChanged(object sender, EventArgs e) {
+      genealogyGraphChart.LockGenealogy = lockGenealogyCheckBox.Checked;
+    }
   }
 }
Index: /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/HeuristicLab.EvolutionaryTracking.Views-3.4.csproj
===================================================================
--- /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/HeuristicLab.EvolutionaryTracking.Views-3.4.csproj	(revision 9419)
+++ /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/HeuristicLab.EvolutionaryTracking.Views-3.4.csproj	(revision 9420)
@@ -18,5 +18,5 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
-    <OutputPath>..\..\..\..\Trunk\sources\bin\</OutputPath>
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
@@ -39,5 +39,5 @@
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
     <DebugSymbols>true</DebugSymbols>
-    <OutputPath>bin\x64\Debug\</OutputPath>
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <DebugType>full</DebugType>
@@ -58,40 +58,48 @@
     <Reference Include="HeuristicLab.Common-3.3">
       <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
-    </Reference>
-    <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <Private>False</Private>
+    </Reference>
     <Reference Include="HeuristicLab.Core-3.3">
       <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
+      <Private>False</Private>
     </Reference>
     <Reference Include="HeuristicLab.Core.Views-3.3">
       <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Core.Views-3.3.dll</HintPath>
-    </Reference>
-    <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.dll</HintPath>
+      <Private>False</Private>
     </Reference>
     <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4.dll</HintPath>
+      <Private>False</Private>
     </Reference>
     <Reference Include="HeuristicLab.MainForm-3.3">
       <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.MainForm-3.3.dll</HintPath>
+      <Private>False</Private>
     </Reference>
     <Reference Include="HeuristicLab.MainForm.WindowsForms-3.3">
       <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath>
+      <Private>False</Private>
     </Reference>
     <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
       <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+      <Private>False</Private>
     </Reference>
     <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath>
+      <Private>False</Private>
     </Reference>
     <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.dll</HintPath>
+      <Private>False</Private>
     </Reference>
     <Reference Include="HeuristicLab.Visualization-3.3, Version=3.3.0.5170, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Visualization-3.3.dll</HintPath>
+      <Private>False</Private>
     </Reference>
     <Reference Include="System" />
@@ -112,5 +120,7 @@
       <DependentUpon>FrequentFragmentsDialog.cs</DependentUpon>
     </Compile>
-    <Compile Include="GenealogyGraphChart.cs" />
+    <Compile Include="GenealogyGraphChart.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
     <Compile Include="GenealogyGraphChart.Designer.cs">
       <DependentUpon>GenealogyGraphChart.cs</DependentUpon>
@@ -143,13 +153,21 @@
     <Compile Include="VisualGenealogyGraphArc.cs" />
     <Compile Include="VisualGenealogyGraphNode.cs" />
-  </ItemGroup>
-  <ItemGroup>
+    <Compile Include="VisualGenealogyGraphTextLabel.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.4\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj">
+      <Project>{06d4a186-9319-48a0-bade-a2058d462eea}</Project>
+      <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4</Name>
+      <Private>False</Private>
+    </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.EvolutionaryTracking\3.4\HeuristicLab.EvolutionaryTracking-3.4.csproj">
       <Project>{1f75cea3-464f-4a6f-b2f0-04b9841ebc16}</Project>
       <Name>HeuristicLab.EvolutionaryTracking-3.4</Name>
+      <Private>False</Private>
     </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj">
       <Project>{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}</Project>
       <Name>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</Name>
+      <Private>False</Private>
     </ProjectReference>
   </ItemGroup>
@@ -160,4 +178,7 @@
     <EmbeddedResource Include="FrequentFragmentsDialog.resx">
       <DependentUpon>FrequentFragmentsDialog.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="GenealogyGraphChart.resx">
+      <DependentUpon>GenealogyGraphChart.cs</DependentUpon>
     </EmbeddedResource>
     <EmbeddedResource Include="GenealogyGraphDialog.resx">
Index: /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/LineageExplorerView.Designer.cs
===================================================================
--- /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/LineageExplorerView.Designer.cs	(revision 9419)
+++ /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/LineageExplorerView.Designer.cs	(revision 9420)
@@ -25,27 +25,75 @@
     private void InitializeComponent() {
       this.components = new System.ComponentModel.Container();
+      this.tabControl1 = new System.Windows.Forms.TabControl();
+      this.tabPage1 = new System.Windows.Forms.TabPage();
+      this.tabPage2 = new System.Windows.Forms.TabPage();
       this.panel1 = new System.Windows.Forms.Panel();
       this.qualityImprovementTreeView = new System.Windows.Forms.TreeView();
       this.symbolicExpressionTreeChart = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart();
       this.scopeListTreeView = new System.Windows.Forms.TreeView();
+      this.calculateFragmentFrequencyButton = new System.Windows.Forms.Button();
+      this.showGenealogyButton = new System.Windows.Forms.Button();
+      this.button1 = new System.Windows.Forms.Button();
       this.panel2 = new System.Windows.Forms.Panel();
-      this.showGenealogyButton = new System.Windows.Forms.Button();
-      this.calculateFragmentFrequencyButton = new System.Windows.Forms.Button();
+      this.panel3 = new System.Windows.Forms.Panel();
+      this.showFrequentFragmentsButton = new System.Windows.Forms.Button();
+      this.textBox2 = new System.Windows.Forms.TextBox();
+      this.thresholdLabel = new System.Windows.Forms.Label();
+      this.bestNTextBox = new System.Windows.Forms.TextBox();
+      this.consideredTrees = new System.Windows.Forms.Label();
+      this.panel4 = new System.Windows.Forms.Panel();
+      this.tabControl1.SuspendLayout();
+      this.tabPage1.SuspendLayout();
+      this.tabPage2.SuspendLayout();
       this.panel1.SuspendLayout();
       this.panel2.SuspendLayout();
+      this.panel3.SuspendLayout();
       this.SuspendLayout();
       // 
+      // tabControl1
+      // 
+      this.tabControl1.Controls.Add(this.tabPage1);
+      this.tabControl1.Controls.Add(this.tabPage2);
+      this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.tabControl1.Location = new System.Drawing.Point(0, 0);
+      this.tabControl1.Name = "tabControl1";
+      this.tabControl1.SelectedIndex = 0;
+      this.tabControl1.Size = new System.Drawing.Size(1016, 669);
+      this.tabControl1.TabIndex = 2;
+      // 
+      // tabPage1
+      // 
+      this.tabPage1.Controls.Add(this.panel1);
+      this.tabPage1.Controls.Add(this.panel2);
+      this.tabPage1.Location = new System.Drawing.Point(4, 22);
+      this.tabPage1.Name = "tabPage1";
+      this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
+      this.tabPage1.Size = new System.Drawing.Size(1008, 643);
+      this.tabPage1.TabIndex = 0;
+      this.tabPage1.Text = "Lineages";
+      this.tabPage1.UseVisualStyleBackColor = true;
+      // 
+      // tabPage2
+      // 
+      this.tabPage2.Controls.Add(this.panel4);
+      this.tabPage2.Controls.Add(this.panel3);
+      this.tabPage2.Location = new System.Drawing.Point(4, 22);
+      this.tabPage2.Name = "tabPage2";
+      this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
+      this.tabPage2.Size = new System.Drawing.Size(1008, 643);
+      this.tabPage2.TabIndex = 1;
+      this.tabPage2.Text = "Fragments";
+      this.tabPage2.UseVisualStyleBackColor = true;
+      // 
       // panel1
       // 
-      this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
-            | System.Windows.Forms.AnchorStyles.Left) 
-            | System.Windows.Forms.AnchorStyles.Right)));
       this.panel1.Controls.Add(this.qualityImprovementTreeView);
       this.panel1.Controls.Add(this.symbolicExpressionTreeChart);
       this.panel1.Controls.Add(this.scopeListTreeView);
-      this.panel1.Location = new System.Drawing.Point(3, 42);
+      this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.panel1.Location = new System.Drawing.Point(3, 36);
       this.panel1.Name = "panel1";
-      this.panel1.Size = new System.Drawing.Size(503, 624);
-      this.panel1.TabIndex = 0;
+      this.panel1.Size = new System.Drawing.Size(1002, 604);
+      this.panel1.TabIndex = 1;
       // 
       // qualityImprovementTreeView
@@ -54,7 +102,7 @@
             | System.Windows.Forms.AnchorStyles.Right)));
       this.qualityImprovementTreeView.HideSelection = false;
-      this.qualityImprovementTreeView.Location = new System.Drawing.Point(388, 0);
+      this.qualityImprovementTreeView.Location = new System.Drawing.Point(887, 0);
       this.qualityImprovementTreeView.Name = "qualityImprovementTreeView";
-      this.qualityImprovementTreeView.Size = new System.Drawing.Size(115, 624);
+      this.qualityImprovementTreeView.Size = new System.Drawing.Size(115, 604);
       this.qualityImprovementTreeView.TabIndex = 10;
       this.qualityImprovementTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.qualityImprovementTreeView_AfterSelect);
@@ -69,5 +117,5 @@
       this.symbolicExpressionTreeChart.Location = new System.Drawing.Point(155, 0);
       this.symbolicExpressionTreeChart.Name = "symbolicExpressionTreeChart";
-      this.symbolicExpressionTreeChart.Size = new System.Drawing.Size(227, 624);
+      this.symbolicExpressionTreeChart.Size = new System.Drawing.Size(726, 604);
       this.symbolicExpressionTreeChart.Spacing = 5;
       this.symbolicExpressionTreeChart.SuspendRepaint = false;
@@ -75,5 +123,4 @@
       this.symbolicExpressionTreeChart.TextFont = new System.Drawing.Font("Times New Roman", 8F);
       this.symbolicExpressionTreeChart.Tree = null;
-      this.symbolicExpressionTreeChart.SymbolicExpressionTreeNodeClicked += new System.Windows.Forms.MouseEventHandler(this.symbolicExpressionTreeChart_SymbolicExpressionTreeNodeClicked);
       // 
       // scopeListTreeView
@@ -83,17 +130,18 @@
       this.scopeListTreeView.Location = new System.Drawing.Point(0, 0);
       this.scopeListTreeView.Name = "scopeListTreeView";
-      this.scopeListTreeView.Size = new System.Drawing.Size(155, 624);
+      this.scopeListTreeView.Size = new System.Drawing.Size(155, 604);
       this.scopeListTreeView.TabIndex = 11;
       this.scopeListTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.scopeListTreeView_AfterSelect);
       // 
-      // panel2
-      // 
-      this.panel2.Controls.Add(this.showGenealogyButton);
-      this.panel2.Controls.Add(this.calculateFragmentFrequencyButton);
-      this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
-      this.panel2.Location = new System.Drawing.Point(0, 0);
-      this.panel2.Name = "panel2";
-      this.panel2.Size = new System.Drawing.Size(509, 33);
-      this.panel2.TabIndex = 1;
+      // calculateFragmentFrequencyButton
+      // 
+      this.calculateFragmentFrequencyButton.AutoSize = true;
+      this.calculateFragmentFrequencyButton.Location = new System.Drawing.Point(4, 4);
+      this.calculateFragmentFrequencyButton.Name = "calculateFragmentFrequencyButton";
+      this.calculateFragmentFrequencyButton.Size = new System.Drawing.Size(119, 23);
+      this.calculateFragmentFrequencyButton.TabIndex = 0;
+      this.calculateFragmentFrequencyButton.Text = "Fragment frequencies";
+      this.calculateFragmentFrequencyButton.UseVisualStyleBackColor = true;
+      this.calculateFragmentFrequencyButton.Click += new System.EventHandler(this.calculateFragmentFrequencyButton_Click);
       // 
       // showGenealogyButton
@@ -108,14 +156,91 @@
       this.showGenealogyButton.Click += new System.EventHandler(this.showGenealogyButton_Click);
       // 
-      // calculateFragmentFrequencyButton
-      // 
-      this.calculateFragmentFrequencyButton.AutoSize = true;
-      this.calculateFragmentFrequencyButton.Location = new System.Drawing.Point(4, 4);
-      this.calculateFragmentFrequencyButton.Name = "calculateFragmentFrequencyButton";
-      this.calculateFragmentFrequencyButton.Size = new System.Drawing.Size(119, 23);
-      this.calculateFragmentFrequencyButton.TabIndex = 0;
-      this.calculateFragmentFrequencyButton.Text = "Fragment frequencies";
-      this.calculateFragmentFrequencyButton.UseVisualStyleBackColor = true;
-      this.calculateFragmentFrequencyButton.Click += new System.EventHandler(this.calculateFragmentFrequencyButton_Click);
+      // button1
+      // 
+      this.button1.AutoSize = true;
+      this.button1.Location = new System.Drawing.Point(239, 4);
+      this.button1.Name = "button1";
+      this.button1.Size = new System.Drawing.Size(135, 23);
+      this.button1.TabIndex = 2;
+      this.button1.Text = "Show frequent fragments";
+      this.button1.UseVisualStyleBackColor = true;
+      this.button1.Click += new System.EventHandler(this.button1_Click);
+      // 
+      // panel2
+      // 
+      this.panel2.Controls.Add(this.button1);
+      this.panel2.Controls.Add(this.showGenealogyButton);
+      this.panel2.Controls.Add(this.calculateFragmentFrequencyButton);
+      this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
+      this.panel2.Location = new System.Drawing.Point(3, 3);
+      this.panel2.Name = "panel2";
+      this.panel2.Size = new System.Drawing.Size(1002, 33);
+      this.panel2.TabIndex = 1;
+      // 
+      // panel3
+      // 
+      this.panel3.Controls.Add(this.showFrequentFragmentsButton);
+      this.panel3.Controls.Add(this.textBox2);
+      this.panel3.Controls.Add(this.thresholdLabel);
+      this.panel3.Controls.Add(this.bestNTextBox);
+      this.panel3.Controls.Add(this.consideredTrees);
+      this.panel3.Dock = System.Windows.Forms.DockStyle.Top;
+      this.panel3.Location = new System.Drawing.Point(3, 3);
+      this.panel3.Name = "panel3";
+      this.panel3.Size = new System.Drawing.Size(1002, 30);
+      this.panel3.TabIndex = 0;
+      // 
+      // showFrequentFragmentsButton
+      // 
+      this.showFrequentFragmentsButton.AutoSize = true;
+      this.showFrequentFragmentsButton.Location = new System.Drawing.Point(218, 3);
+      this.showFrequentFragmentsButton.Name = "showFrequentFragmentsButton";
+      this.showFrequentFragmentsButton.Size = new System.Drawing.Size(135, 23);
+      this.showFrequentFragmentsButton.TabIndex = 19;
+      this.showFrequentFragmentsButton.Text = "Show frequent fragments";
+      this.showFrequentFragmentsButton.UseVisualStyleBackColor = true;
+      this.showFrequentFragmentsButton.Click += new System.EventHandler(this.showFrequentFragmentsButton_Click);
+      // 
+      // textBox2
+      // 
+      this.textBox2.Location = new System.Drawing.Point(173, 5);
+      this.textBox2.Name = "textBox2";
+      this.textBox2.Size = new System.Drawing.Size(39, 20);
+      this.textBox2.TabIndex = 18;
+      this.textBox2.Text = "0.2";
+      // 
+      // thresholdLabel
+      // 
+      this.thresholdLabel.AutoSize = true;
+      this.thresholdLabel.Location = new System.Drawing.Point(113, 9);
+      this.thresholdLabel.Name = "thresholdLabel";
+      this.thresholdLabel.Size = new System.Drawing.Size(54, 13);
+      this.thresholdLabel.TabIndex = 17;
+      this.thresholdLabel.Text = "Threshold";
+      // 
+      // bestNTextBox
+      // 
+      this.bestNTextBox.Location = new System.Drawing.Point(68, 6);
+      this.bestNTextBox.Name = "bestNTextBox";
+      this.bestNTextBox.Size = new System.Drawing.Size(39, 20);
+      this.bestNTextBox.TabIndex = 16;
+      this.bestNTextBox.Text = "10";
+      // 
+      // consideredTrees
+      // 
+      this.consideredTrees.AutoSize = true;
+      this.consideredTrees.Location = new System.Drawing.Point(3, 9);
+      this.consideredTrees.Name = "consideredTrees";
+      this.consideredTrees.Size = new System.Drawing.Size(63, 13);
+      this.consideredTrees.TabIndex = 15;
+      this.consideredTrees.Text = "Best n trees";
+      // 
+      // panel4
+      // 
+      this.panel4.Dock = System.Windows.Forms.DockStyle.Fill;
+      this.panel4.Location = new System.Drawing.Point(3, 33);
+      this.panel4.Name = "panel4";
+      this.panel4.Size = new System.Drawing.Size(1002, 607);
+      this.panel4.TabIndex = 1;
       // 
       // LineageExplorerView
@@ -123,11 +248,15 @@
       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-      this.Controls.Add(this.panel2);
-      this.Controls.Add(this.panel1);
+      this.Controls.Add(this.tabControl1);
       this.Name = "LineageExplorerView";
-      this.Size = new System.Drawing.Size(509, 669);
+      this.Size = new System.Drawing.Size(1016, 669);
+      this.tabControl1.ResumeLayout(false);
+      this.tabPage1.ResumeLayout(false);
+      this.tabPage2.ResumeLayout(false);
       this.panel1.ResumeLayout(false);
       this.panel2.ResumeLayout(false);
       this.panel2.PerformLayout();
+      this.panel3.ResumeLayout(false);
+      this.panel3.PerformLayout();
       this.ResumeLayout(false);
 
@@ -136,11 +265,23 @@
     #endregion
 
+    private System.Windows.Forms.TabControl tabControl1;
+    private System.Windows.Forms.TabPage tabPage1;
     private System.Windows.Forms.Panel panel1;
-    private System.Windows.Forms.Panel panel2;
-    private System.Windows.Forms.Button calculateFragmentFrequencyButton;
     private System.Windows.Forms.TreeView qualityImprovementTreeView;
     private Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart symbolicExpressionTreeChart;
     private System.Windows.Forms.TreeView scopeListTreeView;
+    private System.Windows.Forms.TabPage tabPage2;
+    private System.Windows.Forms.Panel panel2;
+    private System.Windows.Forms.Button button1;
     private System.Windows.Forms.Button showGenealogyButton;
+    private System.Windows.Forms.Button calculateFragmentFrequencyButton;
+    private System.Windows.Forms.Panel panel3;
+    private System.Windows.Forms.Button showFrequentFragmentsButton;
+    private System.Windows.Forms.TextBox textBox2;
+    private System.Windows.Forms.Label thresholdLabel;
+    private System.Windows.Forms.TextBox bestNTextBox;
+    private System.Windows.Forms.Label consideredTrees;
+    private System.Windows.Forms.Panel panel4;
+
 
 
Index: /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/LineageExplorerView.cs
===================================================================
--- /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/LineageExplorerView.cs	(revision 9419)
+++ /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/LineageExplorerView.cs	(revision 9420)
@@ -7,4 +7,5 @@
 using HeuristicLab.Core.Views;
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
 using HeuristicLab.MainForm;
 using HeuristicLab.Problems.DataAnalysis.Symbolic;
@@ -17,4 +18,6 @@
     private List<SymbolicExpressionGenealogyGraphNode> lineage;
 
+    private Dictionary<ISymbolicExpressionTree, Dictionary<ISymbolicExpressionTreeNode, double>> fragmentFrequencies;
+
     public new LineageExplorer Content {
       get { return (LineageExplorer)base.Content; }
@@ -66,7 +69,27 @@
       var treeNode = scopeListTreeView.SelectedNode;
       var symbExprTree = treeMap[treeNode];
+
+      fragmentFrequencies = fragmentFrequencies ?? new Dictionary<ISymbolicExpressionTree, Dictionary<ISymbolicExpressionTreeNode, double>>();
+
+      if (fragmentFrequencies.ContainsKey(symbExprTree) && false) {
+        // colorize tree nodes according to fragment frequencies
+        symbolicExpressionTreeChart.SuspendRepaint = true;
+        var frequencies = fragmentFrequencies[symbExprTree];
+
+        foreach (var node in symbExprTree.IterateNodesBreadth()) {
+          double freq = frequencies[node];
+          int index = (int)Math.Floor(freq * ColorGradient.Colors.Count / scopeListTreeView.GetNodeCount(false));
+          if (index == ColorGradient.Colors.Count) index--;
+          var color = ColorGradient.Colors[index];
+          var visualNode = symbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNode(node);
+          visualNode.FillColor = Color.FromArgb(200, color);
+        }
+        symbolicExpressionTreeChart.SuspendRepaint = false;
+        symbolicExpressionTreeChart.Repaint();
+      }
+      // highlight crossover fragment
       HighlightFragment(symbExprTree);
 
-      var graphNode = Content.GenealogyGraph.GetGraphNodes(symbExprTree).First();
+      var graphNode = Content.GenealogyGraph.GetGraphNodes(symbExprTree).Last();
       lineage = lineage ?? new List<SymbolicExpressionGenealogyGraphNode>();
       lineage.Clear();
@@ -78,5 +101,5 @@
         lineage.Add(gn);
       }
-      lineage.Reverse(); // incresing order by generation
+      lineage.Reverse(); // increasing order by generation
 
       // update the righthand side tree view 
@@ -108,5 +131,5 @@
         return;
       }
-      var fragment = (IFragment)graphNode.InEdges[0].Data;
+      var fragment = graphNode.InEdges.Count == 1 ? (IFragment)graphNode.InEdges[0].Data : (IFragment)graphNode.InEdges[1].Data;
       if (fragment.Root == null) {
         symbolicExpressionTreeChart.SuspendRepaint = false;
@@ -130,7 +153,7 @@
       // the individual can occur multiple times in the graph if it is(was) elite. we take the first occurence.
       var graphNode = Content.GenealogyGraph.GetGraphNodes(symbolicExpressionTreeChart.Tree).First();
+      var trees = Content.GenealogyGraph.Nodes.Where(x => x.Rank.IsAlmost(graphNode.Rank)).Select(x => x.SymbolicExpressionTree).ToList();
+
       var fragments = graphNode.SymbolicExpressionTree.IterateNodesBreadth().Select(n => new Fragment(n));
-      var trees = Content.Trees.Select(t => t.Item1).ToList();
-      var hashset = new HashSet<ISymbolicExpressionTree>();
 
       var similarityComparer = new SymbolicExpressionTreeNodeSimilarityComparer {
@@ -140,18 +163,34 @@
       };
 
+      var canonicalSorter = new SymbolicExpressionTreeCanonicalSorter();
+
+      fragmentFrequencies = fragmentFrequencies ?? new Dictionary<ISymbolicExpressionTree, Dictionary<ISymbolicExpressionTreeNode, double>>();
+
+      if (!fragmentFrequencies.ContainsKey(graphNode.SymbolicExpressionTree)) {
+        fragmentFrequencies[graphNode.SymbolicExpressionTree] = new Dictionary<ISymbolicExpressionTreeNode, double>();
+      }
+
+      fragmentFrequencies[graphNode.SymbolicExpressionTree].Clear();
+
       symbolicExpressionTreeChart.SuspendRepaint = true;
       foreach (var f in fragments) {
         double freq = 0;
+
         foreach (var t in trees) {
           if (t.Root.ContainsFragment(f, similarityComparer)) ++freq;
-          int index = (int)Math.Floor(freq * ColorGradient.Colors.Count / trees.Count);
-          if (index == ColorGradient.Colors.Count) index--;
-          var color = ColorGradient.Colors[index];
-          foreach (var node in f.Root.IterateNodesBreadth()) {
-            var visualNode = symbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNode(node);
-            visualNode.FillColor = Color.FromArgb(200, color);
-          }
-        }
-      }
+        }
+
+        fragmentFrequencies[graphNode.SymbolicExpressionTree].Add(f.Root, freq);
+
+        // colorize tree nodes according to fragment frequencies
+        int index = (int)Math.Floor(freq * ColorGradient.Colors.Count / trees.Count);
+        if (index == ColorGradient.Colors.Count) index--;
+        var color = ColorGradient.Colors[index];
+        foreach (var node in f.Root.IterateNodesBreadth()) {
+          var visualNode = symbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNode(node);
+          visualNode.FillColor = Color.FromArgb(200, color);
+        }
+      }
+
       symbolicExpressionTreeChart.SuspendRepaint = false;
       symbolicExpressionTreeChart.Repaint();
@@ -172,4 +211,61 @@
       }
       using (var dialog = new GenealogyGraphDialog { Graph = graph }) {
+        dialog.ShowDialog(this);
+      }
+    }
+
+    private void button1_Click(object sender, EventArgs e) {
+      using (var dialog = new FrequentFragmentsDialog()) {
+        var panel = new Panel { Dock = DockStyle.Left, Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Bottom };
+
+        panel.Controls.Add(new SymbolicExpressionTreeChart() { Tree = treeMap.Values.First() });
+        panel.Controls.Add(new Label { Text = "Fragment frequency." });
+
+        dialog.fragmentsPanel.Controls.Add(panel);
+
+        dialog.ShowDialog(this);
+      }
+    }
+
+    private void showFrequentFragmentsButton_Click(object sender, EventArgs e) {
+      int bestN;
+      bool success = int.TryParse(bestNTextBox.Text, out bestN);
+      if (!success) bestN = 10;
+      var tuples = Content.Trees.Select(t => new { Tree = t.Item1, Quality = t.Item2 }).OrderByDescending(x => x.Quality).ToList();
+      var bestTrees = tuples.Take(bestN).Select(x => x.Tree).ToList();
+
+      var similarityComparer = new SymbolicExpressionTreeNodeSimilarityComparer {
+        MatchConstantValues = false,
+        MatchVariableNames = true,
+        MatchVariableWeights = false
+      };
+
+      var fragments = bestTrees.SelectMany(t => t.IterateNodesBreadth()).Where(n => n.GetLength() >= 3).Distinct(similarityComparer).Select(n => new Fragment(n));
+
+      double bestNQuality = tuples.Take(bestN).Sum(x => x.Quality); // average quality of best N individuals in the population
+
+      using (var dialog = new FrequentFragmentsDialog()) {
+        foreach (var fragment in fragments.Take(20)) {
+          double avgQuality = bestNQuality;
+          double frequency = bestN;
+          foreach (var t in tuples.Skip(bestN)) {
+            var tree = t.Tree;
+            if (tree.Root.ContainsFragment(fragment, similarityComparer)) {
+              avgQuality += t.Quality;
+              frequency++;
+            }
+          }
+          if (frequency > 0.2) {
+            var panel = new Panel {
+              Dock = DockStyle.Left,
+              Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Bottom
+            };
+
+            panel.Controls.Add(new SymbolicExpressionTreeChart() { Tree = treeMap.Values.First() });
+            panel.Controls.Add(new Label { Text = "Fragment frequency." });
+
+            dialog.fragmentsPanel.Controls.Add(panel);
+          }
+        }
         dialog.ShowDialog(this);
       }
Index: /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/VisualGenealogyGraphNode.cs
===================================================================
--- /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/VisualGenealogyGraphNode.cs	(revision 9419)
+++ /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/VisualGenealogyGraphNode.cs	(revision 9420)
@@ -38,4 +38,9 @@
       get { return outgoingArcs; }
       set { outgoingArcs = value; }
+    }
+
+    public float LineWidth {
+      get { return Pen.Width; }
+      set { Pen.Width = value; }
     }
 
Index: /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/VisualGenealogyGraphTextLabel.cs
===================================================================
--- /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/VisualGenealogyGraphTextLabel.cs	(revision 9420)
+++ /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/VisualGenealogyGraphTextLabel.cs	(revision 9420)
@@ -0,0 +1,47 @@
+﻿using System;
+using System.Drawing;
+using HeuristicLab.Visualization;
+using Rectangle = HeuristicLab.Visualization.Rectangle;
+
+namespace HeuristicLab.EvolutionaryTracking.Views {
+  public class VisualGenealogyGraphTextLabel : Rectangle {
+    private string text;
+    public string Text { get { return text; } set { text = value; } }
+
+    private Font font;
+    public Font Font { get { return font; } set { font = value; } }
+
+    private Brush brush;
+    public Brush Brush { get { return brush; } set { brush = value; } }
+
+    public VisualGenealogyGraphTextLabel(IChart chart, PointD lowerLeft, PointD upperRight)
+      : base(chart, lowerLeft, upperRight) {
+    }
+    public VisualGenealogyGraphTextLabel(IChart chart, double x1, double y1, double x2, double y2)
+      : this(chart, new PointD(x1, y1), new PointD(x2, y2)) {
+    }
+    public VisualGenealogyGraphTextLabel(IChart chart, PointD lowerLeft, PointD upperRight, Pen pen, Brush brush)
+      : base(chart, lowerLeft, upperRight, pen, brush) {
+    }
+    public VisualGenealogyGraphTextLabel(IChart chart, double x1, double y1, double x2, double y2, Pen pen, Brush brush)
+      : this(chart, new PointD(x1, y1), new PointD(x2, y2), pen, brush) {
+    }
+
+    public override void Draw(Graphics graphics) {
+      Point p = Chart.TransformWorldToPixel(new PointD(LowerLeft.X, LowerLeft.Y + Size.Height));
+      Size s = Chart.TransformWorldToPixel(Size);
+
+      float fontSize = s.Height;
+      font = new Font(font.Name, fontSize, Font.Style, GraphicsUnit.Pixel);
+      graphics.DrawString(text, font, brush, p.X, p.Y);
+    }
+
+    public EventHandler Update;
+    protected virtual void OnUpdate() {
+      if ((UpdateEnabled) && (Update != null)) {
+        Update(this, new EventArgs());
+      }
+      base.OnUpdate();
+    }
+  }
+}
