Index: branches/HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks/3.3/CreateTargetVariationExperiment.cs
===================================================================
--- branches/HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks/3.3/CreateTargetVariationExperiment.cs	(revision 13665)
+++ branches/HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks/3.3/CreateTargetVariationExperiment.cs	(revision 13728)
@@ -1,3 +1,24 @@
-﻿using System;
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
 using System.Collections.Generic;
 using System.Windows.Forms;
@@ -6,46 +27,35 @@
 using HeuristicLab.Optimizer;
 
-namespace HeuristicLab.VariableInteractionNetworks
-{
-    internal class CreateTargetVariationExperiment : HeuristicLab.MainForm.WindowsForms.MenuItem, IOptimizerUserInterfaceItemProvider
-    {
-        public override string Name
-        {
-            get { return "Create Target Variation &Experiment"; }
+namespace HeuristicLab.VariableInteractionNetworks {
+  internal class CreateTargetVariationExperiment : HeuristicLab.MainForm.WindowsForms.MenuItem, IOptimizerUserInterfaceItemProvider {
+    public override string Name {
+      get { return "Create Target Variation &Experiment"; }
+    }
+    public override IEnumerable<string> Structure {
+      get { return new string[] { "&Edit" }; }
+    }
+    public override int Position {
+      get { return 2300; }
+    }
+    public override string ToolTipText {
+      get { return "Create an experiment for varying the target variable"; }
+    }
+
+    protected override void OnToolStripItemSet(EventArgs e) {
+      ToolStripItem.Enabled = false;
+    }
+    protected override void OnActiveViewChanged(object sender, EventArgs e) {
+      IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView;
+      ToolStripItem.Enabled = (activeView != null) && (activeView.Content != null) && (activeView.Content is IOptimizer) && !activeView.Locked;
+    }
+
+    public override void Execute() {
+      IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView;
+      if ((activeView != null) && (activeView.Content != null) && (activeView.Content is IOptimizer) && !activeView.Locked) {
+        using (CreateTargetVariationExperimentDialog dialog = new CreateTargetVariationExperimentDialog((IAlgorithm)activeView.Content)) {
+          if (dialog.ShowDialog() == DialogResult.OK) MainFormManager.MainForm.ShowContent(dialog.Experiment);
         }
-        public override IEnumerable<string> Structure
-        {
-            get { return new string[] { "&Edit" }; }
-        }
-        public override int Position
-        {
-            get { return 2300; }
-        }
-        public override string ToolTipText
-        {
-            get { return "Create an experiment for varying the target variable"; }
-        }
-
-        protected override void OnToolStripItemSet(EventArgs e)
-        {
-            ToolStripItem.Enabled = false;
-        }
-        protected override void OnActiveViewChanged(object sender, EventArgs e)
-        {
-            IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView;
-            ToolStripItem.Enabled = (activeView != null) && (activeView.Content != null) && (activeView.Content is IOptimizer) && !activeView.Locked;
-        }
-
-        public override void Execute()
-        {
-            IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView;
-            if ((activeView != null) && (activeView.Content != null) && (activeView.Content is IOptimizer) && !activeView.Locked)
-            {
-                using (CreateTargetVariationExperimentDialog dialog = new CreateTargetVariationExperimentDialog((IAlgorithm)activeView.Content))
-                {
-                    if (dialog.ShowDialog() == DialogResult.OK) MainFormManager.MainForm.ShowContent(dialog.Experiment);
-                }
-            }
-        }
+      }
     }
+  }
 }
Index: branches/HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks/3.3/HeuristicLab.VariableInteractionNetworks-3.3.csproj
===================================================================
--- branches/HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks/3.3/HeuristicLab.VariableInteractionNetworks-3.3.csproj	(revision 13665)
+++ branches/HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks/3.3/HeuristicLab.VariableInteractionNetworks-3.3.csproj	(revision 13728)
@@ -166,4 +166,5 @@
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="SymbolicDataAnalysisVariableImpactsAnalyzer.cs" />
+    <Compile Include="VariableInteractionNetwork.cs" />
   </ItemGroup>
   <ItemGroup>
Index: branches/HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks/3.3/SymbolicDataAnalysisVariableImpactsAnalyzer.cs
===================================================================
--- branches/HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks/3.3/SymbolicDataAnalysisVariableImpactsAnalyzer.cs	(revision 13665)
+++ branches/HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks/3.3/SymbolicDataAnalysisVariableImpactsAnalyzer.cs	(revision 13728)
@@ -38,4 +38,5 @@
   [StorableClass]
   public class SymbolicRegressionVariableImpactsAnalyzer : SymbolicDataAnalysisAnalyzer {
+    #region parameter names
     private const string UpdateCounterParameterName = "UpdateCounter";
     private const string UpdateIntervalParameterName = "UpdateInterval";
@@ -47,5 +48,4 @@
     private const string EstimationLimitsParameterName = "EstimationLimits";
     private const string EvaluatorParameterName = "Evaluator";
-    private const string VariableImpactsParameterName = "AverageVariableImpacts";
     private const string PercentageBestParameterName = "PercentageBest";
     private const string LastGenerationsParameterName = "LastGenerations";
@@ -53,4 +53,7 @@
     private const string OptimizeConstantsParameterName = "OptimizeConstants";
     private const string PruneTreesParameterName = "PruneTrees";
+    private const string AverageVariableImpactsResultName = "Average variable impacts";
+    private const string AverageVariableImpactsHistoryResultName = "Average variable impacts history";
+    #endregion
 
     private SymbolicDataAnalysisExpressionTreeSimplifier simplifier;
@@ -84,7 +87,4 @@
     public ILookupParameter<ISymbolicRegressionSingleObjectiveEvaluator> EvaluatorParameter {
       get { return (ILookupParameter<ISymbolicRegressionSingleObjectiveEvaluator>)Parameters[EvaluatorParameterName]; }
-    }
-    public ILookupParameter<DataTable> VariableImpactsParameter {
-      get { return (ILookupParameter<DataTable>)Parameters[VariableImpactsParameterName]; }
     }
     public IFixedValueParameter<PercentValue> PercentageBestParameter {
@@ -126,6 +126,5 @@
       Parameters.Add(new LookupParameter<DoubleLimit>(EstimationLimitsParameterName));
       Parameters.Add(new FixedValueParameter<IntValue>(MaxCOIterationsParameterName, new IntValue(3)));
-      Parameters.Add(new LookupParameter<DataTable>(VariableImpactsParameterName, "The relative variable relevance calculated as the average relative variable frequency over the whole run."));
-      Parameters.Add(new FixedValueParameter<PercentValue>(PercentageBestParameterName, new PercentValue(100)));
+      Parameters.Add(new FixedValueParameter<PercentValue>(PercentageBestParameterName, new PercentValue(1)));
       Parameters.Add(new FixedValueParameter<IntValue>(LastGenerationsParameterName, new IntValue(10)));
       Parameters.Add(new FixedValueParameter<BoolValue>(OptimizeConstantsParameterName, new BoolValue(false)));
@@ -171,5 +170,5 @@
       var results = ResultCollectionParameter.ActualValue;
       int maxGen = MaximumGenerationsParameter.ActualValue.Value;
-      int gen = ((IntValue)results["Generations"].Value).Value;
+      int gen = results.ContainsKey("Generations") ? ((IntValue)results["Generations"].Value).Value : 0;
       int lastGen = LastGenerationsParameter.Value.Value;
 
@@ -195,17 +194,16 @@
       var allowedInputVariables = problemData.AllowedInputVariables.ToList();
       DataTable dataTable;
-      if (VariableImpactsParameter.ActualValue == null) {
+      if (!results.ContainsKey(AverageVariableImpactsHistoryResultName)) {
         dataTable = new DataTable("Variable impacts", "Average impact of variables over the population");
         dataTable.VisualProperties.XAxisTitle = "Generation";
         dataTable.VisualProperties.YAxisTitle = "Average variable impact";
-        VariableImpactsParameter.ActualValue = dataTable;
-        results.Add(new Result("Average variable impacts", "The relative variable relevance calculated as the average relative variable frequency over the whole run.", new DataTable()));
+        results.Add(new Result(AverageVariableImpactsHistoryResultName, dataTable));
 
         foreach (var v in allowedInputVariables) {
           dataTable.Rows.Add(new DataRow(v) { VisualProperties = { StartIndexZero = true } });
         }
-        VariableImpactsParameter.ActualValue = dataTable;
-      }
-      dataTable = VariableImpactsParameter.ActualValue;
+      }
+      dataTable = (DataTable)results[AverageVariableImpactsHistoryResultName].Value;
+
       int nTrees = (int)Math.Round(trees.Length * percentageBest);
       var bestTrees = trees.Take(nTrees).Select(x => (ISymbolicExpressionTree)x.Clone()).ToList();
@@ -215,5 +213,5 @@
       if (optimizeConstants) {
         for (int i = 0; i < simplifiedTrees.Count; ++i) {
-          qualities[i].Value = SymbolicRegressionConstantOptimizationEvaluator.OptimizeConstants(interpreter, simplifiedTrees[i], problemData, problemData.TrainingIndices, applyLinearScaling, constantOptimizationIterations, estimationLimits.Upper, estimationLimits.Lower);
+          qualities[i].Value = SymbolicRegressionConstantOptimizationEvaluator.OptimizeConstants(interpreter, simplifiedTrees[i], problemData, problemData.TrainingIndices, applyLinearScaling, constantOptimizationIterations, true, estimationLimits.Upper, estimationLimits.Lower);
         }
       }
@@ -243,11 +241,12 @@
         var averageImpact = 0d;
         for (int i = 0; i < indices.Count; ++i) {
+          var tree = simplifiedTrees[i];
           var originalQuality = qualities[i].Value;
           double newQuality;
           if (optimizeConstants) {
-            newQuality = SymbolicRegressionConstantOptimizationEvaluator.OptimizeConstants(interpreter, simplifiedTrees[i], pd, problemData.TrainingIndices, applyLinearScaling, constantOptimizationIterations, estimationLimits.Upper, estimationLimits.Lower);
+            newQuality = SymbolicRegressionConstantOptimizationEvaluator.OptimizeConstants(interpreter, tree, pd, problemData.TrainingIndices, applyLinearScaling, constantOptimizationIterations, true, estimationLimits.Upper, estimationLimits.Lower);
           } else {
             var evaluator = EvaluatorParameter.ActualValue;
-            newQuality = evaluator.Evaluate(this.ExecutionContext, simplifiedTrees[i], pd, pd.TrainingIndices);
+            newQuality = evaluator.Evaluate(this.ExecutionContext, tree, pd, pd.TrainingIndices);
           }
           averageImpact += originalQuality - newQuality; // impact calculated this way may be negative
@@ -257,5 +256,15 @@
       }
 
-      results["Average variable impacts"].Value = dataTable;
+      var averageVariableImpacts = new DoubleMatrix(dataTable.Rows.Count, 1);
+      var rowNames = dataTable.Rows.Select(x => x.Name).ToList();
+      averageVariableImpacts.RowNames = rowNames;
+      for (int i = 0; i < rowNames.Count; ++i) {
+        averageVariableImpacts[i, 0] = dataTable.Rows[rowNames[i]].Values.Last();
+      }
+      if (!results.ContainsKey(AverageVariableImpactsResultName)) {
+        results.Add(new Result(AverageVariableImpactsResultName, averageVariableImpacts));
+      } else {
+        results[AverageVariableImpactsResultName].Value = averageVariableImpacts;
+      }
       return base.Apply();
     }
Index: branches/HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks/3.3/VariableInteractionNetwork.cs
===================================================================
--- branches/HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks/3.3/VariableInteractionNetwork.cs	(revision 13728)
+++ branches/HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks/3.3/VariableInteractionNetwork.cs	(revision 13728)
@@ -0,0 +1,48 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.VariableInteractionNetworks {
+  [Item("VariableInteractionNetwork", "A graph representation of variables and their relationships.")]
+  [StorableClass]
+  public class VariableInteractionNetwork : DirectedGraph {
+    public VariableInteractionNetwork() { }
+
+    protected VariableInteractionNetwork(VariableInteractionNetwork original, Cloner cloner) : base(original, cloner) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new VariableInteractionNetwork(this, cloner);
+    }
+  }
+
+  [Item("VariableNetworkNode", "A graph vertex which represents a symbolic regression variable.")]
+  [StorableClass]
+  public class VariableNetworkNode : Vertex<IDeepCloneable> {
+  }
+
+  [Item("FunctionNetworkNode", "A graph vertex representing a junction node.")]
+  [StorableClass]
+  public class JunctionNetworkNode : Vertex<IDeepCloneable> {
+  }
+}
