diff --git a/MODA.Console/MODA.Console.csproj b/MODA.Console/MODA.Console.csproj
index 2988e74..e55ef35 100644
--- a/MODA.Console/MODA.Console.csproj
+++ b/MODA.Console/MODA.Console.csproj
@@ -43,8 +43,10 @@
+
+
diff --git a/MODA.Console/MODATest.cs b/MODA.Console/MODATest.cs
new file mode 100644
index 0000000..737887e
--- /dev/null
+++ b/MODA.Console/MODATest.cs
@@ -0,0 +1,56 @@
+using MODA.Impl;
+using System.Diagnostics;
+using System.IO;
+using System.Text;
+
+namespace MODA.Console
+{
+ public class MODATest
+ {
+ internal static void Run(string[] args)
+ {
+ try
+ {
+ string graphFolder = args[0]; // @"C:\SOMA\Drive\MyUW\Research\Kim\remodaalgorithmimplementation";
+ string filename = args[1]; // "QueryGraph.txt"; // "Ecoli20141001CR_idx.txt";
+ var dotFileFulllName = Path.Combine(graphFolder, filename);
+ int subGraphSize = int.Parse(args[2]);
+ int numIterations = int.Parse(args[3]);
+
+ var sb = new StringBuilder("Processing Graph...");
+ sb.AppendFormat("Network File: {0}\nSub-graph Size: {1}\nNumber of Iterations: {2}\n", dotFileFulllName, subGraphSize, numIterations);
+ sb.AppendLine("==========================================================================\n");
+ System.Console.WriteLine(sb);
+ sb.Clear();
+ for (int i = 0; i < numIterations; i++)
+ {
+ var sw = Stopwatch.StartNew();
+ var newGraphInstance = GraphProcessor.LoadGraph(dotFileFulllName);
+ System.Console.WriteLine("Iteration {0}:\t Network: Nodes - {1}; Edges: {2}\n", (i + 1), newGraphInstance.VertexCount, newGraphInstance.EdgeCount);
+
+ //Visualizer.Visualize(newGraphInstance, dotFileFulllName + ".dot");
+
+ var frequentSubgraphs = new ModaAlgorithms().Algorithm1(newGraphInstance, subGraphSize);
+ sw.Stop();
+ int totalMappings = 0;
+ foreach (var queryGraph in frequentSubgraphs)
+ {
+ sb.AppendFormat("\tSub-graph: {0}\t Mappings: {1}\n", queryGraph.Key.AsString(), queryGraph.Value);
+ totalMappings += queryGraph.Value;
+ }
+ sb.AppendFormat("\nTime Taken: {0} ({1}ms)\t Network: Nodes - {2}; Edges: {3}; Total Mappings found: {4}\n", sw.Elapsed.ToString(), sw.ElapsedMilliseconds.ToString("N"), newGraphInstance.VertexCount, newGraphInstance.EdgeCount, totalMappings);
+ sb.AppendLine("-------------------------------------------\n");
+ newGraphInstance = null;
+ frequentSubgraphs = null;
+ }
+ File.WriteAllText(dotFileFulllName + ".puo", sb.ToString());
+ }
+ catch (System.Exception ex)
+ {
+ System.Console.WriteLine(ex);
+ }
+ System.Console.WriteLine("Done!");
+ System.Console.ReadKey();
+ }
+ }
+}
diff --git a/MODA.Console/Program.cs b/MODA.Console/Program.cs
index 0fefb3f..9d43fb4 100644
--- a/MODA.Console/Program.cs
+++ b/MODA.Console/Program.cs
@@ -1,57 +1,11 @@
-using MODA.Impl;
-using MODA.Impl.Graphics;
-using System.Diagnostics;
-using System.IO;
-using System.Text;
-
-namespace MODA.Console
+namespace MODA.Console
{
class Program
{
static void Main(string[] args)
{
- try
- {
- string graphFolder = args[0]; // @"C:\SOMA\Drive\MyUW\Research\Kim\remodaalgorithmimplementation";
- string filename = args[1]; // "QueryGraph.txt"; // "Ecoli20141001CR_idx.txt";
- var dotFileFulllName = Path.Combine(graphFolder, filename);
- int subGraphSize = int.Parse(args[2]);
- int numIterations = int.Parse(args[3]);
-
- var sb = new StringBuilder("Processing Graph...");
- sb.AppendFormat("Network File: {0}\nSub-graph Size: {1}\nNumber of Iterations: {2}\n", dotFileFulllName, subGraphSize, numIterations);
- sb.AppendLine("==========================================================================\n");
- System.Console.WriteLine(sb);
- sb.Clear();
- for (int i = 0; i < numIterations; i++)
- {
- var sw = Stopwatch.StartNew();
- var newGraphInstance = GraphProcessor.LoadGraph(dotFileFulllName);
- System.Console.WriteLine("Iteration {0}:\t Network: Nodes - {1}; Edges: {2}\n", (i + 1), newGraphInstance.VertexCount, newGraphInstance.EdgeCount);
-
- //Visualizer.Visualize(newGraphInstance, dotFileFulllName + ".dot");
-
- var frequentSubgraphs = new ModaAlgorithms().Algorithm1(newGraphInstance, subGraphSize);
- sw.Stop();
- int totalMappings = 0;
- foreach (var queryGraph in frequentSubgraphs)
- {
- sb.AppendFormat("\tSub-graph: {0}\t Mappings: {1}\n", queryGraph.Key.AsString(), queryGraph.Value);
- totalMappings += queryGraph.Value;
- }
- sb.AppendFormat("\nTime Taken: {0} ({1}ms)\t Network: Nodes - {2}; Edges: {3}; Total Mappings found: {4}\n", sw.Elapsed.ToString(), sw.ElapsedMilliseconds.ToString("N"), newGraphInstance.VertexCount, newGraphInstance.EdgeCount, totalMappings);
- sb.AppendLine("-------------------------------------------\n");
- newGraphInstance = null;
- frequentSubgraphs = null;
- }
- File.WriteAllText(dotFileFulllName + ".puo", sb.ToString());
- }
- catch (System.Exception ex)
- {
- System.Console.WriteLine(ex);
- }
- System.Console.WriteLine("Done!");
- System.Console.ReadKey();
+ MODATest.Run(args);
+ //RecursionHelperTest.Run();
}
}
}
diff --git a/MODA.Console/RecursionHelperTest.cs b/MODA.Console/RecursionHelperTest.cs
new file mode 100644
index 0000000..c309798
--- /dev/null
+++ b/MODA.Console/RecursionHelperTest.cs
@@ -0,0 +1,86 @@
+using MODA.Impl;
+using System.Diagnostics;
+using System.Threading;
+
+namespace MODA.Console
+{
+ public class RecursionHelperTest
+ {
+ public static void Run()
+ {
+ var arr = new[] { 1,5,5,5,5,5, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 };
+ RunRecursionHelper(arr);
+ RunRecursion(arr);
+ System.Console.ReadKey();
+ }
+
+ static void RunRecursion(int[] arr)
+ {
+ var sw = Stopwatch.StartNew();
+
+ var ans = Factorial(20); // Sum(arr);
+
+ sw.Stop();
+ System.Console.WriteLine("RunRecursion done.\n Time taken: {0}s. Ans = {1}", sw.Elapsed, ans);
+ }
+
+ static void RunRecursionHelper(int[] arr)
+ {
+ var sw = Stopwatch.StartNew();
+
+ var ans = FactorialWithHelper(20); // SumWithHelper(arr);
+
+ sw.Stop();
+ System.Console.WriteLine("RunRecursionHelper done.\n Time taken: {0}s. Ans = {1}", sw.Elapsed, ans);
+ }
+
+ static long Factorial(long n)
+ {
+ //This is the termination condition
+ if (n < 2)
+ {
+ //This is the returning value when termination condition is true
+ Thread.Sleep(3000);
+ return 1;
+ }
+
+ //This is the recursive call
+ var fac = Factorial(n - 1);
+
+ //This is the work to do with the current item and the
+ //result of recursive call
+ return n * fac;
+ }
+
+ static long FactorialWithHelper(long n)
+ {
+ return RecursionHelper.CreateSingular(currentParam => currentParam < 2, currentVal => { Thread.Sleep(3000); return 1; })
+ .RecursiveCall((currentParam, rv) => currentParam - 1)
+ .Do((i, rv) => i * rv)
+ .Execute(n);
+ }
+
+ static int Sum(int[] array, int index = 0)
+ {
+ //This is the termination condition
+ if (index >= array.Length)
+ //This is the returning value when termination condition is true
+ return 0;
+
+ //This is the recursive call
+ var sumofrest = Sum(array, index + 1);
+
+ //This is the work to do with the current item and the
+ //result of recursive call
+ return array[index] + sumofrest;
+ }
+
+ static int SumWithHelper(int[] ar)
+ {
+ return RecursionHelper.CreateSingular(i => i >= ar.Length, i => 0)
+ .RecursiveCall((i, rv) => i + 1)
+ .Do((i, rv) => ar[i] + rv)
+ .Execute(0);
+ }
+ }
+}
diff --git a/MODA.Impl/ExpansionTreeBuilder.cs b/MODA.Impl/ExpansionTreeBuilder.cs
index a43512f..48c41b2 100644
--- a/MODA.Impl/ExpansionTreeBuilder.cs
+++ b/MODA.Impl/ExpansionTreeBuilder.cs
@@ -36,6 +36,9 @@ public void Build()
case 3:
rootNode = ExpansionTree.BuildThreeNodesTree();
break;
+ case 5:
+ rootNode = ExpansionTree.BuildFiveNodesTree();
+ break;
case 4:
default:
rootNode = ExpansionTree.BuildFourNodesTree();
@@ -53,6 +56,7 @@ public void Build()
VerticesSorted = bfs.VertexColors;
Graph = bfs.VisitedGraph;
+ bfs = null;
}
else
{
@@ -62,6 +66,7 @@ public void Build()
VerticesSorted = dfs.VertexColors;
Graph = dfs.VisitedGraph;
+ dfs = null;
}
VerticesSorted[rootNode] = GraphColor.White;
}
diff --git a/MODA.Impl/ExpansionTrees/FiveNodes.cs b/MODA.Impl/ExpansionTrees/FiveNodes.cs
index d9247e4..ba8f5a7 100644
--- a/MODA.Impl/ExpansionTrees/FiveNodes.cs
+++ b/MODA.Impl/ExpansionTrees/FiveNodes.cs
@@ -1,5 +1,4 @@
using QuickGraph;
-using System.Collections.Generic;
namespace MODA.Impl
{
@@ -15,15 +14,462 @@ public static ExpansionTreeNode> BuildFiveNodesTree(this AdjacencyG
//Level 0 - Root Node
var rootNode = new ExpansionTreeNode>();
- //Level 1
+ #region Level 1 - Three (3) Trees
+ var qGraphL1_1 = new Edge[]
+ {
+ new Edge("A","B"),
+ new Edge("B","C"),
+ new Edge("C","D"),
+ new Edge("D","E")
+ }
+ .ToUndirectedGraph>(false);
+ var qGraphL1_2 = new Edge[]
+ {
+ new Edge("A","B"),
+ new Edge("B","C"),
+ new Edge("B","D"),
+ new Edge("B","E")
+ }
+ .ToUndirectedGraph>(false);
+ var qGraphL1_3 = new Edge[]
+ {
+ new Edge("A","B"),
+ new Edge("B","C"),
+ new Edge("C","D"),
+ new Edge("C","E")
+ }
+ .ToUndirectedGraph>(false);
- //Level 2
+ var nodeL1_1 = new ExpansionTreeNode>
+ {
+ Level = 1,
+ QueryGraph = qGraphL1_1,
+ };
+ var nodeL1_2 = new ExpansionTreeNode>
+ {
+ Level = 1,
+ QueryGraph = qGraphL1_2,
+ };
+ var nodeL1_3 = new ExpansionTreeNode>
+ {
+ Level = 1,
+ QueryGraph = qGraphL1_3,
+ };
+ expansionTree.AddVerticesAndEdge(new Edge>>(rootNode, nodeL1_1));
+ expansionTree.AddVerticesAndEdge(new Edge>>(rootNode, nodeL1_2));
+ expansionTree.AddVerticesAndEdge(new Edge>>(rootNode, nodeL1_3));
+ #endregion
- //Level 3
+ #region Level 2 - Five (5) graphs
+ //From L1_3
+ var qGraphL2_3 = new Edge[]
+ {
+ new Edge("A","B"),
+ new Edge("B","C"),
+ new Edge("C","D"),
+ new Edge("C","E"),
+ new Edge("D","E") //New Add
+ }
+ .ToUndirectedGraph>(false);
+ var nodeL2_3 = new ExpansionTreeNode>
+ {
+ Level = 2,
+ QueryGraph = qGraphL2_3,
+ };
+ expansionTree.AddVerticesAndEdge(new Edge>>(nodeL1_3, nodeL2_3));
- //Level 4
+ //From L1_2
+ var qGraphL2_2 = new Edge[]
+ {
+ new Edge("A","B"),
+ new Edge("A","E"), //New add
+ new Edge("B","C"),
+ new Edge("B","D"),
+ new Edge("B","E")
+ }
+ .ToUndirectedGraph>(false);
+ var nodeL2_2 = new ExpansionTreeNode>
+ {
+ Level = 2,
+ QueryGraph = qGraphL2_2,
+ };
+ expansionTree.AddVerticesAndEdge(new Edge>>(nodeL1_2, nodeL2_2));
+
+ //From L1_1
+ var qGraphL2_1a = new Edge[]
+ {
+ new Edge("A","B"),
+ new Edge("B","C"),
+ new Edge("C","D"),
+ new Edge("D","E"),
+ new Edge("E","A") //new Add
+ }
+ .ToUndirectedGraph>(false);
+ var nodeL2_1a = new ExpansionTreeNode>
+ {
+ Level = 2,
+ QueryGraph = qGraphL2_1a,
+ };
+ expansionTree.AddVerticesAndEdge(new Edge>>(nodeL1_1, nodeL2_1a));
+ var qGraphL2_1b = new Edge[]
+ {
+ new Edge("A","B"),
+ new Edge("B","C"),
+ new Edge("B","D"), //New Add
+ new Edge("C","D"),
+ new Edge("D","E"),
+ }
+ .ToUndirectedGraph>(false);
+ var nodeL2_1b = new ExpansionTreeNode>
+ {
+ Level = 2,
+ QueryGraph = qGraphL2_1b,
+ };
+ expansionTree.AddVerticesAndEdge(new Edge>>(nodeL1_1, nodeL2_1b));
+
+ var qGraphL2_1c = new Edge[]
+ {
+ new Edge("A","B"),
+ new Edge("B","C"),
+ new Edge("B","E"), //New Add
+ new Edge("C","D"),
+ new Edge("D","E"),
+ }
+ .ToUndirectedGraph>(false);
+ var nodeL2_1c = new ExpansionTreeNode>
+ {
+ Level = 2,
+ QueryGraph = qGraphL2_1c,
+ };
+ expansionTree.AddVerticesAndEdge(new Edge>>(nodeL1_1, nodeL2_1c));
+ #endregion
+
+ #region Level 3 - Three (3) graphs
+ //From L2_1a
+ var qGraphL3_1 = new Edge[]
+ {
+ new Edge("A","B"),
+ new Edge("B","C"),
+ new Edge("C","D"),
+ new Edge("D","E"),
+ new Edge("E","A"),
+ new Edge("E","B") //new Add
+ }
+ .ToUndirectedGraph>(false);
+ var nodeL3_1 = new ExpansionTreeNode>
+ {
+ Level = 3,
+ QueryGraph = qGraphL3_1,
+ };
+ expansionTree.AddVerticesAndEdge(new Edge>>(nodeL2_1a, nodeL3_1));
+
+ //From L2_2
+ var qGraphL3_2 = new Edge[]
+ {
+ new Edge("A","B"),
+ new Edge("A","E"),
+ new Edge("B","C"),
+ new Edge("B","D"),
+ new Edge("B","E"),
+ new Edge("C","D") //New add
+ }
+ .ToUndirectedGraph>(false);
+ var nodeL3_2 = new ExpansionTreeNode>
+ {
+ Level = 3,
+ QueryGraph = qGraphL3_2,
+ };
+ expansionTree.AddVerticesAndEdge(new Edge>>(nodeL2_2, nodeL3_2));
+
+ //From L2_3
+ var qGraphL3_3 = new Edge[]
+ {
+ new Edge("A","B"),
+ new Edge("B","C"),
+ new Edge("B","D"), //New Add
+ new Edge("C","D"),
+ new Edge("C","E"),
+ new Edge("D","E")
+ }
+ .ToUndirectedGraph>(false);
+ var nodeL3_3 = new ExpansionTreeNode>
+ {
+ Level = 3,
+ QueryGraph = qGraphL3_3,
+ };
+ expansionTree.AddVerticesAndEdge(new Edge>>(nodeL2_3, nodeL3_3));
+
+ #endregion
+
+ #region Level 4 - Three (3) graphs
+ //From L3_1
+ var qGraphL4_1 = new Edge[]
+ {
+ new Edge("A","B"),
+ new Edge("B","C"),
+ new Edge("B","D"), //new Add
+ new Edge("C","D"),
+ new Edge("D","E"),
+ new Edge("E","A"),
+ new Edge("E","B")
+ }
+ .ToUndirectedGraph>(false);
+ var nodeL4_1 = new ExpansionTreeNode>
+ {
+ Level = 4,
+ QueryGraph = qGraphL4_1,
+ };
+ expansionTree.AddVerticesAndEdge(new Edge>>(nodeL3_1, nodeL4_1));
+
+ //From L3_2
+ var qGraphL4_2 = new Edge[]
+ {
+ new Edge("A","B"),
+ new Edge("A","E"),
+ new Edge("B","C"),
+ new Edge("B","D"),
+ new Edge("B","E"),
+ new Edge("C","D"),
+ new Edge("D","E") //New add
+ }
+ .ToUndirectedGraph>(false);
+ var nodeL4_2 = new ExpansionTreeNode>
+ {
+ Level = 4,
+ QueryGraph = qGraphL4_2,
+ };
+ expansionTree.AddVerticesAndEdge(new Edge>>(nodeL3_2, nodeL4_2));
+
+ //From L3_3
+ var qGraphL4_3 = new Edge[]
+ {
+ new Edge("A","B"),
+ new Edge("A","E"), //New Add
+ new Edge("B","C"),
+ new Edge("B","D"),
+ new Edge("C","D"),
+ new Edge("C","E"),
+ new Edge("D","E")
+ }
+ .ToUndirectedGraph>(false);
+ var nodeL4_3 = new ExpansionTreeNode>
+ {
+ Level = 4,
+ QueryGraph = qGraphL4_3,
+ };
+ expansionTree.AddVerticesAndEdge(new Edge>>(nodeL3_3, nodeL4_3));
+
+ #endregion
+
+ #region Level 5 - Three (3) graphs
+ //From L4_1
+ var qGraphL5_1 = new Edge[]
+ {
+ new Edge("A","B"),
+ new Edge("B","C"),
+ new Edge("B","D"),
+ new Edge("C","D"),
+ new Edge("C","E"), //new Add
+ new Edge("D","E"),
+ new Edge("E","A"),
+ new Edge("E","B")
+ }
+ .ToUndirectedGraph>(false);
+ var nodeL5_1 = new ExpansionTreeNode>
+ {
+ Level = 5,
+ QueryGraph = qGraphL5_1,
+ };
+ expansionTree.AddVerticesAndEdge(new Edge>>(nodeL4_1, nodeL5_1));
+
+ //From L4_2
+ var qGraphL5_2 = new Edge[]
+ {
+ new Edge("A","B"),
+ new Edge("A","C"), //New add
+ new Edge("A","E"),
+ new Edge("B","C"),
+ new Edge("B","D"),
+ new Edge("B","E"),
+ new Edge("C","D"),
+ new Edge("D","E")
+ }
+ .ToUndirectedGraph>(false);
+ var nodeL5_2 = new ExpansionTreeNode>
+ {
+ Level = 5,
+ QueryGraph = qGraphL5_2,
+ };
+ expansionTree.AddVerticesAndEdge(new Edge>>(nodeL4_2, nodeL5_2));
+
+ //From L4_3
+ var qGraphL5_3 = new Edge[]
+ {
+ new Edge("A","B"),
+ new Edge("A","E"),
+ new Edge("B","C"),
+ new Edge("B","D"),
+ new Edge("B","E"), //New Add
+ new Edge("C","D"),
+ new Edge("C","E"),
+ new Edge("D","E")
+ }
+ .ToUndirectedGraph>(false);
+ var nodeL5_3 = new ExpansionTreeNode>
+ {
+ Level = 5,
+ QueryGraph = qGraphL5_3,
+ };
+ expansionTree.AddVerticesAndEdge(new Edge>>(nodeL4_3, nodeL5_3));
+
+ #endregion
+
+ #region Level 6 - Three (3) graphs
+ //From L5_1
+ var qGraphL6_1 = new Edge[]
+ {
+ new Edge("A","B"),
+ new Edge("A","C"), //new Add
+ new Edge("B","C"),
+ new Edge("B","D"),
+ new Edge("C","D"),
+ new Edge("C","E"),
+ new Edge("D","E"),
+ new Edge("E","A"),
+ new Edge("E","B")
+ }
+ .ToUndirectedGraph>(false);
+ var nodeL6_1 = new ExpansionTreeNode>
+ {
+ Level = 6,
+ QueryGraph = qGraphL6_1,
+ };
+ expansionTree.AddVerticesAndEdge(new Edge>>(nodeL5_1, nodeL6_1));
+
+ //From L5_2
+ var qGraphL6_2 = new Edge[]
+ {
+ new Edge("A","B"),
+ new Edge("A","C"),
+ new Edge("A","D"), //New add
+ new Edge("A","E"),
+ new Edge("B","C"),
+ new Edge("B","D"),
+ new Edge("B","E"),
+ new Edge("C","D"),
+ new Edge("D","E")
+ }
+ .ToUndirectedGraph>(false);
+ var nodeL6_2 = new ExpansionTreeNode>
+ {
+ Level = 6,
+ QueryGraph = qGraphL6_2,
+ };
+ expansionTree.AddVerticesAndEdge(new Edge>>(nodeL5_2, nodeL6_2));
+
+ //TODO: From L5_3
+ var qGraphL6_3 = new Edge[]
+ {
+ new Edge("A","B"),
+ new Edge("A","E"),
+ new Edge("B","C"),
+ new Edge("B","D"),
+ new Edge("B","E"), //New Add
+ new Edge("C","D"),
+ new Edge("C","E"),
+ new Edge("D","E")
+ }
+ .ToUndirectedGraph>(false);
+ var nodeL6_3 = new ExpansionTreeNode>
+ {
+ Level = 6,
+ QueryGraph = qGraphL6_3,
+ };
+ expansionTree.AddVerticesAndEdge(new Edge>>(nodeL5_3, nodeL6_3));
+
+ #endregion
+
+ #region Level 7 - One (1) graph, the complete graph
+
+ //From L6_2
+ var qGraphL7_1 = new Edge[]
+ {
+ new Edge("A","B"),
+ new Edge("A","C"),
+ new Edge("A","D"),
+ new Edge("A","E"),
+ new Edge("B","C"),
+ new Edge("B","D"),
+ new Edge("B","E"),
+ new Edge("C","D"),
+ new Edge("C","E"), //New add
+ new Edge("D","E")
+ }
+ .ToUndirectedGraph>(false);
+ var nodeL7_1 = new ExpansionTreeNode>
+ {
+ Level = 7,
+ QueryGraph = qGraphL7_1,
+ };
+ expansionTree.AddVerticesAndEdge(new Edge>>(nodeL6_2, nodeL7_1));
+
+ #endregion
+
+ #region Clean up
+ //- GC doesn't come quickly and I need to keep memory down. I've learnt my lesson! T
+ // This is optional of course, and can always be taken out
+
+ qGraphL1_1 = null;
+ qGraphL1_2 = null;
+ qGraphL1_3 = null;
+ nodeL1_1 = null;
+ nodeL1_2 = null;
+ nodeL1_3 = null;
+
+ qGraphL2_1a = null;
+ qGraphL2_1b = null;
+ qGraphL2_1c = null;
+ qGraphL2_2 = null;
+ qGraphL2_3 = null;
+ nodeL2_1a = null;
+ nodeL2_1b = null;
+ nodeL2_1c = null;
+ nodeL2_2 = null;
+ nodeL2_3 = null;
+
+ qGraphL3_1 = null;
+ qGraphL3_2 = null;
+ qGraphL3_3 = null;
+ nodeL3_1 = null;
+ nodeL3_2 = null;
+ nodeL3_3 = null;
+
+ qGraphL4_1 = null;
+ qGraphL4_2 = null;
+ qGraphL4_3 = null;
+ nodeL4_1 = null;
+ nodeL4_2 = null;
+ nodeL4_3 = null;
+
+ qGraphL5_1 = null;
+ qGraphL5_2 = null;
+ qGraphL5_3 = null;
+ nodeL5_1 = null;
+ nodeL5_2 = null;
+ nodeL5_3 = null;
+
+ qGraphL6_1 = null;
+ qGraphL6_2 = null;
+ qGraphL6_3 = null;
+ nodeL6_1 = null;
+ nodeL6_2 = null;
+ nodeL6_3 = null;
+
+ qGraphL7_1 = null;
+ nodeL7_1 = null;
+ #endregion
return rootNode;
}
diff --git a/MODA.Impl/ExpansionTrees/FourNodes.cs b/MODA.Impl/ExpansionTrees/FourNodes.cs
index 8c52f3a..06405d9 100644
--- a/MODA.Impl/ExpansionTrees/FourNodes.cs
+++ b/MODA.Impl/ExpansionTrees/FourNodes.cs
@@ -1,5 +1,4 @@
using QuickGraph;
-using System.Collections.Generic;
namespace MODA.Impl
{
@@ -15,19 +14,19 @@ public static ExpansionTreeNode> BuildFourNodesTree(this AdjacencyG
//Level 0 - Root Node
var rootNode = new ExpansionTreeNode>();
- //Level 1
+ #region Level 1 - Two (2) Trees
var qGraphL1_1 = new Edge[]
- {
- new Edge("0","1"),
- new Edge("1","2"),
- new Edge("2","3")
- }
- .ToUndirectedGraph>(false);
+ {
+ new Edge("A","B"),
+ new Edge("B","C"),
+ new Edge("C","D")
+ }
+ .ToUndirectedGraph>(false);
var qGraphL1_2 = new Edge[]
{
- new Edge("0","1"),
- new Edge("1","2"),
- new Edge("1","3")
+ new Edge("A","B"),
+ new Edge("B","C"),
+ new Edge("B","D")
}
.ToUndirectedGraph>(false);
@@ -44,22 +43,23 @@ public static ExpansionTreeNode> BuildFourNodesTree(this AdjacencyG
expansionTree.AddVerticesAndEdge(new Edge>>(rootNode, nodeL1_1));
expansionTree.AddVerticesAndEdge(new Edge>>(rootNode, nodeL1_2));
+ #endregion
- //Level 2
+ #region Level 2 - Two (2) graphs
var qGraphL2_1 = new Edge[]
- {
- new Edge("0","1"),
- new Edge("1","2"),
- new Edge("1","3"), //New Add; could have been 0-2
- new Edge("2","3")
- }
- .ToUndirectedGraph>(false);
+ {
+ new Edge("A","B"),
+ new Edge