Index: branches/2288_HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks.Views/3.3/HeuristicLab.VariableInteractionNetworks.Views-3.3.csproj
===================================================================
--- branches/2288_HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks.Views/3.3/HeuristicLab.VariableInteractionNetworks.Views-3.3.csproj	(revision 16962)
+++ branches/2288_HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks.Views/3.3/HeuristicLab.VariableInteractionNetworks.Views-3.3.csproj	(revision 16966)
@@ -140,4 +140,10 @@
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Optimizer-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Persistence-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
+      <Private>False</Private>
     </Reference>
     <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
Index: branches/2288_HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks/3.3/ImpactCalculator.cs
===================================================================
--- branches/2288_HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks/3.3/ImpactCalculator.cs	(revision 16962)
+++ branches/2288_HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks/3.3/ImpactCalculator.cs	(revision 16966)
@@ -34,5 +34,5 @@
       shuffledRows.ShuffleInPlace(new FastRandom(1234), partition.Start, partition.End);      
 
-      for (int setSize = 1; setSize <= maxInteractions; setSize++) {
+      for (int setSize = 1; setSize <= maxInteractions && setSize <= variableNames.Count; setSize++) {
         var combinations = HeuristicLab.Common.EnumerableExtensions.Combinations(variableNames, setSize)
                                    .Where(comb => comb.Any(v => v == variableName)); // variable combinations that contain the selected variable
Index: branches/2288_HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks/3.3/VariableInteractionNetwork.cs
===================================================================
--- branches/2288_HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks/3.3/VariableInteractionNetwork.cs	(revision 16962)
+++ branches/2288_HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks/3.3/VariableInteractionNetwork.cs	(revision 16966)
@@ -37,17 +37,6 @@
   public class VariableInteractionNetwork : DirectedGraph {
 
-    /// <summary>
-    /// Creates a simple network from a matrix of variable impacts (each row represents a target variable, each column represents an input variable)
-    /// For each target variable not more than one row can be defined (no junction nodes are build, cf. FromNmseAndVariableImpacts(..) for building more complex networks).
-    /// The network is acyclic. Values in the diagonal are ignored.
-    /// The algorithm starts with an empty network and incrementally adds next most relevant input variable for each target variable up to a given threshold
-    /// In each iteration cycles are broken by removing the weakest link.
-    /// </summary>
-    /// <param name="nmse">vector of NMSE values for each target variable</param>
-    /// <param name="variableImpacts">Variable impacts (smaller is lower impact). Row names and columns names should be set</param>
-    /// <param name="nmseThreshold">Threshold for NMSE values. Variables with a NMSE value larger than the threshold are considered as independent variables</param>
-    /// <param name="varImpactThreshold">Threshold for variable impact values. Impacts with a value smaller than the threshold are considered as independent</param>
-    /// <returns></returns>
-    public static VariableInteractionNetwork CreateSimpleNetwork(double[] nmse, DoubleMatrix variableImpacts, double nmseThreshold = 0.2, double varImpactThreshold = 0.0) {
+    public static VariableInteractionNetwork CreateSimpleNetwork(double[] nmse, DoubleMatrix variableImpacts,
+      double nmseThreshold = 0.2, double varImpactThreshold = 0.0) {
       if (variableImpacts.Rows != variableImpacts.Columns) throw new ArgumentException();
       var network = new VariableInteractionNetwork();
@@ -58,5 +47,59 @@
       for (int i = 0; i < varNames.Length; i++) {
         var name = varNames[i];
-        var varVertex = new VariableNetworkNode() {Label = name, Weight = nmse[i]};
+        var varVertex = new VariableNetworkNode() { Label = name, Weight = nmse[i] };
+        network.AddVertex(varVertex);
+        if (nmse[i] < nmseThreshold) {
+          targets.Add(name, nmse[i]);
+        }
+      }
+
+      // rel is updated (impacts which are represented in the network are set to zero)
+      var impacts = variableImpacts.CloneAsMatrix();
+      // make sure the diagonal is not considered
+      for (int i = 0; i < impacts.GetLength(0); i++) impacts[i, i] = double.NegativeInfinity;
+
+
+      for (int row = 0; row < impacts.GetLength(0); row++) {
+        if (!targets.ContainsKey(varNames[row])) continue;
+
+        var rowVector = Enumerable.Range(0, impacts.GetLength(0)).Select(col => impacts[row, col]).ToArray();
+        for (int col = 0; col < rowVector.Length; col++) {
+          double impact = rowVector[col];
+          if (impact > varImpactThreshold) {
+            var srcName = varNames[col];
+            var dstName = varNames[row];
+            var srcVertex = network.Vertices.Single(v => v.Label == srcName);
+            var dstVertex = network.Vertices.Single(v => v.Label == dstName);
+            var arc = network.AddArc(srcVertex, dstVertex);
+            arc.Weight = impact;
+          }
+        }
+      }
+
+      return network;
+    }
+
+    /// <summary>
+      /// Creates a simple network from a matrix of variable impacts (each row represents a target variable, each column represents an input variable)
+      /// For each target variable not more than one row can be defined (no junction nodes are build, cf. FromNmseAndVariableImpacts(..) for building more complex networks).
+      /// The network is acyclic. Values in the diagonal are ignored.
+      /// The algorithm starts with an empty network and incrementally adds next most relevant input variable for each target variable up to a given threshold
+      /// In each iteration cycles are broken by removing the weakest link.
+      /// </summary>
+      /// <param name="nmse">vector of NMSE values for each target variable</param>
+      /// <param name="variableImpacts">Variable impacts (smaller is lower impact). Row names and columns names should be set</param>
+      /// <param name="nmseThreshold">Threshold for NMSE values. Variables with a NMSE value larger than the threshold are considered as independent variables</param>
+      /// <param name="varImpactThreshold">Threshold for variable impact values. Impacts with a value smaller than the threshold are considered as independent</param>
+      /// <returns></returns>
+    public static VariableInteractionNetwork CreateSimpleAcyclicNetwork(double[] nmse, DoubleMatrix variableImpacts, double nmseThreshold = 0.2, double varImpactThreshold = 0.0) {
+      if (variableImpacts.Rows != variableImpacts.Columns) throw new ArgumentException();
+      var network = new VariableInteractionNetwork();
+      var targets = new Dictionary<string, double>();
+      string[] varNames = variableImpacts.RowNames.ToArray();
+      if (nmse.Length != varNames.Length) throw new ArgumentException();
+
+      for (int i = 0; i < varNames.Length; i++) {
+        var name = varNames[i];
+        var varVertex = new VariableNetworkNode() { Label = name, Weight = nmse[i] };
         network.AddVertex(varVertex);
         if (nmse[i] < nmseThreshold) {
@@ -106,5 +149,4 @@
         }
       }
-
       return newArcs;
     }
@@ -351,5 +393,5 @@
         if (arc.Target != null) {
           var srcVarName = arc.Source.Label;
-          var dstVarName = arc.Target.Label;          
+          var dstVarName = arc.Target.Label;
           w[name2idx[dstVarName], name2idx[srcVarName]] = arc.Weight;
         }
@@ -360,6 +402,5 @@
 
     public string ToGraphVizString() {
-      Func<string, string> NodeAndEdgeColor = (str) =>
-      {
+      Func<string, string> NodeAndEdgeColor = (str) => {
         if (string.IsNullOrEmpty(str)) return "black";
         else if (str.Contains("removed")) return "red";
