Index: /trunk/sources/HeuristicLab.Analysis/3.3/BestAverageWorstQualityAnalyzer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Analysis/3.3/BestAverageWorstQualityAnalyzer.cs	(revision 3786)
+++ /trunk/sources/HeuristicLab.Analysis/3.3/BestAverageWorstQualityAnalyzer.cs	(revision 3787)
@@ -77,9 +77,6 @@
       get { return (BestQualityMemorizer)OperatorGraph.InitialOperator; }
     }
-    private BestQualityMemorizer BestKnownQualityMemorizer {
-      get { return (BestQualityMemorizer)BestQualityMemorizer.Successor; }
-    }
     private BestAverageWorstQualityCalculator BestAverageWorstQualityCalculator {
-      get { return (BestAverageWorstQualityCalculator)BestKnownQualityMemorizer.Successor; }
+      get { return (BestAverageWorstQualityCalculator)BestQualityMemorizer.Successor; }
     }
     #endregion
@@ -103,5 +100,4 @@
       #region Create operators
       BestQualityMemorizer bestQualityMemorizer = new BestQualityMemorizer();
-      BestQualityMemorizer bestKnownQualityMemorizer = new BestQualityMemorizer();
       BestAverageWorstQualityCalculator bestAverageWorstQualityCalculator = new BestAverageWorstQualityCalculator();
       DataTableValuesCollector dataTableValuesCollector = new DataTableValuesCollector();
@@ -113,9 +109,4 @@
       bestQualityMemorizer.QualityParameter.ActualName = QualityParameter.Name;
       bestQualityMemorizer.QualityParameter.Depth = QualityParameter.Depth;
-
-      bestKnownQualityMemorizer.BestQualityParameter.ActualName = BestKnownQualityParameter.Name;
-      bestKnownQualityMemorizer.MaximizationParameter.ActualName = MaximizationParameter.Name;
-      bestKnownQualityMemorizer.QualityParameter.ActualName = QualityParameter.Name;
-      bestKnownQualityMemorizer.QualityParameter.Depth = QualityParameter.Depth;
 
       bestAverageWorstQualityCalculator.AverageQualityParameter.ActualName = CurrentAverageQualityParameter.Name;
@@ -151,6 +142,5 @@
       #region Create operator graph
       OperatorGraph.InitialOperator = bestQualityMemorizer;
-      bestQualityMemorizer.Successor = bestKnownQualityMemorizer;
-      bestKnownQualityMemorizer.Successor = bestAverageWorstQualityCalculator;
+      bestQualityMemorizer.Successor = bestAverageWorstQualityCalculator;
       bestAverageWorstQualityCalculator.Successor = dataTableValuesCollector;
       dataTableValuesCollector.Successor = qualityDifferenceCalculator;
@@ -177,5 +167,4 @@
     private void QualityParameter_DepthChanged(object sender, System.EventArgs e) {
       BestQualityMemorizer.QualityParameter.Depth = QualityParameter.Depth;
-      BestKnownQualityMemorizer.QualityParameter.Depth = QualityParameter.Depth;
       BestAverageWorstQualityCalculator.QualityParameter.Depth = QualityParameter.Depth;
     }
