Index: /trunk/sources/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearch.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearch.cs	(revision 3133)
+++ /trunk/sources/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearch.cs	(revision 3134)
@@ -155,5 +155,5 @@
       }
       ParameterizeSolutionsCreator();
-      ParameterizeLSMainLoop();
+      ParameterizeMainLoop();
       ParameterizeMoveEvaluator();
       ParameterizeMoveMaker();
@@ -170,9 +170,14 @@
       ParameterizeStochasticOperator(Problem.Evaluator);
       ParameterizeSolutionsCreator();
-      ParameterizeLSMainLoop();
+      ParameterizeMainLoop();
       ParameterizeMoveEvaluator();
       ParameterizeMoveMaker();
       Problem.Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
       base.Problem_EvaluatorChanged(sender, e);
+    }
+    protected override void Problem_VisualizerChanged(object sender, EventArgs e) {
+      ParameterizeStochasticOperator(Problem.Visualizer);
+      ParameterizeMainLoop();
+      base.Problem_VisualizerChanged(sender, e);
     }
     protected override void Problem_OperatorsChanged(object sender, EventArgs e) {
@@ -188,5 +193,5 @@
       if (oldMoveGenerator == MoveGenerator) // in this case MoveGeneratorParameter_ValueChanged did not fire
         UpdateMoveParameters();
-      ParameterizeLSMainLoop();
+      ParameterizeMainLoop();
       ParameterizeMoveEvaluator();
       ParameterizeMoveMaker();
@@ -194,5 +199,5 @@
     }
     private void Evaluator_QualityParameter_ActualNameChanged(object sender, EventArgs e) {
-      ParameterizeLSMainLoop();
+      ParameterizeMainLoop();
       ParameterizeMoveEvaluator();
       ParameterizeMoveMaker();
@@ -202,10 +207,10 @@
     }
     private void MoveEvaluatorParameter_ValueChanged(object sender, EventArgs e) {
-      ParameterizeLSMainLoop();
+      ParameterizeMainLoop();
       ParameterizeMoveEvaluator();
       ParameterizeMoveMaker();
     }
     private void MoveEvaluator_MoveQualityParameter_ActualNameChanged(object sender, EventArgs e) {
-      ParameterizeLSMainLoop();
+      ParameterizeMainLoop();
       ParameterizeMoveEvaluator();
       ParameterizeMoveMaker();
@@ -273,9 +278,12 @@
       SolutionsCreator.SolutionCreatorParameter.ActualName = Problem.SolutionCreatorParameter.Name;
     }
