Index: /branches/HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks.Views/3.3/HeuristicLab.VariableInteractionNetworks.Views-3.3.csproj
===================================================================
--- /branches/HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks.Views/3.3/HeuristicLab.VariableInteractionNetworks.Views-3.3.csproj	(revision 12262)
+++ /branches/HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks.Views/3.3/HeuristicLab.VariableInteractionNetworks.Views-3.3.csproj	(revision 12263)
@@ -47,4 +47,8 @@
       <Private>False</Private>
     </Reference>
+    <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath>
+    </Reference>
     <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
@@ -61,4 +65,8 @@
       <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
       <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Data.Views-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Data.Views-3.3.dll</HintPath>
     </Reference>
     <Reference Include="HeuristicLab.MainForm-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
@@ -102,8 +110,11 @@
       <Private>False</Private>
     </Reference>
+    <Reference Include="PresentationCore" />
+    <Reference Include="PresentationFramework" />
     <Reference Include="System" />
     <Reference Include="System.Core" />
     <Reference Include="System.Drawing" />
     <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xaml" />
     <Reference Include="System.Xml.Linq" />
     <Reference Include="System.Data.DataSetExtensions" />
@@ -111,4 +122,7 @@
     <Reference Include="System.Data" />
     <Reference Include="System.Xml" />
+    <Reference Include="UIAutomationProvider" />
+    <Reference Include="WindowsBase" />
+    <Reference Include="WindowsFormsIntegration" />
   </ItemGroup>
   <ItemGroup>
@@ -133,4 +147,9 @@
     <None Include="Plugin.cs.frame" />
   </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="VariableInteractionNetworkView.resx">
+      <DependentUpon>VariableInteractionNetworkView.cs</DependentUpon>
+    </EmbeddedResource>
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <PropertyGroup>
Index: /branches/HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks.Views/3.3/VariableInteractionNetworkView.Designer.cs
===================================================================
--- /branches/HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks.Views/3.3/VariableInteractionNetworkView.Designer.cs	(revision 12262)
+++ /branches/HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks.Views/3.3/VariableInteractionNetworkView.Designer.cs	(revision 12263)
@@ -31,5 +31,9 @@
             this.groupBox1 = new System.Windows.Forms.GroupBox();
             this.viewHost1 = new HeuristicLab.MainForm.WindowsForms.ViewHost();
+            this.viewHost2 = new HeuristicLab.MainForm.WindowsForms.ViewHost();
+            this.groupBox2 = new System.Windows.Forms.GroupBox();
+            this.viewHost3 = new HeuristicLab.MainForm.WindowsForms.ViewHost();
             this.groupBox1.SuspendLayout();
+            this.groupBox2.SuspendLayout();
             this.SuspendLayout();
             // 
@@ -37,10 +41,11 @@
             // 
             this.groupBox1.Controls.Add(this.viewHost1);
+            this.groupBox1.Controls.Add(this.viewHost2);
             this.groupBox1.Location = new System.Drawing.Point(0, 3);
             this.groupBox1.Name = "groupBox1";
-            this.groupBox1.Size = new System.Drawing.Size(779, 403);
+            this.groupBox1.Size = new System.Drawing.Size(635, 228);
             this.groupBox1.TabIndex = 0;
             this.groupBox1.TabStop = false;
-            this.groupBox1.Text = "Adjacency Matrix";
+            this.groupBox1.Text = "Adjacency Matrix. Node Impacts";
             // 
             // viewHost1
@@ -52,8 +57,44 @@
             this.viewHost1.Name = "viewHost1";
             this.viewHost1.ReadOnly = false;
-            this.viewHost1.Size = new System.Drawing.Size(667, 382);
+            this.viewHost1.Size = new System.Drawing.Size(354, 247);
             this.viewHost1.TabIndex = 0;
             this.viewHost1.ViewsLabelVisible = true;
             this.viewHost1.ViewType = null;
