Index: branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeNode.cs
===================================================================
--- branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeNode.cs	(revision 12225)
+++ branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeNode.cs	(revision 12231)
@@ -34,4 +34,6 @@
     int GetBranchLevel(ISymbolicExpressionTreeNode child);
 
+    double NodeWeight { get; set; }
+
     IEnumerable<ISymbolicExpressionTreeNode> IterateNodesBreadth();
     IEnumerable<ISymbolicExpressionTreeNode> IterateNodesPostfix();
Index: branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeNode.cs
===================================================================
--- branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeNode.cs	(revision 12225)
+++ branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeNode.cs	(revision 12231)
@@ -50,4 +50,7 @@
     }
 
+    [Storable]
+    public double NodeWeight { get; set; }
+
     [StorableConstructor]
     protected SymbolicExpressionTreeNode(bool deserializing) { }
@@ -57,4 +60,5 @@
       length = original.length;
       depth = original.depth;
+      NodeWeight = original.NodeWeight;
       if (original.subtrees != null) {
         subtrees = new List<ISymbolicExpressionTreeNode>(original.subtrees.Count);
Index: branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/SymbolicDataAnalysisGenealogyGraphView.cs
===================================================================
--- branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/SymbolicDataAnalysisGenealogyGraphView.cs	(revision 12225)
+++ branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/SymbolicDataAnalysisGenealogyGraphView.cs	(revision 12231)
@@ -100,29 +100,30 @@
         var fragment = data as IFragment<ISymbolicExpressionTreeNode>;
         var td = data as TraceData;
-        //        double max = Content.Vertices.SelectMany(x => x.Data.IterateNodesPrefix()).Max(x => x.NodeWeight);
-
+        //        double max = Content.Vertices.Max(x => x.Data.IterateNodesPrefix().Max(y => y.NodeWeight));
+
+        // calculate max only in the current generation
+        double max = Content.GetByRank(graphNode.Rank).Max(x => ((IGenealogyGraphNode<ISymbolicExpressionTree>)x).Data.IterateNodesPrefix().Max(y => y.NodeWeight));
+        if (max.IsAlmost(0)) max = 1;
+        int c = ColorGradient.Colors.Count - 1;
+        const int alpha = 100;
         if (fragment != null) {
-          //          treeChart_HighlightSubtree(graphNode.Data.NodeAt(fragment.Index1));
+          // highlight the fragment with a blue line color
+          foreach (var n in graphNode.Data.NodeAt(fragment.Index1).IterateNodesPrefix()) {
+            treeChart_HighlightSubtree(n, Color.CornflowerBlue);
+          }
+          // highlight all the nodes according to their sample count
           var nodes = graphNode.Data.IterateNodesPrefix().ToList();
-          int c = ColorGradient.Colors.Count - 1;
+          foreach (var n in nodes.Skip(1)) {
+            var i = (int)Math.Round(n.NodeWeight / max * c);
+            var fillColor = Color.FromArgb(alpha, ColorGradient.Colors[i]);
+            treeChart_HighlightSubtree(n, null, fillColor);
+          }
+        } else if (td != null) {
+          var nodes = graphNode.Data.IterateNodesPrefix().ToList();
           foreach (var n in nodes.Skip(1)) { // skip program root symbol 
-            //            var i = (int)Math.Round(n.NodeWeight / max * c);
-            //            const int alpha = 50;
-            //            var fillColor = Color.FromArgb(alpha, ColorGradient.Colors[i]);
-
-            //            treeChart_HighlightSubtree(n, null, fillColor);
-          }
-        } else if (td != null) {
-
-          var nodes = graphNode.Data.IterateNodesPrefix().ToList();
-          int c = ColorGradient.Colors.Count - 1;
-          foreach (var n in nodes.Skip(1)) { // skip program root symbol 
-            //            var i = (int)Math.Round(n.NodeWeight / max * c);
-            //            const int alpha = 50;
-            //            var fillColor = Color.FromArgb(alpha, ColorGradient.Colors[i]);
-
-            //            treeChart_HighlightSubtree(n, null, fillColor);
-          }
-
+            var i = (int)Math.Round(n.NodeWeight / max * c);
+            var fillColor = Color.FromArgb(alpha, ColorGradient.Colors[i]);
+            treeChart_HighlightSubtree(n, null, fillColor);
+          }
           treeChart_HighlightSubtree(nodes[td.LastSubtreeIndex], Color.Orange);
           treeChart_HighlightSubtree(nodes[td.LastFragmentIndex], Color.CornflowerBlue);
@@ -141,57 +142,57 @@
 
       switch (args.Button) {
-        case MouseButtons.Left:
-          SelectedSubtree = subtree;
-          if (trace) {
-            // perform fragment tracing
-            var graphNode = (IGenealogyGraphNode<ISymbolicExpressionTree>)genealogyGraphChart.SelectedGraphNode;
-            var subtreeIndex = graphNode.Data.IterateNodesPrefix().ToList().IndexOf(subtree);
-            var traceGraph = TraceCalculator.TraceSubtree(graphNode, subtreeIndex, updateVertexWeights: true, updateSubtreeWeights: true, cacheTraceNodes: true);
-            if (traceGraph.Vertices.Any()) {
-              genealogyGraphChart.UpdateEnabled = false;
-              genealogyGraphChart.ClearPrimitives();
-              var traceVertices = traceGraph.Vertices.ToList();
-              var genealogyNodes = traceVertices.Select(v => Content.GetByContent(v.Data)).ToList();
-              // color graph vertices according to their weight
-              double max = traceGraph.Vertices.Max(x => x.Data.IterateNodesPrefix().Max(n => x.Weight));
-              for (int i = 0; i < genealogyNodes.Count; ++i) {
-                var g = genealogyNodes[i];
-                g.Weight = traceVertices[i].Weight;
-                var v = genealogyGraphChart.GetMappedNode(g);
-                if (v != null) {
-                  v.Brush = new SolidBrush(ColorGradient.Colors[(int)Math.Round(g.Weight * (ColorGradient.Colors.Count - 1) / max)]);
+        case MouseButtons.Left: {
+            SelectedSubtree = subtree;
+            if (trace) {
+              // TODO: maybe highlight based on per generation maximum
+              double max = Content.Vertices.Max(x => x.Data.IterateNodesPrefix().Average(y => y.NodeWeight));
+              // perform fragment tracing
+              var graphNode = (IGenealogyGraphNode<ISymbolicExpressionTree>)genealogyGraphChart.SelectedGraphNode;
+              var subtreeIndex = graphNode.Data.IterateNodesPrefix().ToList().IndexOf(subtree);
+              var traceGraph = TraceCalculator.TraceSubtree(graphNode, subtreeIndex, updateVertexWeights: false, updateSubtreeWeights: false, cacheTraceNodes: true);
+              if (traceGraph.Vertices.Any()) {
+                var vertices = traceGraph.Vertices.Select(x => Content.GetByContent(x.Data));
+                genealogyGraphChart.UpdateEnabled = false;
+                genealogyGraphChart.ClearPrimitives();
+                foreach (var v in vertices) {
+                  var vNode = genealogyGraphChart.GetMappedNode(v);
+                  var wSum = v.Data.IterateNodesPrefix().Average(x => x.NodeWeight);
+                  // use a grayscal gradient
+                  var color = ColorGradient.GrayscaledColors[(int)Math.Round(wSum / max * (ColorGradient.GrayscaledColors.Count - 1))];
+                  vNode.Brush = new SolidBrush(color);
+                }
+                genealogyGraphChart.UpdateEnabled = true;
+                genealogyGraphChart.EnforceUpdate();
+
+                if (openNew_CheckBox.Checked) {
+                  MainFormManager.MainForm.ShowContent(traceGraph); // display the fragment graph on the screen
                 }
               }
-
-              genealogyGraphChart.UpdateEnabled = true;
-              genealogyGraphChart.EnforceUpdate();
-
-              if (openNew_CheckBox.Checked)
-                MainFormManager.MainForm.ShowContent(traceGraph); // display the fragment graph on the screen
+            } else {
+              // perform matching like it was done before
+              // currently there is no possibility to specify the subtree matching criteria
+              var trees = Content.Vertices.Select(x => x.Data);
+              var matchingTrees = trees.Where(x => x.Root.ContainsSubtree(subtree, comparer));
+
+              var matchingVertices = matchingTrees.Select(x => Content.GetByContent(x));
+              graphChart_HighlightMatchingVertices(matchingVertices);
             }
-          } else {
-            // perform matching like it was done before
-            // currently there is no possibility to specify the subtree matching criteria
-            var trees = Content.Vertices.Select(x => x.Data);
-            var matchingTrees = trees.Where(x => x.Root.ContainsSubtree(subtree, comparer));
-
-            var matchingVertices = matchingTrees.Select(x => Content.GetByContent(x));
-            graphChart_HighlightMatchingVertices(matchingVertices);
-          }
-          break;
-        case MouseButtons.Middle:
-          var index = SelectedSubtree.IterateNodesPrefix().ToList().IndexOf(subtree);
-          if (index > 0) {
-            var s = ClonedSubtree.NodeAt(index);
-            s.Parent.RemoveSubtree(s.Parent.IndexOfSubtree(s));
-
-            var trees = Content.Vertices.Select(x => x.Data);
-            var matchingTrees = trees.Where(x => x.Root.ContainsSubtree(ClonedSubtree, comparer));
-
-            var matchingVertices = matchingTrees.Select(x => Content.GetByContent(x));
-            treeChart_HighlightSubtree(subtree, Color.Black, Color.White);
-            graphChart_HighlightMatchingVertices(matchingVertices);
-          }
-          break;
+            break;
+          }
+        case MouseButtons.Middle: {
+            var index = SelectedSubtree.IterateNodesPrefix().ToList().IndexOf(subtree);
+            if (index > 0) {
+              var s = ClonedSubtree.NodeAt(index);
+              s.Parent.RemoveSubtree(s.Parent.IndexOfSubtree(s));
+
+              var trees = Content.Vertices.Select(x => x.Data);
+              var matchingTrees = trees.Where(x => x.Root.ContainsSubtree(ClonedSubtree, comparer));
+
+              var matchingVertices = matchingTrees.Select(x => Content.GetByContent(x));
+              treeChart_HighlightSubtree(subtree, Color.Black, Color.White);
+              graphChart_HighlightMatchingVertices(matchingVertices);
+            }
+            break;
+          }
       }
     }
Index: branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/SymbolicExpressionChartControl.cs
===================================================================
--- branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/SymbolicExpressionChartControl.cs	(revision 12225)
+++ 	(revision )
@@ -1,58 +1,0 @@
-﻿using System.Collections.Generic;
-using System.Drawing;
-using System.Drawing.Drawing2D;
-using System.Linq;
-using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
-using HeuristicLab.Visualization;
-
-namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
-  public partial class SymbolicExpressionChartControl : ChartControl {
-    public SymbolicExpressionChartControl() {
-      InitializeComponent();
-      if (Chart == null) { Chart = new Chart(0, 0, PreferredSize.Width, PreferredSize.Height); }
-    }
-
-    public void Clear() {
-      Chart.Group.Clear();
-    }
-
-    public void Add(IPrimitive primitive) {
-      Chart.Group.Add(primitive);
-    }
-
-    public void AddRange(IEnumerable<IPrimitive> primitives) {
-      Chart.Group.AddRange(primitives);
-    }
-
-    public void Draw(Graphics graphics) {
-      graphics.SmoothingMode = SmoothingMode.HighQuality;
-      Chart.Group.Draw(graphics);
-    }
-
-    public bool UpdateEnabled {
-      get { return Chart.UpdateEnabled; }
-      set { Chart.UpdateEnabled = value; }
-    }
-
-    public void EnforceUpdate() {
-      Chart.EnforceUpdate();
-    }
-
-    public void FlipVertical() {
-      foreach (var p in Chart.Group.Primitives.OfType<SymbolicExpressionTreeTile>().SelectMany(x => x.Primitives)) {
-        FlipPrimitive(p);
-      }
-    }
-
-    public void FlipPrimitive(IPrimitive primitive) {
-      var height = pictureBox.Height;
-      var rect = primitive as RectangularPrimitiveBase;
-      var line = primitive as LinearPrimitiveBase;
-      if (rect != null) {
-        rect.SetPosition(rect.LowerLeft.X, height - rect.UpperRight.Y, rect.UpperRight.X, height - rect.LowerLeft.Y);
-      } else if (line != null) {
-        line.SetPosition(line.Start.X, height - line.Start.Y, line.End.X, height - line.End.Y);
-      }
-    }
-  }
-}
Index: branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/Analyzers/SymbolicDataAnalysisSubtreeSampleCountAnalyzer.cs
===================================================================
--- branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/Analyzers/SymbolicDataAnalysisSubtreeSampleCountAnalyzer.cs	(revision 12225)
+++ branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/Analyzers/SymbolicDataAnalysisSubtreeSampleCountAnalyzer.cs	(revision 12231)
@@ -26,4 +26,5 @@
 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
 using HeuristicLab.EvolutionTracking;
+using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
 
@@ -32,8 +33,24 @@
   [StorableClass]
   public class SymbolicDataAnalysisSubtreeSampleCountAnalyzer : EvolutionTrackingAnalyzer<ISymbolicExpressionTree> {
+    private const string CacheTraceNodesParameterName = "CacheTraceNodes";
     private readonly TraceCalculator traceCalculator = new TraceCalculator { UpdateVertexWeights = true, UpdateSubtreeWeights = true, CacheTraceNodes = true };
 
+    #region parameters
+    public IFixedValueParameter<BoolValue> CacheTraceNodesParameter {
+      get { return (IFixedValueParameter<BoolValue>)Parameters[CacheTraceNodesParameterName]; }
+    }
+    #endregion
+
+    #region parameter properties
+    public bool CacheTraceNodes {
+      get { return CacheTraceNodesParameter.Value.Value; }
+      set { CacheTraceNodesParameter.Value.Value = value; }
+    }
+    #endregion
+
     public SymbolicDataAnalysisSubtreeSampleCountAnalyzer() {
-      UpdateCounterParameter.ActualName = "TraceOverlapAnalyzerUpdateCounter";
+      UpdateCounterParameter.ActualName = "SubtreeSampleCountAnalyzerUpdateCounter";
+
+      Parameters.Add(new FixedValueParameter<BoolValue>(CacheTraceNodesParameterName, new BoolValue(true)));
     }
 
@@ -77,16 +94,13 @@
         return base.Apply();
 
-      double avgTraceOverlap = 0;
-
+      traceCalculator.CacheTraceNodes = CacheTraceNodes;
       if (Generation.Value > 0) {
         var rank = PopulationGraph.GetByRank(Generation.Value).Cast<IGenealogyGraphNode<ISymbolicExpressionTree>>().ToList();
-        foreach (var n in rank) {
-          // during the trace the SymbolicExpressionTreeNode weights will be updated behind the scenes
-          // the weights represent the sample count of each subtree
-          var trace = traceCalculator.Trace(n, 2, false);
-          foreach (var v in trace.Vertices) {
-            var g = PopulationGraph.GetByContent(v.Data);
-            g.Weight = v.Weight;
-          }
+        foreach (var n in rank)
+          traceCalculator.Trace(n, 2, false); // during this call weights will be updated
+
+        foreach (var v in traceCalculator.TraceGraph.Vertices) {
+          var g = PopulationGraph.GetByContent(v.Data);
+          g.Weight = v.Weight;
         }
       }
Index: branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/TraceCalculator.cs
===================================================================
--- branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/TraceCalculator.cs	(revision 12225)
+++ branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/TraceCalculator.cs	(revision 12231)
@@ -160,11 +160,13 @@
               if (UpdateSubtreeWeights) {
                 var arcs = (List<IArc>)((IVertex)n).InArcs; // at this moment n will have been added as a child to the next trace node
+
+                // TODO: try to simplify the code below
                 for (int i = 0; i < arcs.Count; ++i) {
                   var td = (TraceData)((IArc<IDeepCloneable>)arcs[i]).Data;
                   var p = (IGenealogyGraphNode<ISymbolicExpressionTree>)arcs[i].Source;
-                  // TODO: the first part of the check below represents a necessary but not sufficient condition
-                  // TODO: therefore, a Difference check is also performed, it would be nice to make this code more ellegant
-                  if (td.LastFragmentIndex == td.SubtreeIndex && fragment.Root.Difference(NodeAt(p.Data, td.SubtreeIndex)) == null) {
-                    arcs[i].Weight++;
+                  var s = NodeAt(p.Data, td.SubtreeIndex);
+                  if (td.LastFragmentIndex == td.SubtreeIndex && fragment.Root.Difference(s) == null) {
+                    foreach (var ss in s.IterateNodesPrefix()) ss.NodeWeight++; // the node weight will represent the total sample count for a given node
+                    arcs[i].Weight++; // the arc weights (since there are multiple arcs) will sum up to the same count but give more detail
                     break;
                   }