-    private void ParameterizeLSMainLoop() {
+    private void ParameterizeMainLoop() {
       MainLoop.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
       MainLoop.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
       if (MoveEvaluator != null)
         MainLoop.MoveQualityParameter.ActualName = MoveEvaluator.MoveQualityParameter.ActualName;
+      MainLoop.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name;
+      MainLoop.VisualizerParameter.ActualName = Problem.VisualizerParameter.Name;
+      MainLoop.VisualizationParameter.ActualName = Problem.Visualizer.VisualizationParameter.ActualName;
     }
     private void ParameterizeStochasticOperator(IOperator op) {
Index: /trunk/sources/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearchMainLoop.cs
===================================================================
--- /trunk/sources/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearchMainLoop.cs	(revision 3133)
+++ /trunk/sources/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearchMainLoop.cs	(revision 3134)
@@ -46,4 +46,7 @@
       get { return (LookupParameter<DoubleValue>)Parameters["Quality"]; }
     }
+    public ValueLookupParameter<DoubleValue> BestKnownQualityParameter {
+      get { return (ValueLookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
+    }
     public LookupParameter<DoubleValue> MoveQualityParameter {
       get { return (LookupParameter<DoubleValue>)Parameters["MoveQuality"]; }
@@ -63,4 +66,10 @@
     public ValueLookupParameter<IOperator> MoveMakerParameter {
       get { return (ValueLookupParameter<IOperator>)Parameters["MoveMaker"]; }
+    }
+    public ValueLookupParameter<IOperator> VisualizerParameter {
+      get { return (ValueLookupParameter<IOperator>)Parameters["Visualizer"]; }
+    }
+    public LookupParameter<IItem> VisualizationParameter {
+      get { return (LookupParameter<IItem>)Parameters["Visualization"]; }
     }
 
@@ -79,4 +88,5 @@
       Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, otherwise false."));
       Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The value which represents the quality of a solution."));
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("BestKnownQuality", "The best known quality value found so far."));
       Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The value which represents the quality of a move."));
       Parameters.Add(new ValueLookupParameter<IntValue>("MaximumIterations", "The maximum number of generations which should be processed."));
@@ -86,5 +96,7 @@
       Parameters.Add(new ValueLookupParameter<IOperator>("MoveMaker", "The operator that performs a move and updates the quality."));
       Parameters.Add(new ValueLookupParameter<IOperator>("MoveEvaluator", "The operator that evaluates a move."));
-      
+
+      Parameters.Add(new ValueLookupParameter<IOperator>("Visualizer", "The operator used to visualize solutions."));
+      Parameters.Add(new LookupParameter<IItem>("Visualization", "The item which represents the visualization of solutions."));
       Parameters.Add(new ScopeParameter("CurrentScope", "The current scope which represents a population of solutions on which the TS should be applied."));
       #endregion
@@ -92,4 +104,9 @@
       #region Create operators
       VariableCreator variableCreator = new VariableCreator();
+      BestQualityMemorizer bestQualityMemorizer1 = new BestQualityMemorizer();
+      BestQualityMemorizer bestQualityMemorizer2 = new BestQualityMemorizer();
+      DataTableValuesCollector dataTableValuesCollector1 = new DataTableValuesCollector();
+      QualityDifferenceCalculator qualityDifferenceCalculator1 = new QualityDifferenceCalculator();
+      Placeholder visualizer1 = new Placeholder();
       ResultsCollector resultsCollector = new ResultsCollector();
       UniformSequentialSubScopesProcessor mainProcessor = new UniformSequentialSubScopesProcessor();
@@ -104,19 +121,45 @@
       Placeholder moveMaker = new Placeholder();
       SubScopesRemover subScopesRemover = new SubScopesRemover();
-      DataTableValuesCollector valuesCollector = new DataTableValuesCollector();
       IntCounter iterationsCounter = new IntCounter();
       Comparator iterationsComparator = new Comparator();
+      BestQualityMemorizer bestQualityMemorizer3 = new BestQualityMemorizer();
+      BestQualityMemorizer bestQualityMemorizer4 = new BestQualityMemorizer();
+      DataTableValuesCollector dataTableValuesCollector2 = new DataTableValuesCollector();
+      QualityDifferenceCalculator qualityDifferenceCalculator2 = new QualityDifferenceCalculator();
+      Placeholder visualizer2 = new Placeholder();
       ConditionalBranch iterationsTermination = new ConditionalBranch();
-      EmptyOperator finished = new EmptyOperator();
 
       variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Iterations", new IntValue(0)));
-      variableCreator.CollectedValues.Add(new ValueParameter<DataTable>("Qualities", new DataTable("Qualities")));
+
+      bestQualityMemorizer1.BestQualityParameter.ActualName = BestKnownQualityParameter.Name;
+      bestQualityMemorizer1.MaximizationParameter.ActualName = MaximizationParameter.Name;
+      bestQualityMemorizer1.QualityParameter.ActualName = QualityParameter.Name;
+
+      bestQualityMemorizer2.BestQualityParameter.ActualName = "BestQuality";
+      bestQualityMemorizer2.MaximizationParameter.ActualName = MaximizationParameter.Name;
+      bestQualityMemorizer2.QualityParameter.ActualName = QualityParameter.Name;
+
+      dataTableValuesCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("BestQuality"));
+      dataTableValuesCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Known Quality", null, BestKnownQualityParameter.Name));
+      dataTableValuesCollector1.DataTableParameter.ActualName = "Qualities";
+
+      qualityDifferenceCalculator1.AbsoluteDifferenceParameter.ActualName = "AbsoluteDifferenceBestKnownToBest";
+      qualityDifferenceCalculator1.FirstQualityParameter.ActualName = BestKnownQualityParameter.Name;
+      qualityDifferenceCalculator1.RelativeDifferenceParameter.ActualName = "RelativeDifferenceBestKnownToBest";
+      qualityDifferenceCalculator1.SecondQualityParameter.ActualName = "BestQuality";
+
+      visualizer1.Name = "Visualizer (placeholder)";
+      visualizer1.OperatorParameter.ActualName = VisualizerParameter.Name;
+
+      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Iterations"));
+      resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality"));
+      resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Known Quality", null, BestKnownQualityParameter.Name));
+      resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Absolute Difference of Best Known Quality to Best Quality", null, "AbsoluteDifferenceBestKnownToBest"));
+      resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Relative Difference of Best Known Quality to Best Quality", null, "RelativeDifferenceBestKnownToBest"));
+      resultsCollector.CollectedValues.Add(new LookupParameter<IItem>("Solution Visualization", null, VisualizationParameter.Name));
+      resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>("Qualities"));
+      resultsCollector.ResultsParameter.ActualName = ResultsParameter.Name;
 
       mainProcessor.Name = "Solution processor (UniformSequentialSubScopesProcessor)";
-
-      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Iterations"));
-      resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Quality"));
-      resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>("Qualities"));
-      resultsCollector.ResultsParameter.ActualName = "Results";
 
       moveGenerator.Name = "MoveGenerator (placeholder)";