+            // 
+            // viewHost2
+            // 
+            this.viewHost2.Caption = "View";
+            this.viewHost2.Content = null;
+            this.viewHost2.Enabled = false;
+            this.viewHost2.Location = new System.Drawing.Point(365, 19);
+            this.viewHost2.Name = "viewHost2";
+            this.viewHost2.ReadOnly = false;
+            this.viewHost2.Size = new System.Drawing.Size(210, 259);
+            this.viewHost2.TabIndex = 0;
+            this.viewHost2.ViewsLabelVisible = true;
+            this.viewHost2.ViewType = null;
+            // 
+            // groupBox2
+            // 
+            this.groupBox2.Controls.Add(this.viewHost3);
+            this.groupBox2.Location = new System.Drawing.Point(6, 268);
+            this.groupBox2.Name = "groupBox2";
+            this.groupBox2.Size = new System.Drawing.Size(629, 258);
+            this.groupBox2.TabIndex = 1;
+            this.groupBox2.TabStop = false;
+            this.groupBox2.Text = "Updated Adjacency Matrix (for target variable x1 and threshold 0.2)";
+            // 
+            // viewHost3
+            // 
+            this.viewHost3.Caption = "View";
+            this.viewHost3.Content = null;
+            this.viewHost3.Enabled = false;
+            this.viewHost3.Location = new System.Drawing.Point(6, 19);
+            this.viewHost3.Name = "viewHost3";
+            this.viewHost3.ReadOnly = false;
+            this.viewHost3.Size = new System.Drawing.Size(367, 239);
+            this.viewHost3.TabIndex = 0;
+            this.viewHost3.ViewsLabelVisible = true;
+            this.viewHost3.ViewType = null;
             // 
             // VariableInteractionNetworkView
@@ -61,8 +102,10 @@
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.Controls.Add(this.groupBox2);
             this.Controls.Add(this.groupBox1);
             this.Name = "VariableInteractionNetworkView";
-            this.Size = new System.Drawing.Size(676, 407);
+            this.Size = new System.Drawing.Size(635, 513);
             this.groupBox1.ResumeLayout(false);
+            this.groupBox2.ResumeLayout(false);
             this.ResumeLayout(false);
 
@@ -73,5 +116,7 @@
         private System.Windows.Forms.GroupBox groupBox1;
         private MainForm.WindowsForms.ViewHost viewHost1;
-
+        private MainForm.WindowsForms.ViewHost viewHost2;
+        private System.Windows.Forms.GroupBox groupBox2;
+        private MainForm.WindowsForms.ViewHost viewHost3;
     }
 }
Index: /branches/HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks.Views/3.3/VariableInteractionNetworkView.cs
===================================================================
--- /branches/HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks.Views/3.3/VariableInteractionNetworkView.cs	(revision 12262)
+++ /branches/HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks.Views/3.3/VariableInteractionNetworkView.cs	(revision 12263)
@@ -42,4 +42,5 @@
   public sealed partial class VariableInteractionNetworkView : AsynchronousContentView {
     private const string variableImpactResultName = "Variable impacts";
+    private const string TrainingBestSolutionParameterName = "Best training solution";
     public new RunCollection Content {
       get { return (RunCollection)base.Content; }
@@ -83,10 +84,7 @@
                              from variableName in variableImpact.RowNames
                              select variableName).Distinct().ToArray();
-
         var adjMatrix = new DoubleMatrix(variableNames.Length, variableNames.Length);
-        var adjRow = groupRunCollection.Select(x => CalculateAdjacencyRows(x)).ToList();
-        var targets = groupRunCollection.Select(x => x.Key);
-
-        adjMatrix.RowNames = targets;
+
+        adjMatrix.RowNames = groupRunCollection.Select(x => x.Key); 
         adjMatrix.ColumnNames = adjMatrix.RowNames;
 
@@ -109,4 +107,6 @@
             }
         }
+        viewHost2.Content = CalculateNodeImportance(adjMatrix);
+        viewHost3.Content = UpdateAdjacencyMatrixByThreshold(0.2, "x1", adjMatrix);
         viewHost1.Content = adjMatrix;
     }
@@ -125,6 +125,5 @@
                                           select variableName)
                                          .ToList();