Index: /trunk/sources/HeuristicLab.Problems.Knapsack/3.3/Analyzers/BestKnapsackSolutionAnalyzer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.Knapsack/3.3/Analyzers/BestKnapsackSolutionAnalyzer.cs	(revision 3786)
+++ /trunk/sources/HeuristicLab.Problems.Knapsack/3.3/Analyzers/BestKnapsackSolutionAnalyzer.cs	(revision 3787)
@@ -39,5 +39,7 @@
   [StorableClass]
   class BestKnapsackSolutionAnalyzer : SingleSuccessorOperator, IAnalyzer {
-
+    public LookupParameter<BoolValue> MaximizationParameter {
+      get { return (LookupParameter<BoolValue>)Parameters["Maximization"]; }
+    }
     public ScopeTreeLookupParameter<BinaryVector> BinaryVectorParameter {
       get { return (ScopeTreeLookupParameter<BinaryVector>)Parameters["BinaryVector"]; }
@@ -61,7 +63,14 @@
       get { return (ValueLookupParameter<ResultCollection>)Parameters["Results"]; }
     }
+    public LookupParameter<DoubleValue> BestKnownQualityParameter {
+      get { return (LookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
+    }
+    public LookupParameter<BinaryVector> BestKnownSolutionParameter {
+      get { return (LookupParameter<BinaryVector>)Parameters["BestKnownSolution"]; }
+    }
 
     public BestKnapsackSolutionAnalyzer()
       : base() {
+      Parameters.Add(new LookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem."));
       Parameters.Add(new ScopeTreeLookupParameter<BinaryVector>("BinaryVector", "The knapsack solutions from which the best solution should be visualized."));
       Parameters.Add(new LookupParameter<IntValue>("KnapsackCapacity", "Capacity of the Knapsack."));
@@ -72,4 +81,6 @@
       Parameters.Add(new LookupParameter<KnapsackSolution>("BestSolution", "The best knapsack solution."));
       Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the knapsack solution should be stored."));
+      Parameters.Add(new LookupParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution."));
+      Parameters.Add(new LookupParameter<BinaryVector>("BestKnownSolution", "The best known solution."));
     }
 
@@ -78,21 +89,34 @@
       ItemArray<DoubleValue> qualities = QualityParameter.ActualValue;
       ResultCollection results = ResultsParameter.ActualValue;
+      bool max = MaximizationParameter.ActualValue.Value;
+      DoubleValue bestKnownQuality = BestKnownQualityParameter.ActualValue;
 
-      int i = qualities.Select((x, index) => new { index, x.Value }).OrderBy(x => x.Value).First().index;
+      int i = -1;
+      if (!max) 
+        i = qualities.Select((x, index) => new { index, x.Value }).OrderBy(x => x.Value).First().index;
+      else i = qualities.Select((x, index) => new { index, x.Value }).OrderByDescending(x => x.Value).First().index;
+
+      if (bestKnownQuality == null ||
+          max && qualities[i].Value > bestKnownQuality.Value ||
+          !max && qualities[i].Value < bestKnownQuality.Value) {
+        BestKnownQualityParameter.ActualValue = new DoubleValue(qualities[i].Value);
+        BestKnownSolutionParameter.ActualValue = (BinaryVector)binaryVectors[i].Clone();
+      }
 
       KnapsackSolution solution = BestSolutionParameter.ActualValue;
       if (solution == null) {
-        solution = new KnapsackSolution(binaryVectors[i], qualities[i],
+        solution = new KnapsackSolution((BinaryVector)binaryVectors[i].Clone(), new DoubleValue(qualities[i].Value),
           KnapsackCapacityParameter.ActualValue, WeightsParameter.ActualValue, ValuesParameter.ActualValue);
         BestSolutionParameter.ActualValue = solution;
         results.Add(new Result("Best Knapsack Solution", solution));
       }  else {
-        solution.BinaryVector = binaryVectors[i];
-        solution.Quality = qualities[i];
-        solution.Capacity = KnapsackCapacityParameter.ActualValue;
-        solution.Weights = WeightsParameter.ActualValue;
-        solution.Values = ValuesParameter.ActualValue;
-
-        results["Best Knapsack Solution"].Value = solution;
+        if (max && qualities[i].Value > solution.Quality.Value ||
+          !max && qualities[i].Value < solution.Quality.Value) {
+          solution.BinaryVector = (BinaryVector)binaryVectors[i].Clone();
+          solution.Quality = new DoubleValue(qualities[i].Value);
+          solution.Capacity = KnapsackCapacityParameter.ActualValue;
+          solution.Weights = WeightsParameter.ActualValue;
+          solution.Values = ValuesParameter.ActualValue;
+        }
       }
 
Index: /trunk/sources/HeuristicLab.Problems.Knapsack/3.3/KnapsackProblem.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.Knapsack/3.3/KnapsackProblem.cs	(revision 3786)
+++ /trunk/sources/HeuristicLab.Problems.Knapsack/3.3/KnapsackProblem.cs	(revision 3787)
@@ -80,4 +80,7 @@
       get { return BestKnownQualityParameter; }
     }
+    public OptionalValueParameter<BinaryVector> BestKnownSolutionParameter {
+      get { return (OptionalValueParameter<BinaryVector>)Parameters["BestKnownSolution"]; }
+    }
     #endregion
 
@@ -119,4 +122,8 @@
       get { return BestKnownQualityParameter.Value; }
       set { BestKnownQualityParameter.Value = value; }
+    }
+    public BinaryVector BestKnownSolution {
+      get { return BestKnownSolutionParameter.Value; }
+      set { BestKnownSolutionParameter.Value = value; }
     }
     private List<IOperator> operators;
@@ -164,4 +171,5 @@
       Parameters.Add(new ValueParameter<IKnapsackEvaluator>("Evaluator", "The operator which should be used to evaluate Knapsack solutions.", evaluator));
       Parameters.Add(new OptionalValueParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this Knapsack instance."));
+      Parameters.Add(new OptionalValueParameter<BinaryVector>("BestKnownSolution", "The best known solution of this Knapsack instance."));
 
       creator.BinaryVectorParameter.ActualName = "KnapsackSolution";
Index: /trunk/sources/HeuristicLab.Problems.OneMax/3.3/Analyzers/BestOneMaxSolutionAnalyzer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.OneMax/3.3/Analyzers/BestOneMaxSolutionAnalyzer.cs	(revision 3786)
+++ /trunk/sources/HeuristicLab.Problems.OneMax/3.3/Analyzers/BestOneMaxSolutionAnalyzer.cs	(revision 3787)
@@ -39,5 +39,7 @@
   [StorableClass]
   class BestOneMaxSolutionAnalyzer : SingleSuccessorOperator, IAnalyzer {
-
+    public LookupParameter<BoolValue> MaximizationParameter {
+      get { return (LookupParameter<BoolValue>)Parameters["Maximization"]; }
+    }
     public ScopeTreeLookupParameter<BinaryVector> BinaryVectorParameter {
       get { return (ScopeTreeLookupParameter<BinaryVector>)Parameters["BinaryVector"]; }
@@ -52,12 +54,16 @@
       get { return (ValueLookupParameter<ResultCollection>)Parameters["Results"]; }
     }
+    public LookupParameter<DoubleValue> BestKnownQualityParameter {
+      get { return (LookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
+    }
 
     public BestOneMaxSolutionAnalyzer()
       : base() {
+      Parameters.Add(new LookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem."));
       Parameters.Add(new ScopeTreeLookupParameter<BinaryVector>("BinaryVector", "The Onemax solutions from which the best solution should be visualized."));
-
       Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The qualities of the Onemax solutions which should be visualized."));
       Parameters.Add(new LookupParameter<OneMaxSolution>("BestSolution", "The best Onemax solution."));
       Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the Onemax solution should be stored."));
+      Parameters.Add(new LookupParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution."));
     }
 
@@ -66,17 +72,29 @@
       ItemArray<DoubleValue> qualities = QualityParameter.ActualValue;
       ResultCollection results = ResultsParameter.ActualValue;
+      bool max = MaximizationParameter.ActualValue.Value;
+      DoubleValue bestKnownQuality = BestKnownQualityParameter.ActualValue;
 
-      int i = qualities.Select((x, index) => new { index, x.Value }).OrderBy(x => x.Value).First().index;
+      int i = -1;
+      if (!max)
+        i = qualities.Select((x, index) => new { index, x.Value }).OrderBy(x => x.Value).First().index;
+      else i = qualities.Select((x, index) => new { index, x.Value }).OrderByDescending(x => x.Value).First().index;
+
+      if (bestKnownQuality == null ||
+          max && qualities[i].Value > bestKnownQuality.Value ||
+          !max && qualities[i].Value < bestKnownQuality.Value) {
+        BestKnownQualityParameter.ActualValue = new DoubleValue(qualities[i].Value);
+      }
 
       OneMaxSolution solution = BestSolutionParameter.ActualValue;
       if (solution == null) {
-        solution = new OneMaxSolution(binaryVectors[i], QualityParameter.ActualValue[i]);
+        solution = new OneMaxSolution((BinaryVector)binaryVectors[i].Clone(), new DoubleValue(qualities[i].Value));
         BestSolutionParameter.ActualValue = solution;
         results.Add(new Result("Best OneMax Solution", solution));
       }  else {
-        solution.BinaryVector = binaryVectors[i];
-        solution.Quality = QualityParameter.ActualValue[i];
-
-        results["Best OneMax Solution"].Value = solution;
+        if (max && qualities[i].Value > solution.Quality.Value ||
+          !max && qualities[i].Value < solution.Quality.Value) {
+          solution.BinaryVector = (BinaryVector)binaryVectors[i].Clone();
+          solution.Quality = new DoubleValue(qualities[i].Value);
+        }
       }
 
Index: /trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/Analyzers/BestSingleObjectiveTestFunctionSolutionAnalyzer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/Analyzers/BestSingleObjectiveTestFunctionSolutionAnalyzer.cs	(revision 3786)
+++ /trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/Analyzers/BestSingleObjectiveTestFunctionSolutionAnalyzer.cs	(revision 3787)
@@ -39,5 +39,7 @@
   [StorableClass]
   class BestSingleObjectiveTestFunctionSolutionAnalyzer : SingleSuccessorOperator, IBestSingleObjectiveTestFunctionSolutionAnalyzer, IAnalyzer {
-
+    public LookupParameter<BoolValue> MaximizationParameter {
+      get { return (LookupParameter<BoolValue>)Parameters["Maximization"]; }
+    }
     public ScopeTreeLookupParameter<RealVector> RealVectorParameter {
       get { return (ScopeTreeLookupParameter<RealVector>)Parameters["RealVector"]; }
@@ -70,4 +72,5 @@
     public BestSingleObjectiveTestFunctionSolutionAnalyzer()
       : base() {
+      Parameters.Add(new LookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem."));
       Parameters.Add(new ScopeTreeLookupParameter<RealVector>("RealVector", "The SingleObjectiveTestFunction solutions from which the best solution should be visualized."));
       Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The qualities of the SingleObjectiveTestFunction solutions which should be visualized."));
@@ -84,25 +87,24 @@
       ResultCollection results = ResultsParameter.ActualValue;
       ISingleObjectiveTestFunctionProblemEvaluator evaluator = EvaluatorParameter.ActualValue;
-      bool max = evaluator.Maximization;
+      bool max = MaximizationParameter.ActualValue.Value;
+      DoubleValue bestKnownQuality = BestKnownQualityParameter.ActualValue;
 
       int i = qualities.Select((x, index) => new { index, x.Value }).OrderBy(x => x.Value).First().index;
+
+      if (bestKnownQuality == null ||
+          max && qualities[i].Value > bestKnownQuality.Value
+          || !max && qualities[i].Value < bestKnownQuality.Value) {
+        BestKnownQualityParameter.ActualValue = new DoubleValue(qualities[i].Value);
+        BestKnownSolutionParameter.ActualValue = (RealVector)realVectors[i].Clone();
+      }
+
       SingleObjectiveTestFunctionSolution solution = BestSolutionParameter.ActualValue;
       if (solution == null) {
         solution = new SingleObjectiveTestFunctionSolution(realVectors[i], qualities[i], evaluator);
         solution.Population = realVectors;
-        double bestknownQuality = BestKnownQualityParameter.ActualValue.Value;
-        if (max && qualities[i].Value >= bestknownQuality
-          || !max && qualities[i].Value <= bestknownQuality) {
-          BestKnownSolutionParameter.ActualValue = (RealVector)realVectors[i].Clone();
-        }
         solution.BestKnownRealVector = BestKnownSolutionParameter.ActualValue;
         BestSolutionParameter.ActualValue = solution;
-        results.Add(new Result("Best SingleObjectiveTestFunction Solution", solution));
+        results.Add(new Result("Best Solution", solution));
       } else {
-        double bestknownQuality = BestKnownQualityParameter.ActualValue.Value;
-        if (max && qualities[i].Value >= bestknownQuality
-          || !max && qualities[i].Value <= bestknownQuality) {
-          BestKnownSolutionParameter.ActualValue = (RealVector)realVectors[i].Clone();
-        }
         if (max && qualities[i].Value > solution.BestQuality.Value
           || !max && qualities[i].Value < solution.BestQuality.Value) {
@@ -111,5 +113,4 @@
         }
         solution.Population = realVectors;
-        //results["Best SingleObjectiveTestFunction Solution"].Value = solution;
       }
 
Index: /trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/Analyzers/BestTSPSolutionAnalyzer.cs
===================================================================
--- /trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/Analyzers/BestTSPSolutionAnalyzer.cs	(revision 3786)
+++ /trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/Analyzers/BestTSPSolutionAnalyzer.cs	(revision 3787)
@@ -37,4 +37,7 @@
   [StorableClass]
   public sealed class BestTSPSolutionAnalyzer : SingleSuccessorOperator, IAnalyzer {
+    public LookupParameter<BoolValue> MaximizationParameter {
+      get { return (LookupParameter<BoolValue>)Parameters["Maximization"]; }
+    }
     public LookupParameter<DoubleMatrix> CoordinatesParameter {
       get { return (LookupParameter<DoubleMatrix>)Parameters["Coordinates"]; }
@@ -52,7 +55,14 @@
       get { return (ValueLookupParameter<ResultCollection>)Parameters["Results"]; }
     }
+    public LookupParameter<DoubleValue> BestKnownQualityParameter {
+      get { return (LookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
+    }
+    public LookupParameter<Permutation> BestKnownSolutionParameter {
+      get { return (LookupParameter<Permutation>)Parameters["BestKnownSolution"]; }
+    }
 
     public BestTSPSolutionAnalyzer()
       : base() {
+      Parameters.Add(new LookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem."));
       Parameters.Add(new LookupParameter<DoubleMatrix>("Coordinates", "The x- and y-Coordinates of the cities."));
       Parameters.Add(new ScopeTreeLookupParameter<Permutation>("Permutation", "The TSP solutions given in path representation from which the best solution should be analyzed."));
@@ -60,4 +70,6 @@
       Parameters.Add(new LookupParameter<PathTSPTour>("BestSolution", "The best TSP solution."));
       Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the best TSP solution should be stored."));
+      Parameters.Add(new LookupParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this TSP instance."));
+      Parameters.Add(new LookupParameter<Permutation>("BestKnownSolution", "The best known solution of this TSP instance."));
     }
 
@@ -67,6 +79,18 @@
       ItemArray<DoubleValue> qualities = QualityParameter.ActualValue;
       ResultCollection results = ResultsParameter.ActualValue;
+      bool max = MaximizationParameter.ActualValue.Value;
+      DoubleValue bestKnownQuality = BestKnownQualityParameter.ActualValue;
 
-      int i = qualities.Select((x, index) => new { index, x.Value }).OrderBy(x => x.Value).First().index;
+      int i = -1;
+      if (!max)
+        i = qualities.Select((x, index) => new { index, x.Value }).OrderBy(x => x.Value).First().index;
+      else i = qualities.Select((x, index) => new { index, x.Value }).OrderByDescending(x => x.Value).First().index;
+      
+      if (bestKnownQuality == null ||
+          max && qualities[i].Value > bestKnownQuality.Value ||
+          !max && qualities[i].Value < bestKnownQuality.Value) {
+        BestKnownQualityParameter.ActualValue = new DoubleValue(qualities[i].Value);
+        BestKnownSolutionParameter.ActualValue = (Permutation)permutations[i].Clone();
+      }
 
       PathTSPTour tour = BestSolutionParameter.ActualValue;
@@ -76,9 +100,9 @@
         results.Add(new Result("Best TSP Solution", tour));
       } else {
-        if (tour.Quality.Value > qualities[i].Value) {
+        if (max && tour.Quality.Value < qualities[i].Value ||
+          !max && tour.Quality.Value > qualities[i].Value) {
           tour.Coordinates = coordinates;
           tour.Permutation = (Permutation)permutations[i].Clone();
           tour.Quality.Value = qualities[i].Value;
-          results["Best TSP Solution"].Value = tour;
         }
       }