@@ -143,7 +186,4 @@
 
       subScopesRemover.RemoveAllSubScopes = true;
-
-      valuesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Quality"));
-      valuesCollector.DataTableParameter.ActualName = "Qualities";
 
       iterationsCounter.Name = "Iterations Counter";
@@ -157,4 +197,24 @@
       iterationsComparator.ResultParameter.ActualName = "IterationsCondition";
 
+      bestQualityMemorizer3.BestQualityParameter.ActualName = BestKnownQualityParameter.Name;
+      bestQualityMemorizer3.MaximizationParameter.ActualName = MaximizationParameter.Name;
+      bestQualityMemorizer3.QualityParameter.ActualName = QualityParameter.Name;
+
+      bestQualityMemorizer4.BestQualityParameter.ActualName = "BestQuality";
+      bestQualityMemorizer4.MaximizationParameter.ActualName = MaximizationParameter.Name;
+      bestQualityMemorizer4.QualityParameter.ActualName = QualityParameter.Name;
+
+      dataTableValuesCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>("BestQuality"));
+      dataTableValuesCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Known Quality", null, BestKnownQualityParameter.Name));
+      dataTableValuesCollector2.DataTableParameter.ActualName = "Qualities";
+
+      qualityDifferenceCalculator2.AbsoluteDifferenceParameter.ActualName = "AbsoluteDifferenceBestKnownToBest";
+      qualityDifferenceCalculator2.FirstQualityParameter.ActualName = BestKnownQualityParameter.Name;
+      qualityDifferenceCalculator2.RelativeDifferenceParameter.ActualName = "RelativeDifferenceBestKnownToBest";
+      qualityDifferenceCalculator2.SecondQualityParameter.ActualName = "BestQuality";
+
+      visualizer2.Name = "Visualizer (placeholder)";
+      visualizer2.OperatorParameter.ActualName = VisualizerParameter.Name;
+
       iterationsTermination.Name = "Iterations Termination Condition";
       iterationsTermination.ConditionParameter.ActualName = "IterationsCondition";
@@ -163,8 +223,13 @@
       #region Create operator graph
       OperatorGraph.InitialOperator = variableCreator;
-      variableCreator.Successor = mainProcessor;
-      mainProcessor.Operator = resultsCollector;
+      variableCreator.Successor = bestQualityMemorizer1;
+      bestQualityMemorizer1.Successor = bestQualityMemorizer2;
+      bestQualityMemorizer2.Successor = dataTableValuesCollector1;
+      dataTableValuesCollector1.Successor = qualityDifferenceCalculator1;
+      qualityDifferenceCalculator1.Successor = visualizer1;
+      visualizer1.Successor = resultsCollector;
+      resultsCollector.Successor = mainProcessor;
+      mainProcessor.Operator = moveGenerator;
       mainProcessor.Successor = iterationsCounter;
-      resultsCollector.Successor = moveGenerator;
       moveGenerator.Successor = moveEvaluationProcessor;
       moveEvaluationProcessor.Operator = moveEvaluator;
@@ -174,11 +239,19 @@
       moveMakingProcessor.Operator = qualityComparator;
       moveMakingProcessor.Successor = subScopesRemover;
-      subScopesRemover.Successor = valuesCollector;
+      subScopesRemover.Successor = null;
       qualityComparator.Successor = improvesQualityBranch;
       improvesQualityBranch.TrueBranch = moveMaker;
+      improvesQualityBranch.FalseBranch = null;
+      improvesQualityBranch.Successor = null;
+      moveMaker.Successor = null;
       iterationsCounter.Successor = iterationsComparator;
-      iterationsComparator.Successor = iterationsTermination;
+      iterationsComparator.Successor = bestQualityMemorizer3;
+      bestQualityMemorizer3.Successor = bestQualityMemorizer4;
+      bestQualityMemorizer4.Successor = dataTableValuesCollector2;
+      dataTableValuesCollector2.Successor = qualityDifferenceCalculator2;
+      qualityDifferenceCalculator2.Successor = visualizer2;
+      visualizer2.Successor = iterationsTermination;
       iterationsTermination.TrueBranch = mainProcessor;
-      iterationsTermination.FalseBranch = finished;
+      iterationsTermination.FalseBranch = null;
       #endregion
     }