-
-        var inputVariables = runs.Select(x => ((IRegressionProblemData)x.Parameters["ProblemData"]).InputVariables).ToArray();     
+   
         var runNames = runs.Select(x => x.Name).ToArray();
         var runsArray = runs.ToArray();
@@ -143,17 +142,56 @@
     }
 
-    //taken from RunCollectionVariableImpactView
-    private IEnumerable<double> GetVariableImpacts(string variableName, IEnumerable<DoubleMatrix> allVariableImpacts)
-    {
-        foreach (DoubleMatrix runVariableImpacts in allVariableImpacts)
-        {
-            int row = 0;
-            foreach (string rowName in runVariableImpacts.RowNames)
-            {
-                if (rowName == variableName)
-                    yield return runVariableImpacts[row, 0];
-                row++;
-            }
-        }
+    private DoubleMatrix UpdateAdjacencyMatrixByThreshold(double threshold, string targetVariable, DoubleMatrix adjMatrix)
+    {
+        var updatedMatrix = (DoubleMatrix) adjMatrix.Clone();
+        var groupRunCollection = Content.GroupBy(x => ((IRegressionProblemData)x.Parameters["ProblemData"]).TargetVariable).ToList();
+        string[] targets = adjMatrix.RowNames.ToArray();
+        var targetIndex = Array.IndexOf(targets, targetVariable);
+        
+        for (int j = 0; j < groupRunCollection.Count; ++j)
+        {
+            if (updatedMatrix[targetIndex, j] < threshold)
+            {
+                updatedMatrix[targetIndex, j] = 0;
+            }          
+        }
+        return updatedMatrix;
+    }
+
+    private DoubleMatrix CalculateNodeImportance(DoubleMatrix adjMatrix)
+    {
+           DoubleMatrix nodeImportance = new DoubleMatrix(adjMatrix.Rows, 1);
+           var variables = new List<Tuple<string, double>>();
+           var rowNames = adjMatrix.RowNames.ToList();
+           var groupRunCollection = Content.GroupBy(x => ((IRegressionProblemData)x.Parameters["ProblemData"]).TargetVariable).ToList();
+           double[] meanQuality = new double[groupRunCollection.Count];
+
+           for (int j = 0; j < groupRunCollection.Count; ++j)
+           {
+               var g = groupRunCollection[j];
+               meanQuality[j] = g.Average(x => ((IRegressionSolution)x.Results[TrainingBestSolutionParameterName]).TrainingRSquared);
+           }
+
+           for (int i = 0; i < adjMatrix.Columns; ++i)
+           {
+               for (int j = 0; j < adjMatrix.Rows; ++j)
+               {
+                   nodeImportance[i, 0] += adjMatrix[j, i];
+               }
+               nodeImportance[i, 0] = nodeImportance[i, 0] * meanQuality[i] / (adjMatrix.Rows - 1);
+               variables.Add(new Tuple<string, double>(rowNames[i], nodeImportance[i, 0]));
+           }
+           
+           variables.Sort((b,a) => a.Item2.CompareTo(b.Item2));
+
+           for (int i = 0; i < nodeImportance.Rows; ++i)
+           {
+               nodeImportance[i, 0] = variables[i].Item2;
+               rowNames[i] = variables[i].Item1;
+           }
+
+           nodeImportance.RowNames = rowNames;
+           nodeImportance.ColumnNames = new[] { "Node Importance" };
+           return nodeImportance;    
     }
 
@@ -205,4 +243,19 @@
         return matrix;
     }
+
+    //taken from RunCollectionVariableImpactView
+    private IEnumerable<double> GetVariableImpacts(string variableName, IEnumerable<DoubleMatrix> allVariableImpacts)
+    {
+        foreach (DoubleMatrix runVariableImpacts in allVariableImpacts)
+        {
+            int row = 0;
+            foreach (string rowName in runVariableImpacts.RowNames)
+            {
+                if (rowName == variableName)
+                    yield return runVariableImpacts[row, 0];
+                row++;
+            }
+        }
+    }
   }
 }
