From c84173b661003dbda6f857042ed5a922511ed10c Mon Sep 17 00:00:00 2001 From: smbadiwe <somasystemsng@gmail.com> Date: Wed, 10 Aug 2016 14:17:21 -0700 Subject: [PATCH] 5 Node Expansion Tree constructed. --- MODA.Console/MODA.Console.csproj | 2 + MODA.Console/MODATest.cs | 56 +++ MODA.Console/Program.cs | 52 +- MODA.Console/RecursionHelperTest.cs | 86 ++++ MODA.Impl/ExpansionTreeBuilder.cs | 5 + MODA.Impl/ExpansionTrees/FiveNodes.cs | 456 +++++++++++++++++- MODA.Impl/ExpansionTrees/FourNodes.cs | 121 ++--- MODA.Impl/ExpansionTrees/ThreeNodes.cs | 5 +- MODA.Impl/Extensions.cs | 1 - MODA.Impl/MODA.Impl.csproj | 1 + MODA.Impl/Map.cs | 3 - MODA.Impl/Mapping.cs | 1 - MODA.Impl/ModaAlgorithms.1.cs | 1 - MODA.Impl/ModaAlgorithms.2.Modified.cs | 13 +- MODA.Impl/ModaAlgorithms.3.cs | 1 - MODA.Impl/MySerializer.cs | 9 +- MODA.Impl/RecursionHelper.cs | 100 ++++ QuickGraph.Graphviz/Dot/GraphvizArrow.cs | 1 - .../Dot/GraphvizArrowClipping.cs | 2 - .../Dot/GraphvizArrowFilling.cs | 2 - QuickGraph.Graphviz/Dot/GraphvizArrowShape.cs | 2 - .../Dot/GraphvizClusterMode.cs | 2 - QuickGraph.Graphviz/Dot/GraphvizColor.cs | 2 - QuickGraph.Graphviz/Dot/GraphvizEdge.cs | 3 +- .../Dot/GraphvizEdgeDirection.cs | 2 - .../Dot/GraphvizEdgeExtremity.cs | 4 +- QuickGraph.Graphviz/Dot/GraphvizEdgeLabel.cs | 2 - QuickGraph.Graphviz/Dot/GraphvizEdgeStyle.cs | 2 - QuickGraph.Graphviz/Dot/GraphvizFont.cs | 2 - QuickGraph.Graphviz/Dot/GraphvizGraph.cs | 3 +- QuickGraph.Graphviz/Dot/GraphvizImageType.cs | 3 - .../Dot/GraphvizLabelJustification.cs | 2 - .../Dot/GraphvizLabelLocation.cs | 2 - .../Dot/GraphvizLayerCollection.cs | 3 +- QuickGraph.Graphviz/Dot/GraphvizOutputMode.cs | 2 - .../Dot/GraphvizPageDirection.cs | 2 - QuickGraph.Graphviz/Dot/GraphvizPoint.cs | 6 +- .../Dot/GraphvizRankDirection.cs | 2 - QuickGraph.Graphviz/Dot/GraphvizRatioMode.cs | 2 - QuickGraph.Graphviz/Dot/GraphvizRecord.cs | 1 - QuickGraph.Graphviz/Dot/GraphvizRecordCell.cs | 1 - .../Dot/GraphvizRecordCellCollection.cs | 2 - .../Dot/GraphvizRecordEscaper.cs | 3 +- QuickGraph.Graphviz/Dot/GraphvizSize.cs | 7 +- QuickGraph.Graphviz/Dot/GraphvizVertex.cs | 3 +- .../Dot/GraphvizVertexShape.cs | 2 - .../Dot/GraphvizVertexStyle.cs | 2 - QuickGraph.Graphviz/FormatEdgeEventArgs.cs | 4 +- QuickGraph.Graphviz/FormatVertexEventArgs.cs | 5 +- QuickGraph.Graphviz/GraphRendererBase.cs | 3 +- QuickGraph.Graphviz/GraphvizAlgorithm.cs | 8 +- QuickGraph.Graphviz/GraphvizExtensions.cs | 4 - QuickGraph.Graphviz/IDotEngine.cs | 4 +- .../Properties/AssemblyInfo.cs | 1 - QuickGraph/AdjacencyGraph.cs | 5 +- QuickGraph/Algorithms/AlgorithmBase.cs | 4 +- .../Contracts/IAlgorithmContract.cs | 3 - QuickGraph/Algorithms/IAlgorithm.cs | 6 +- .../Algorithms/IDistanceRecorderAlgorithm.cs | 4 +- .../IEdgePredecessorRecorderAlgorithm.cs | 4 +- .../Algorithms/ITreeBuilderAlgorithm.cs | 4 +- .../Algorithms/IVertexColorizerAlgorithm.cs | 5 +- .../IVertexPredecessorRecorderAlgorithm.cs | 4 +- .../Algorithms/IVertexTimeStamperAlgorithm.cs | 4 +- .../Algorithms/Observers/DisposableAction.cs | 3 - QuickGraph/Algorithms/RootedAlgorithmBase.cs | 6 +- .../Search/BreadthFirstSearchAlgorithm.cs | 10 +- .../Search/DepthFirstSearchAlgorithm.cs | 4 +- .../Services/IAlgorithmComponent.cs | 6 +- .../Algorithms/Services/IAlgorithmServices.cs | 5 +- .../Algorithms/Services/ICancelManager.cs | 2 - QuickGraph/Collections/EdgeEdgeDictionary.cs | 1 - QuickGraph/Collections/EdgeList.cs | 1 - QuickGraph/Collections/IQueue.cs | 6 +- QuickGraph/Collections/Queue.cs | 1 - .../Collections/VertexEdgeDictionary.cs | 1 - QuickGraph/Collections/VertexList.cs | 2 - QuickGraph/Contracts/IEdgeContract.cs | 4 +- QuickGraph/Contracts/IEdgeSetContract.cs | 4 +- QuickGraph/Contracts/IGraphContract.cs | 4 +- .../Contracts/IImplicitGraphContract.cs | 1 - .../IImplicitUndirectedGraphContract.cs | 1 - .../Contracts/IImplicitVertexSetContract.cs | 5 +- .../Contracts/IIncidenceGraphContract.cs | 1 - QuickGraph/Contracts/IMutableGraphContract.cs | 1 - .../IMutableIncidenceGraphContract.cs | 1 - .../IMutableUndirectedGraphContract.cs | 3 +- .../IMutableVertexAndEdgeSetContract.cs | 3 +- .../IMutableVertexListGraphContract.cs | 1 - .../Contracts/IMutableVertexSetContract.cs | 1 - .../Contracts/IUndirectedEdgeContract.cs | 2 +- .../Contracts/IUndirectedGraphContract.cs | 2 - QuickGraph/Contracts/IVertexSetContract.cs | 1 - QuickGraph/EdgeEdgeEventArgs.cs | 5 +- QuickGraph/EdgeExtensions.cs | 4 +- QuickGraph/EdgePredicate.cs | 3 +- QuickGraph/GraphExtensions.cs | 7 +- QuickGraph/IEdgeListGraph.cs | 4 +- QuickGraph/IEdgeSet.cs | 4 +- QuickGraph/IGraph.cs | 3 +- QuickGraph/IImplicitGraph.cs | 5 +- QuickGraph/IImplicitUndirectedGraph.cs | 3 +- QuickGraph/IImplicitVertexSet.cs | 3 +- QuickGraph/IIncidenceGraph.cs | 3 +- QuickGraph/IMutableEdgeListGraph.cs | 3 +- QuickGraph/IMutableGraph.cs | 4 +- QuickGraph/IMutableIncidenceGraph.cs | 4 +- QuickGraph/IMutableUndirectedGraph.cs | 4 +- QuickGraph/IMutableVertexAndEdgeListGraph.cs | 7 +- QuickGraph/IMutableVertexAndEdgeSet.cs | 5 +- QuickGraph/IMutableVertexListGraph.cs | 6 +- QuickGraph/IMutableVertexSet.cs | 3 +- QuickGraph/IUndirectedEdge.cs | 3 +- QuickGraph/IUndirectedGraph.cs | 4 +- QuickGraph/IVertexAndEdgeListGraph.cs | 4 +- QuickGraph/IVertexListGraph.cs | 5 +- QuickGraph/IVertexSet.cs | 4 +- QuickGraph/Properties/AssemblyInfo.cs | 1 - QuickGraph/UndirectedGraph.cs | 5 +- QuickGraph/VertexPredicate.cs | 3 +- 120 files changed, 855 insertions(+), 396 deletions(-) create mode 100644 MODA.Console/MODATest.cs create mode 100644 MODA.Console/RecursionHelperTest.cs create mode 100644 MODA.Impl/RecursionHelper.cs 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 @@ <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> + <Compile Include="MODATest.cs" /> <Compile Include="Program.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="RecursionHelperTest.cs" /> </ItemGroup> <ItemGroup> <None Include="App.config" /> 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<long>.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<int>.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<Edge<string>> BuildFiveNodesTree(this AdjacencyG //Level 0 - Root Node var rootNode = new ExpansionTreeNode<Edge<string>>(); - //Level 1 + #region Level 1 - Three (3) Trees + var qGraphL1_1 = new Edge<string>[] + { + new Edge<string>("A","B"), + new Edge<string>("B","C"), + new Edge<string>("C","D"), + new Edge<string>("D","E") + } + .ToUndirectedGraph<string, Edge<string>>(false); + var qGraphL1_2 = new Edge<string>[] + { + new Edge<string>("A","B"), + new Edge<string>("B","C"), + new Edge<string>("B","D"), + new Edge<string>("B","E") + } + .ToUndirectedGraph<string, Edge<string>>(false); + var qGraphL1_3 = new Edge<string>[] + { + new Edge<string>("A","B"), + new Edge<string>("B","C"), + new Edge<string>("C","D"), + new Edge<string>("C","E") + } + .ToUndirectedGraph<string, Edge<string>>(false); - //Level 2 + var nodeL1_1 = new ExpansionTreeNode<Edge<string>> + { + Level = 1, + QueryGraph = qGraphL1_1, + }; + var nodeL1_2 = new ExpansionTreeNode<Edge<string>> + { + Level = 1, + QueryGraph = qGraphL1_2, + }; + var nodeL1_3 = new ExpansionTreeNode<Edge<string>> + { + Level = 1, + QueryGraph = qGraphL1_3, + }; + expansionTree.AddVerticesAndEdge(new Edge<ExpansionTreeNode<Edge<string>>>(rootNode, nodeL1_1)); + expansionTree.AddVerticesAndEdge(new Edge<ExpansionTreeNode<Edge<string>>>(rootNode, nodeL1_2)); + expansionTree.AddVerticesAndEdge(new Edge<ExpansionTreeNode<Edge<string>>>(rootNode, nodeL1_3)); + #endregion - //Level 3 + #region Level 2 - Five (5) graphs + //From L1_3 + var qGraphL2_3 = new Edge<string>[] + { + new Edge<string>("A","B"), + new Edge<string>("B","C"), + new Edge<string>("C","D"), + new Edge<string>("C","E"), + new Edge<string>("D","E") //New Add + } + .ToUndirectedGraph<string, Edge<string>>(false); + var nodeL2_3 = new ExpansionTreeNode<Edge<string>> + { + Level = 2, + QueryGraph = qGraphL2_3, + }; + expansionTree.AddVerticesAndEdge(new Edge<ExpansionTreeNode<Edge<string>>>(nodeL1_3, nodeL2_3)); - //Level 4 + //From L1_2 + var qGraphL2_2 = new Edge<string>[] + { + new Edge<string>("A","B"), + new Edge<string>("A","E"), //New add + new Edge<string>("B","C"), + new Edge<string>("B","D"), + new Edge<string>("B","E") + } + .ToUndirectedGraph<string, Edge<string>>(false); + var nodeL2_2 = new ExpansionTreeNode<Edge<string>> + { + Level = 2, + QueryGraph = qGraphL2_2, + }; + expansionTree.AddVerticesAndEdge(new Edge<ExpansionTreeNode<Edge<string>>>(nodeL1_2, nodeL2_2)); + + //From L1_1 + var qGraphL2_1a = new Edge<string>[] + { + new Edge<string>("A","B"), + new Edge<string>("B","C"), + new Edge<string>("C","D"), + new Edge<string>("D","E"), + new Edge<string>("E","A") //new Add + } + .ToUndirectedGraph<string, Edge<string>>(false); + var nodeL2_1a = new ExpansionTreeNode<Edge<string>> + { + Level = 2, + QueryGraph = qGraphL2_1a, + }; + expansionTree.AddVerticesAndEdge(new Edge<ExpansionTreeNode<Edge<string>>>(nodeL1_1, nodeL2_1a)); + var qGraphL2_1b = new Edge<string>[] + { + new Edge<string>("A","B"), + new Edge<string>("B","C"), + new Edge<string>("B","D"), //New Add + new Edge<string>("C","D"), + new Edge<string>("D","E"), + } + .ToUndirectedGraph<string, Edge<string>>(false); + var nodeL2_1b = new ExpansionTreeNode<Edge<string>> + { + Level = 2, + QueryGraph = qGraphL2_1b, + }; + expansionTree.AddVerticesAndEdge(new Edge<ExpansionTreeNode<Edge<string>>>(nodeL1_1, nodeL2_1b)); + + var qGraphL2_1c = new Edge<string>[] + { + new Edge<string>("A","B"), + new Edge<string>("B","C"), + new Edge<string>("B","E"), //New Add + new Edge<string>("C","D"), + new Edge<string>("D","E"), + } + .ToUndirectedGraph<string, Edge<string>>(false); + var nodeL2_1c = new ExpansionTreeNode<Edge<string>> + { + Level = 2, + QueryGraph = qGraphL2_1c, + }; + expansionTree.AddVerticesAndEdge(new Edge<ExpansionTreeNode<Edge<string>>>(nodeL1_1, nodeL2_1c)); + #endregion + + #region Level 3 - Three (3) graphs + //From L2_1a + var qGraphL3_1 = new Edge<string>[] + { + new Edge<string>("A","B"), + new Edge<string>("B","C"), + new Edge<string>("C","D"), + new Edge<string>("D","E"), + new Edge<string>("E","A"), + new Edge<string>("E","B") //new Add + } + .ToUndirectedGraph<string, Edge<string>>(false); + var nodeL3_1 = new ExpansionTreeNode<Edge<string>> + { + Level = 3, + QueryGraph = qGraphL3_1, + }; + expansionTree.AddVerticesAndEdge(new Edge<ExpansionTreeNode<Edge<string>>>(nodeL2_1a, nodeL3_1)); + + //From L2_2 + var qGraphL3_2 = new Edge<string>[] + { + new Edge<string>("A","B"), + new Edge<string>("A","E"), + new Edge<string>("B","C"), + new Edge<string>("B","D"), + new Edge<string>("B","E"), + new Edge<string>("C","D") //New add + } + .ToUndirectedGraph<string, Edge<string>>(false); + var nodeL3_2 = new ExpansionTreeNode<Edge<string>> + { + Level = 3, + QueryGraph = qGraphL3_2, + }; + expansionTree.AddVerticesAndEdge(new Edge<ExpansionTreeNode<Edge<string>>>(nodeL2_2, nodeL3_2)); + + //From L2_3 + var qGraphL3_3 = new Edge<string>[] + { + new Edge<string>("A","B"), + new Edge<string>("B","C"), + new Edge<string>("B","D"), //New Add + new Edge<string>("C","D"), + new Edge<string>("C","E"), + new Edge<string>("D","E") + } + .ToUndirectedGraph<string, Edge<string>>(false); + var nodeL3_3 = new ExpansionTreeNode<Edge<string>> + { + Level = 3, + QueryGraph = qGraphL3_3, + }; + expansionTree.AddVerticesAndEdge(new Edge<ExpansionTreeNode<Edge<string>>>(nodeL2_3, nodeL3_3)); + + #endregion + + #region Level 4 - Three (3) graphs + //From L3_1 + var qGraphL4_1 = new Edge<string>[] + { + new Edge<string>("A","B"), + new Edge<string>("B","C"), + new Edge<string>("B","D"), //new Add + new Edge<string>("C","D"), + new Edge<string>("D","E"), + new Edge<string>("E","A"), + new Edge<string>("E","B") + } + .ToUndirectedGraph<string, Edge<string>>(false); + var nodeL4_1 = new ExpansionTreeNode<Edge<string>> + { + Level = 4, + QueryGraph = qGraphL4_1, + }; + expansionTree.AddVerticesAndEdge(new Edge<ExpansionTreeNode<Edge<string>>>(nodeL3_1, nodeL4_1)); + + //From L3_2 + var qGraphL4_2 = new Edge<string>[] + { + new Edge<string>("A","B"), + new Edge<string>("A","E"), + new Edge<string>("B","C"), + new Edge<string>("B","D"), + new Edge<string>("B","E"), + new Edge<string>("C","D"), + new Edge<string>("D","E") //New add + } + .ToUndirectedGraph<string, Edge<string>>(false); + var nodeL4_2 = new ExpansionTreeNode<Edge<string>> + { + Level = 4, + QueryGraph = qGraphL4_2, + }; + expansionTree.AddVerticesAndEdge(new Edge<ExpansionTreeNode<Edge<string>>>(nodeL3_2, nodeL4_2)); + + //From L3_3 + var qGraphL4_3 = new Edge<string>[] + { + new Edge<string>("A","B"), + new Edge<string>("A","E"), //New Add + new Edge<string>("B","C"), + new Edge<string>("B","D"), + new Edge<string>("C","D"), + new Edge<string>("C","E"), + new Edge<string>("D","E") + } + .ToUndirectedGraph<string, Edge<string>>(false); + var nodeL4_3 = new ExpansionTreeNode<Edge<string>> + { + Level = 4, + QueryGraph = qGraphL4_3, + }; + expansionTree.AddVerticesAndEdge(new Edge<ExpansionTreeNode<Edge<string>>>(nodeL3_3, nodeL4_3)); + + #endregion + + #region Level 5 - Three (3) graphs + //From L4_1 + var qGraphL5_1 = new Edge<string>[] + { + new Edge<string>("A","B"), + new Edge<string>("B","C"), + new Edge<string>("B","D"), + new Edge<string>("C","D"), + new Edge<string>("C","E"), //new Add + new Edge<string>("D","E"), + new Edge<string>("E","A"), + new Edge<string>("E","B") + } + .ToUndirectedGraph<string, Edge<string>>(false); + var nodeL5_1 = new ExpansionTreeNode<Edge<string>> + { + Level = 5, + QueryGraph = qGraphL5_1, + }; + expansionTree.AddVerticesAndEdge(new Edge<ExpansionTreeNode<Edge<string>>>(nodeL4_1, nodeL5_1)); + + //From L4_2 + var qGraphL5_2 = new Edge<string>[] + { + new Edge<string>("A","B"), + new Edge<string>("A","C"), //New add + new Edge<string>("A","E"), + new Edge<string>("B","C"), + new Edge<string>("B","D"), + new Edge<string>("B","E"), + new Edge<string>("C","D"), + new Edge<string>("D","E") + } + .ToUndirectedGraph<string, Edge<string>>(false); + var nodeL5_2 = new ExpansionTreeNode<Edge<string>> + { + Level = 5, + QueryGraph = qGraphL5_2, + }; + expansionTree.AddVerticesAndEdge(new Edge<ExpansionTreeNode<Edge<string>>>(nodeL4_2, nodeL5_2)); + + //From L4_3 + var qGraphL5_3 = new Edge<string>[] + { + new Edge<string>("A","B"), + new Edge<string>("A","E"), + new Edge<string>("B","C"), + new Edge<string>("B","D"), + new Edge<string>("B","E"), //New Add + new Edge<string>("C","D"), + new Edge<string>("C","E"), + new Edge<string>("D","E") + } + .ToUndirectedGraph<string, Edge<string>>(false); + var nodeL5_3 = new ExpansionTreeNode<Edge<string>> + { + Level = 5, + QueryGraph = qGraphL5_3, + }; + expansionTree.AddVerticesAndEdge(new Edge<ExpansionTreeNode<Edge<string>>>(nodeL4_3, nodeL5_3)); + + #endregion + + #region Level 6 - Three (3) graphs + //From L5_1 + var qGraphL6_1 = new Edge<string>[] + { + new Edge<string>("A","B"), + new Edge<string>("A","C"), //new Add + new Edge<string>("B","C"), + new Edge<string>("B","D"), + new Edge<string>("C","D"), + new Edge<string>("C","E"), + new Edge<string>("D","E"), + new Edge<string>("E","A"), + new Edge<string>("E","B") + } + .ToUndirectedGraph<string, Edge<string>>(false); + var nodeL6_1 = new ExpansionTreeNode<Edge<string>> + { + Level = 6, + QueryGraph = qGraphL6_1, + }; + expansionTree.AddVerticesAndEdge(new Edge<ExpansionTreeNode<Edge<string>>>(nodeL5_1, nodeL6_1)); + + //From L5_2 + var qGraphL6_2 = new Edge<string>[] + { + new Edge<string>("A","B"), + new Edge<string>("A","C"), + new Edge<string>("A","D"), //New add + new Edge<string>("A","E"), + new Edge<string>("B","C"), + new Edge<string>("B","D"), + new Edge<string>("B","E"), + new Edge<string>("C","D"), + new Edge<string>("D","E") + } + .ToUndirectedGraph<string, Edge<string>>(false); + var nodeL6_2 = new ExpansionTreeNode<Edge<string>> + { + Level = 6, + QueryGraph = qGraphL6_2, + }; + expansionTree.AddVerticesAndEdge(new Edge<ExpansionTreeNode<Edge<string>>>(nodeL5_2, nodeL6_2)); + + //TODO: From L5_3 + var qGraphL6_3 = new Edge<string>[] + { + new Edge<string>("A","B"), + new Edge<string>("A","E"), + new Edge<string>("B","C"), + new Edge<string>("B","D"), + new Edge<string>("B","E"), //New Add + new Edge<string>("C","D"), + new Edge<string>("C","E"), + new Edge<string>("D","E") + } + .ToUndirectedGraph<string, Edge<string>>(false); + var nodeL6_3 = new ExpansionTreeNode<Edge<string>> + { + Level = 6, + QueryGraph = qGraphL6_3, + }; + expansionTree.AddVerticesAndEdge(new Edge<ExpansionTreeNode<Edge<string>>>(nodeL5_3, nodeL6_3)); + + #endregion + + #region Level 7 - One (1) graph, the complete graph + + //From L6_2 + var qGraphL7_1 = new Edge<string>[] + { + new Edge<string>("A","B"), + new Edge<string>("A","C"), + new Edge<string>("A","D"), + new Edge<string>("A","E"), + new Edge<string>("B","C"), + new Edge<string>("B","D"), + new Edge<string>("B","E"), + new Edge<string>("C","D"), + new Edge<string>("C","E"), //New add + new Edge<string>("D","E") + } + .ToUndirectedGraph<string, Edge<string>>(false); + var nodeL7_1 = new ExpansionTreeNode<Edge<string>> + { + Level = 7, + QueryGraph = qGraphL7_1, + }; + expansionTree.AddVerticesAndEdge(new Edge<ExpansionTreeNode<Edge<string>>>(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<Edge<string>> BuildFourNodesTree(this AdjacencyG //Level 0 - Root Node var rootNode = new ExpansionTreeNode<Edge<string>>(); - //Level 1 + #region Level 1 - Two (2) Trees var qGraphL1_1 = new Edge<string>[] - { - new Edge<string>("0","1"), - new Edge<string>("1","2"), - new Edge<string>("2","3") - } - .ToUndirectedGraph<string, Edge<string>>(false); + { + new Edge<string>("A","B"), + new Edge<string>("B","C"), + new Edge<string>("C","D") + } + .ToUndirectedGraph<string, Edge<string>>(false); var qGraphL1_2 = new Edge<string>[] { - new Edge<string>("0","1"), - new Edge<string>("1","2"), - new Edge<string>("1","3") + new Edge<string>("A","B"), + new Edge<string>("B","C"), + new Edge<string>("B","D") } .ToUndirectedGraph<string, Edge<string>>(false); @@ -44,22 +43,23 @@ public static ExpansionTreeNode<Edge<string>> BuildFourNodesTree(this AdjacencyG expansionTree.AddVerticesAndEdge(new Edge<ExpansionTreeNode<Edge<string>>>(rootNode, nodeL1_1)); expansionTree.AddVerticesAndEdge(new Edge<ExpansionTreeNode<Edge<string>>>(rootNode, nodeL1_2)); + #endregion - //Level 2 + #region Level 2 - Two (2) graphs var qGraphL2_1 = new Edge<string>[] - { - new Edge<string>("0","1"), - new Edge<string>("1","2"), - new Edge<string>("1","3"), //New Add; could have been 0-2 - new Edge<string>("2","3") - } - .ToUndirectedGraph<string, Edge<string>>(false); + { + new Edge<string>("A","B"), + new Edge<string>("B","C"), + new Edge<string>("B","D"), //New Add; could have been 0-2 + new Edge<string>("C","D") + } + .ToUndirectedGraph<string, Edge<string>>(false); var qGraphL2_2 = new Edge<string>[] { - new Edge<string>("0","1"), - new Edge<string>("0","3"), //New Add - new Edge<string>("1","2"), - new Edge<string>("2","3") + new Edge<string>("A","B"), + new Edge<string>("A","D"), //New Add + new Edge<string>("B","C"), + new Edge<string>("C","D") } .ToUndirectedGraph<string, Edge<string>>(false); @@ -77,49 +77,37 @@ public static ExpansionTreeNode<Edge<string>> BuildFourNodesTree(this AdjacencyG expansionTree.AddVerticesAndEdge(new Edge<ExpansionTreeNode<Edge<string>>>(nodeL1_1, nodeL2_1)); expansionTree.AddVerticesAndEdge(new Edge<ExpansionTreeNode<Edge<string>>>(nodeL1_1, nodeL2_2)); - //Level 3 - var qGraphL3_1 = new Edge<string>[] - { - new Edge<string>("0","1"), - new Edge<string>("0","2"), //New Add - new Edge<string>("1","2"), - new Edge<string>("1","3"), - new Edge<string>("2","3") - } - .ToUndirectedGraph<string, Edge<string>>(false); - var qGraphL3_2 = new Edge<string>[] - { - new Edge<string>("0","1"), - new Edge<string>("0","3"), - new Edge<string>("1","2"), - new Edge<string>("1","3"), //New Add; could have been 0-2 - new Edge<string>("2","3") - } - .ToUndirectedGraph<string, Edge<string>>(false); + #endregion + #region Level 3 - One (1) graph + var qGraphL3_1 = new Edge<string>[] + { + new Edge<string>("A","B"), + new Edge<string>("A","C"), //New Add + new Edge<string>("B","C"), + new Edge<string>("B","D"), + new Edge<string>("C","D") + } + .ToUndirectedGraph<string, Edge<string>>(false); var nodeL3_1 = new ExpansionTreeNode<Edge<string>> { Level = 3, QueryGraph = qGraphL3_1, }; - var nodeL3_2 = new ExpansionTreeNode<Edge<string>> - { - Level = 3, - QueryGraph = qGraphL3_2, - }; expansionTree.AddVerticesAndEdge(new Edge<ExpansionTreeNode<Edge<string>>>(nodeL2_1, nodeL3_1)); - expansionTree.AddVerticesAndEdge(new Edge<ExpansionTreeNode<Edge<string>>>(nodeL2_2, nodeL3_2)); - //Level 4 + #endregion + + #region Level 4 - One (1) Graph, which is the complete graph var qGraphL4_1 = new Edge<string>[] { - new Edge<string>("0","1"), - new Edge<string>("0","2"), //New Add - new Edge<string>("0","3"), - new Edge<string>("1","2"), - new Edge<string>("1","3"), - new Edge<string>("2","3") + new Edge<string>("A","B"), + new Edge<string>("A","C"), //New Add + new Edge<string>("A","D"), + new Edge<string>("B","C"), + new Edge<string>("B","D"), + new Edge<string>("C","D") } .ToUndirectedGraph<string, Edge<string>>(false); @@ -130,7 +118,28 @@ public static ExpansionTreeNode<Edge<string>> BuildFourNodesTree(this AdjacencyG }; expansionTree.AddVerticesAndEdge(new Edge<ExpansionTreeNode<Edge<string>>>(nodeL3_1, nodeL4_1)); - + #endregion + + #region clean up + + qGraphL1_1 = null; + qGraphL1_2 = null; + nodeL1_1 = null; + nodeL1_2 = null; + + qGraphL2_1 = null; + qGraphL2_2 = null; + nodeL2_1 = null; + nodeL2_2 = null; + + qGraphL3_1 = null; + nodeL3_1 = null; + + qGraphL4_1 = null; + nodeL4_1 = null; + + #endregion + return rootNode; } } diff --git a/MODA.Impl/ExpansionTrees/ThreeNodes.cs b/MODA.Impl/ExpansionTrees/ThreeNodes.cs index 3542824..849b3e9 100644 --- a/MODA.Impl/ExpansionTrees/ThreeNodes.cs +++ b/MODA.Impl/ExpansionTrees/ThreeNodes.cs @@ -1,7 +1,4 @@ -using MODA.Impl.Graphics; -using QuickGraph; -using System.Collections.Generic; -using System.IO; +using QuickGraph; namespace MODA.Impl { diff --git a/MODA.Impl/Extensions.cs b/MODA.Impl/Extensions.cs index 891f847..d816346 100644 --- a/MODA.Impl/Extensions.cs +++ b/MODA.Impl/Extensions.cs @@ -1,5 +1,4 @@ using QuickGraph; -using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; diff --git a/MODA.Impl/MODA.Impl.csproj b/MODA.Impl/MODA.Impl.csproj index d19acfb..b1e3f4d 100644 --- a/MODA.Impl/MODA.Impl.csproj +++ b/MODA.Impl/MODA.Impl.csproj @@ -65,6 +65,7 @@ <Compile Include="ModaAlgorithms.1.cs" /> <Compile Include="MySerializer.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="RecursionHelper.cs" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\QuickGraph.Graphviz\QuickGraph.Graphviz.csproj"> diff --git a/MODA.Impl/Map.cs b/MODA.Impl/Map.cs index 1891731..adb7f3f 100644 --- a/MODA.Impl/Map.cs +++ b/MODA.Impl/Map.cs @@ -1,9 +1,6 @@ using QuickGraph; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace MODA.Impl { diff --git a/MODA.Impl/Mapping.cs b/MODA.Impl/Mapping.cs index c65fafa..1cba20d 100644 --- a/MODA.Impl/Mapping.cs +++ b/MODA.Impl/Mapping.cs @@ -2,7 +2,6 @@ using System; using System.Collections.Generic; using System.Text; -using System.Linq; namespace MODA.Impl { diff --git a/MODA.Impl/ModaAlgorithms.1.cs b/MODA.Impl/ModaAlgorithms.1.cs index d5eaf41..5c8faab 100644 --- a/MODA.Impl/ModaAlgorithms.1.cs +++ b/MODA.Impl/ModaAlgorithms.1.cs @@ -1,5 +1,4 @@ using QuickGraph; -using System; using System.Collections.Generic; using System.IO; diff --git a/MODA.Impl/ModaAlgorithms.2.Modified.cs b/MODA.Impl/ModaAlgorithms.2.Modified.cs index e57c0a4..e7255fd 100644 --- a/MODA.Impl/ModaAlgorithms.2.Modified.cs +++ b/MODA.Impl/ModaAlgorithms.2.Modified.cs @@ -66,6 +66,8 @@ private List<Mapping> Algorithm2_Modified(UndirectedGraph<string, Edge<string>> //Remember: f(h) = g, so h is Domain and g is Range //function, f = new Dictionary<string, string>(1) { { h, g } } var mappings = IsomorphicExtension(new Dictionary<string, string>(1) { { h, g } }, queryGraph_, inputGraph_); + if (mappings.Count == 0) continue; + sw.Stop(); var logGist = new StringBuilder(); logGist.AppendFormat("Maps gotten from IsoExtension.\tTook:\t{0:N}s.\th = {1}. g = {2}\n", sw.Elapsed.ToString(), h, g); @@ -118,6 +120,7 @@ private List<Mapping> Algorithm2_Modified(UndirectedGraph<string, Edge<string>> } Console.WriteLine(sBuilder); + sBuilder = null; Task.WaitAll(tasks.ToArray()); var toReturn = theMappings.SelectMany(x => x.Value).ToList(); @@ -328,10 +331,7 @@ private HashSet<string> ChooseNeighboursOfRange(string[] used_range, UndirectedG local.Remove(local[j - counter]); counter++; } - catch (Exception ex) - { - //throw new ArgumentOutOfRangeException(string.Format("ERROR in 'ChooseNeighboursOfRange' trying to remove from local:\n\t in Index (j - counter) = {0}; j = {1}; counter = {2}; local.Count = {3}.", (j - counter), j, counter, local.Count), ex); - } + catch { } if (local.Count == 0) { break; @@ -404,10 +404,7 @@ private string GetMostConstrainedNeighbour(string[] domain, UndirectedGraph<stri local.Remove(local[j - counter]); counter++; } - catch (Exception ex) - { - //throw new ArgumentOutOfRangeException(string.Format("ERROR in 'GetMostConstrainedNeighbour' trying to remove from local:\n\t in Index (j - counter) = {0}; j = {1}; counter = {2}; local.Count = {3}.", (j - counter), j, counter, local.Count), ex); - } + catch { } if (local.Count == 0) { break; diff --git a/MODA.Impl/ModaAlgorithms.3.cs b/MODA.Impl/ModaAlgorithms.3.cs index 4cccad1..cba1b99 100644 --- a/MODA.Impl/ModaAlgorithms.3.cs +++ b/MODA.Impl/ModaAlgorithms.3.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using System.Text; using System.Threading.Tasks; namespace MODA.Impl diff --git a/MODA.Impl/MySerializer.cs b/MODA.Impl/MySerializer.cs index fde0e45..c0a2eef 100644 --- a/MODA.Impl/MySerializer.cs +++ b/MODA.Impl/MySerializer.cs @@ -1,13 +1,6 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; +using System.IO; using System.Runtime.Serialization.Formatters; using System.Runtime.Serialization.Formatters.Binary; -using System.Text; -using System.Threading.Tasks; -using System.Xml; -using System.Xml.Serialization; namespace MODA.Impl { diff --git a/MODA.Impl/RecursionHelper.cs b/MODA.Impl/RecursionHelper.cs new file mode 100644 index 0000000..ea42653 --- /dev/null +++ b/MODA.Impl/RecursionHelper.cs @@ -0,0 +1,100 @@ +using System; +using System.Collections.Generic; + +namespace MODA.Impl +{ + public class RecursionHelper<T> + { + private readonly List<Tuple<Func<T, T, T>, bool>> _steps = new List<Tuple<Func<T, T, T>, bool>>(); + private readonly Stack<Tuple<T, int>> _stack = new Stack<Tuple<T, int>>(); + private Func<T, bool> _terminationCondition; + private Func<T, T> _terminationOperation; + + /// <summary> + /// Creates a single stack recursion manager. + /// </summary> + /// <typeparam name="TR">Type of item to recurse for</typeparam> + /// <param name="terminateCondition">The terminate condition.</param> + /// <param name="terminationOperation">Operation to run in case termination was true.</param> + /// <returns></returns> + public static RecursionHelper<T> CreateSingular(Func<T, bool> terminateCondition, Func<T, T> terminationOperation = null) + { + var rv = new RecursionHelper<T> + { + _terminationCondition = terminateCondition, + _terminationOperation = terminationOperation + }; + return rv; + } + + public RecursionHelper<T> RecursiveCall(Func<T, T, T> func) + { + addStep(func, true); + return this; + } + + public RecursionHelper<T> Do(Func<T, T, T> func) + { + addStep(func, false); + return this; + } + + public RecursionHelper<T> Do(Action<T, T> action) + { + addStep((i, o) => + { + action(i, o); + return o; + }, false); + return this; + } + + private void addStep(Func<T, T, T> func, bool isRecursive) + { + _steps.Add(Tuple.Create(func, isRecursive)); + } + + public T Execute(T initialItem) + { + var currentItem = initialItem; + var currentResult = default(T); + var currentStep = 0; + while (true) + { + var recursiveContinue = false; + if (currentStep == 0 && _terminationCondition(currentItem)) + { + currentResult = _terminationOperation(currentItem); + } + else + { + for (int index = currentStep; index < _steps.Count; index++) + { + var step = _steps[index]; + if (step.Item2) //Step is recursive + { + _stack.Push(Tuple.Create(currentItem, index + 1)); //Push the current position and value + currentItem = step.Item1(currentItem, currentResult); + recursiveContinue = true; + break; + } + currentResult = step.Item1(currentItem, currentResult); + recursiveContinue = false; + } + } + currentStep = 0; + if (!recursiveContinue) + { + //Once a function has finished it works, pop the stack and continue from where it was before + if (_stack.Count == 0) + { + return currentResult; + } + var stackPopped = _stack.Pop(); + currentItem = stackPopped.Item1; + currentStep = stackPopped.Item2; + } + } + } + } +} diff --git a/QuickGraph.Graphviz/Dot/GraphvizArrow.cs b/QuickGraph.Graphviz/Dot/GraphvizArrow.cs index 53879ef..ba5bce3 100644 --- a/QuickGraph.Graphviz/Dot/GraphvizArrow.cs +++ b/QuickGraph.Graphviz/Dot/GraphvizArrow.cs @@ -1,6 +1,5 @@ namespace QuickGraph.Graphviz.Dot { - using System; using System.IO; public class GraphvizArrow diff --git a/QuickGraph.Graphviz/Dot/GraphvizArrowClipping.cs b/QuickGraph.Graphviz/Dot/GraphvizArrowClipping.cs index 0333905..9fb496d 100644 --- a/QuickGraph.Graphviz/Dot/GraphvizArrowClipping.cs +++ b/QuickGraph.Graphviz/Dot/GraphvizArrowClipping.cs @@ -1,7 +1,5 @@ namespace QuickGraph.Graphviz.Dot { - using System; - public enum GraphvizArrowClipping { None, diff --git a/QuickGraph.Graphviz/Dot/GraphvizArrowFilling.cs b/QuickGraph.Graphviz/Dot/GraphvizArrowFilling.cs index 1534c08..e5a3689 100644 --- a/QuickGraph.Graphviz/Dot/GraphvizArrowFilling.cs +++ b/QuickGraph.Graphviz/Dot/GraphvizArrowFilling.cs @@ -1,7 +1,5 @@ namespace QuickGraph.Graphviz.Dot { - using System; - public enum GraphvizArrowFilling { Close, diff --git a/QuickGraph.Graphviz/Dot/GraphvizArrowShape.cs b/QuickGraph.Graphviz/Dot/GraphvizArrowShape.cs index 6431b0f..fba4fd8 100644 --- a/QuickGraph.Graphviz/Dot/GraphvizArrowShape.cs +++ b/QuickGraph.Graphviz/Dot/GraphvizArrowShape.cs @@ -1,7 +1,5 @@ namespace QuickGraph.Graphviz.Dot { - using System; - public enum GraphvizArrowShape { Box, diff --git a/QuickGraph.Graphviz/Dot/GraphvizClusterMode.cs b/QuickGraph.Graphviz/Dot/GraphvizClusterMode.cs index 0fc6605..177f3b6 100644 --- a/QuickGraph.Graphviz/Dot/GraphvizClusterMode.cs +++ b/QuickGraph.Graphviz/Dot/GraphvizClusterMode.cs @@ -1,7 +1,5 @@ namespace QuickGraph.Graphviz.Dot { - using System; - public enum GraphvizClusterMode { Local, diff --git a/QuickGraph.Graphviz/Dot/GraphvizColor.cs b/QuickGraph.Graphviz/Dot/GraphvizColor.cs index 0be222e..b4ca40f 100644 --- a/QuickGraph.Graphviz/Dot/GraphvizColor.cs +++ b/QuickGraph.Graphviz/Dot/GraphvizColor.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Text; using System.Diagnostics.Contracts; namespace QuickGraph.Graphviz.Dot diff --git a/QuickGraph.Graphviz/Dot/GraphvizEdge.cs b/QuickGraph.Graphviz/Dot/GraphvizEdge.cs index 1180dfe..b291745 100644 --- a/QuickGraph.Graphviz/Dot/GraphvizEdge.cs +++ b/QuickGraph.Graphviz/Dot/GraphvizEdge.cs @@ -1,9 +1,8 @@ namespace QuickGraph.Graphviz.Dot { using System; - using System.Collections; - using System.IO; using System.Collections.Generic; + using System.IO; public class GraphvizEdge { diff --git a/QuickGraph.Graphviz/Dot/GraphvizEdgeDirection.cs b/QuickGraph.Graphviz/Dot/GraphvizEdgeDirection.cs index 7ce4e04..04cfb3e 100644 --- a/QuickGraph.Graphviz/Dot/GraphvizEdgeDirection.cs +++ b/QuickGraph.Graphviz/Dot/GraphvizEdgeDirection.cs @@ -1,7 +1,5 @@ namespace QuickGraph.Graphviz.Dot { - using System; - public enum GraphvizEdgeDirection { None, diff --git a/QuickGraph.Graphviz/Dot/GraphvizEdgeExtremity.cs b/QuickGraph.Graphviz/Dot/GraphvizEdgeExtremity.cs index 10b9081..b6dcad7 100644 --- a/QuickGraph.Graphviz/Dot/GraphvizEdgeExtremity.cs +++ b/QuickGraph.Graphviz/Dot/GraphvizEdgeExtremity.cs @@ -1,9 +1,7 @@ namespace QuickGraph.Graphviz.Dot { - using System; - using System.Collections; - using System.Diagnostics.Contracts; using System.Collections.Generic; + using System.Diagnostics.Contracts; public class GraphvizEdgeExtremity { diff --git a/QuickGraph.Graphviz/Dot/GraphvizEdgeLabel.cs b/QuickGraph.Graphviz/Dot/GraphvizEdgeLabel.cs index d8b0534..81ccbac 100644 --- a/QuickGraph.Graphviz/Dot/GraphvizEdgeLabel.cs +++ b/QuickGraph.Graphviz/Dot/GraphvizEdgeLabel.cs @@ -1,7 +1,5 @@ namespace QuickGraph.Graphviz.Dot { - using System; - using System.Collections; using System.Collections.Generic; public class GraphvizEdgeLabel diff --git a/QuickGraph.Graphviz/Dot/GraphvizEdgeStyle.cs b/QuickGraph.Graphviz/Dot/GraphvizEdgeStyle.cs index 6bf740c..14d5e8b 100644 --- a/QuickGraph.Graphviz/Dot/GraphvizEdgeStyle.cs +++ b/QuickGraph.Graphviz/Dot/GraphvizEdgeStyle.cs @@ -1,7 +1,5 @@ namespace QuickGraph.Graphviz.Dot { - using System; - public enum GraphvizEdgeStyle { Unspecified, diff --git a/QuickGraph.Graphviz/Dot/GraphvizFont.cs b/QuickGraph.Graphviz/Dot/GraphvizFont.cs index f60f96d..9ceae90 100644 --- a/QuickGraph.Graphviz/Dot/GraphvizFont.cs +++ b/QuickGraph.Graphviz/Dot/GraphvizFont.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Text; using System.Diagnostics.Contracts; namespace QuickGraph.Graphviz.Dot diff --git a/QuickGraph.Graphviz/Dot/GraphvizGraph.cs b/QuickGraph.Graphviz/Dot/GraphvizGraph.cs index 4992180..9c138d2 100644 --- a/QuickGraph.Graphviz/Dot/GraphvizGraph.cs +++ b/QuickGraph.Graphviz/Dot/GraphvizGraph.cs @@ -1,9 +1,8 @@ namespace QuickGraph.Graphviz.Dot { using System; - using System.Collections; - using System.IO; using System.Collections.Generic; + using System.IO; public class GraphvizGraph { diff --git a/QuickGraph.Graphviz/Dot/GraphvizImageType.cs b/QuickGraph.Graphviz/Dot/GraphvizImageType.cs index 6139bca..561f14c 100644 --- a/QuickGraph.Graphviz/Dot/GraphvizImageType.cs +++ b/QuickGraph.Graphviz/Dot/GraphvizImageType.cs @@ -1,8 +1,5 @@ namespace QuickGraph.Graphviz.Dot { - using System; - using System.ComponentModel; - public enum GraphvizImageType { /// <summary> diff --git a/QuickGraph.Graphviz/Dot/GraphvizLabelJustification.cs b/QuickGraph.Graphviz/Dot/GraphvizLabelJustification.cs index 4a6c6cc..2b27f38 100644 --- a/QuickGraph.Graphviz/Dot/GraphvizLabelJustification.cs +++ b/QuickGraph.Graphviz/Dot/GraphvizLabelJustification.cs @@ -1,7 +1,5 @@ namespace QuickGraph.Graphviz.Dot { - using System; - public enum GraphvizLabelJustification { L, diff --git a/QuickGraph.Graphviz/Dot/GraphvizLabelLocation.cs b/QuickGraph.Graphviz/Dot/GraphvizLabelLocation.cs index 2b839e6..ef67bb2 100644 --- a/QuickGraph.Graphviz/Dot/GraphvizLabelLocation.cs +++ b/QuickGraph.Graphviz/Dot/GraphvizLabelLocation.cs @@ -1,7 +1,5 @@ namespace QuickGraph.Graphviz.Dot { - using System; - public enum GraphvizLabelLocation { T, diff --git a/QuickGraph.Graphviz/Dot/GraphvizLayerCollection.cs b/QuickGraph.Graphviz/Dot/GraphvizLayerCollection.cs index 60a0d1b..502075f 100644 --- a/QuickGraph.Graphviz/Dot/GraphvizLayerCollection.cs +++ b/QuickGraph.Graphviz/Dot/GraphvizLayerCollection.cs @@ -1,10 +1,9 @@ namespace QuickGraph.Graphviz.Dot { using System; - using System.IO; - using System.Reflection; using System.Collections.ObjectModel; using System.Diagnostics.Contracts; + using System.IO; public class GraphvizLayerCollection : Collection<GraphvizLayer> { diff --git a/QuickGraph.Graphviz/Dot/GraphvizOutputMode.cs b/QuickGraph.Graphviz/Dot/GraphvizOutputMode.cs index b70d863..9e9e313 100644 --- a/QuickGraph.Graphviz/Dot/GraphvizOutputMode.cs +++ b/QuickGraph.Graphviz/Dot/GraphvizOutputMode.cs @@ -1,7 +1,5 @@ namespace QuickGraph.Graphviz.Dot { - using System; - public enum GraphvizOutputMode { BreadthFirst, diff --git a/QuickGraph.Graphviz/Dot/GraphvizPageDirection.cs b/QuickGraph.Graphviz/Dot/GraphvizPageDirection.cs index 92cd444..b93fb6d 100644 --- a/QuickGraph.Graphviz/Dot/GraphvizPageDirection.cs +++ b/QuickGraph.Graphviz/Dot/GraphvizPageDirection.cs @@ -1,7 +1,5 @@ namespace QuickGraph.Graphviz.Dot { - using System; - public enum GraphvizPageDirection { BL, diff --git a/QuickGraph.Graphviz/Dot/GraphvizPoint.cs b/QuickGraph.Graphviz/Dot/GraphvizPoint.cs index eac38e3..d5620a8 100644 --- a/QuickGraph.Graphviz/Dot/GraphvizPoint.cs +++ b/QuickGraph.Graphviz/Dot/GraphvizPoint.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace QuickGraph.Graphviz.Dot +namespace QuickGraph.Graphviz.Dot { public sealed class GraphvizPoint { diff --git a/QuickGraph.Graphviz/Dot/GraphvizRankDirection.cs b/QuickGraph.Graphviz/Dot/GraphvizRankDirection.cs index b6b5927..f74d407 100644 --- a/QuickGraph.Graphviz/Dot/GraphvizRankDirection.cs +++ b/QuickGraph.Graphviz/Dot/GraphvizRankDirection.cs @@ -1,7 +1,5 @@ namespace QuickGraph.Graphviz.Dot { - using System; - public enum GraphvizRankDirection { LR, diff --git a/QuickGraph.Graphviz/Dot/GraphvizRatioMode.cs b/QuickGraph.Graphviz/Dot/GraphvizRatioMode.cs index 50fcff8..d5e5131 100644 --- a/QuickGraph.Graphviz/Dot/GraphvizRatioMode.cs +++ b/QuickGraph.Graphviz/Dot/GraphvizRatioMode.cs @@ -1,7 +1,5 @@ namespace QuickGraph.Graphviz.Dot { - using System; - public enum GraphvizRatioMode { Fill, diff --git a/QuickGraph.Graphviz/Dot/GraphvizRecord.cs b/QuickGraph.Graphviz/Dot/GraphvizRecord.cs index fbe4fa0..d6d4159 100644 --- a/QuickGraph.Graphviz/Dot/GraphvizRecord.cs +++ b/QuickGraph.Graphviz/Dot/GraphvizRecord.cs @@ -1,6 +1,5 @@ namespace QuickGraph.Graphviz.Dot { - using System; using System.Text; public class GraphvizRecord diff --git a/QuickGraph.Graphviz/Dot/GraphvizRecordCell.cs b/QuickGraph.Graphviz/Dot/GraphvizRecordCell.cs index 207d23a..26d9d28 100644 --- a/QuickGraph.Graphviz/Dot/GraphvizRecordCell.cs +++ b/QuickGraph.Graphviz/Dot/GraphvizRecordCell.cs @@ -1,6 +1,5 @@ namespace QuickGraph.Graphviz.Dot { - using System; using System.Text; public class GraphvizRecordCell diff --git a/QuickGraph.Graphviz/Dot/GraphvizRecordCellCollection.cs b/QuickGraph.Graphviz/Dot/GraphvizRecordCellCollection.cs index 810e555..1d30913 100644 --- a/QuickGraph.Graphviz/Dot/GraphvizRecordCellCollection.cs +++ b/QuickGraph.Graphviz/Dot/GraphvizRecordCellCollection.cs @@ -1,7 +1,5 @@ namespace QuickGraph.Graphviz.Dot { - using System; - using System.Reflection; using System.Collections.ObjectModel; public sealed class GraphvizRecordCellCollection : Collection<GraphvizRecordCell> diff --git a/QuickGraph.Graphviz/Dot/GraphvizRecordEscaper.cs b/QuickGraph.Graphviz/Dot/GraphvizRecordEscaper.cs index 1db6fc9..6a572a1 100644 --- a/QuickGraph.Graphviz/Dot/GraphvizRecordEscaper.cs +++ b/QuickGraph.Graphviz/Dot/GraphvizRecordEscaper.cs @@ -1,8 +1,7 @@ namespace QuickGraph.Graphviz.Dot { - using System; - using System.Text.RegularExpressions; using System.Diagnostics.Contracts; + using System.Text.RegularExpressions; public sealed class GraphvizRecordEscaper { diff --git a/QuickGraph.Graphviz/Dot/GraphvizSize.cs b/QuickGraph.Graphviz/Dot/GraphvizSize.cs index 03e6eac..3c47a1b 100644 --- a/QuickGraph.Graphviz/Dot/GraphvizSize.cs +++ b/QuickGraph.Graphviz/Dot/GraphvizSize.cs @@ -1,9 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Globalization; -using System.Diagnostics; +using System.Diagnostics; using System.Diagnostics.Contracts; +using System.Globalization; namespace QuickGraph.Graphviz.Dot { diff --git a/QuickGraph.Graphviz/Dot/GraphvizVertex.cs b/QuickGraph.Graphviz/Dot/GraphvizVertex.cs index 8da5839..5c845c3 100644 --- a/QuickGraph.Graphviz/Dot/GraphvizVertex.cs +++ b/QuickGraph.Graphviz/Dot/GraphvizVertex.cs @@ -1,9 +1,8 @@ namespace QuickGraph.Graphviz.Dot { using System; - using System.Collections; - using System.IO; using System.Collections.Generic; + using System.IO; public class GraphvizVertex { diff --git a/QuickGraph.Graphviz/Dot/GraphvizVertexShape.cs b/QuickGraph.Graphviz/Dot/GraphvizVertexShape.cs index c3fd79b..1b9816a 100644 --- a/QuickGraph.Graphviz/Dot/GraphvizVertexShape.cs +++ b/QuickGraph.Graphviz/Dot/GraphvizVertexShape.cs @@ -1,7 +1,5 @@ namespace QuickGraph.Graphviz.Dot { - using System; - public enum GraphvizVertexShape { Unspecified, diff --git a/QuickGraph.Graphviz/Dot/GraphvizVertexStyle.cs b/QuickGraph.Graphviz/Dot/GraphvizVertexStyle.cs index 3a74d04..74bce94 100644 --- a/QuickGraph.Graphviz/Dot/GraphvizVertexStyle.cs +++ b/QuickGraph.Graphviz/Dot/GraphvizVertexStyle.cs @@ -1,7 +1,5 @@ namespace QuickGraph.Graphviz.Dot { - using System; - public enum GraphvizVertexStyle { Unspecified, diff --git a/QuickGraph.Graphviz/FormatEdgeEventArgs.cs b/QuickGraph.Graphviz/FormatEdgeEventArgs.cs index b68717d..4e4dfa1 100644 --- a/QuickGraph.Graphviz/FormatEdgeEventArgs.cs +++ b/QuickGraph.Graphviz/FormatEdgeEventArgs.cs @@ -1,6 +1,4 @@ -using System; -using QuickGraph.Graphviz.Dot; -using System.Diagnostics.Contracts; +using QuickGraph.Graphviz.Dot; namespace QuickGraph.Graphviz { diff --git a/QuickGraph.Graphviz/FormatVertexEventArgs.cs b/QuickGraph.Graphviz/FormatVertexEventArgs.cs index 5e27d3e..901f3b7 100644 --- a/QuickGraph.Graphviz/FormatVertexEventArgs.cs +++ b/QuickGraph.Graphviz/FormatVertexEventArgs.cs @@ -1,6 +1,5 @@ -using System; -using QuickGraph.Graphviz.Dot; -using System.Diagnostics.Contracts; +using QuickGraph.Graphviz.Dot; +using System; namespace QuickGraph.Graphviz { diff --git a/QuickGraph.Graphviz/GraphRendererBase.cs b/QuickGraph.Graphviz/GraphRendererBase.cs index 4e475da..0128015 100644 --- a/QuickGraph.Graphviz/GraphRendererBase.cs +++ b/QuickGraph.Graphviz/GraphRendererBase.cs @@ -1,5 +1,4 @@ -using System; -using QuickGraph.Graphviz.Dot; +using QuickGraph.Graphviz.Dot; namespace QuickGraph.Graphviz { diff --git a/QuickGraph.Graphviz/GraphvizAlgorithm.cs b/QuickGraph.Graphviz/GraphvizAlgorithm.cs index f57741f..25262bc 100644 --- a/QuickGraph.Graphviz/GraphvizAlgorithm.cs +++ b/QuickGraph.Graphviz/GraphvizAlgorithm.cs @@ -1,9 +1,9 @@ -using System; -using System.IO; -using System.Text.RegularExpressions; +using QuickGraph.Graphviz.Dot; +using System; using System.Collections.Generic; -using QuickGraph.Graphviz.Dot; using System.Diagnostics.Contracts; +using System.IO; +using System.Text.RegularExpressions; namespace QuickGraph.Graphviz { diff --git a/QuickGraph.Graphviz/GraphvizExtensions.cs b/QuickGraph.Graphviz/GraphvizExtensions.cs index 93d773a..74d4be9 100644 --- a/QuickGraph.Graphviz/GraphvizExtensions.cs +++ b/QuickGraph.Graphviz/GraphvizExtensions.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Text; -using System.IO; -using System.Diagnostics.Contracts; namespace QuickGraph.Graphviz { diff --git a/QuickGraph.Graphviz/IDotEngine.cs b/QuickGraph.Graphviz/IDotEngine.cs index 643c893..f0533b8 100644 --- a/QuickGraph.Graphviz/IDotEngine.cs +++ b/QuickGraph.Graphviz/IDotEngine.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Text; using QuickGraph.Graphviz.Dot; +using System; using System.Diagnostics.Contracts; namespace QuickGraph.Graphviz diff --git a/QuickGraph.Graphviz/Properties/AssemblyInfo.cs b/QuickGraph.Graphviz/Properties/AssemblyInfo.cs index 23834e6..3784f22 100644 --- a/QuickGraph.Graphviz/Properties/AssemblyInfo.cs +++ b/QuickGraph.Graphviz/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/QuickGraph/AdjacencyGraph.cs b/QuickGraph/AdjacencyGraph.cs index 9a84b3f..d0ebc12 100644 --- a/QuickGraph/AdjacencyGraph.cs +++ b/QuickGraph/AdjacencyGraph.cs @@ -1,9 +1,8 @@ -using System; +using QuickGraph.Collections; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.Contracts; -using QuickGraph.Contracts; -using QuickGraph.Collections; namespace QuickGraph { diff --git a/QuickGraph/Algorithms/AlgorithmBase.cs b/QuickGraph/Algorithms/AlgorithmBase.cs index 4cf7c10..a5444f4 100644 --- a/QuickGraph/Algorithms/AlgorithmBase.cs +++ b/QuickGraph/Algorithms/AlgorithmBase.cs @@ -1,5 +1,5 @@ -using System; -using QuickGraph.Algorithms.Services; +using QuickGraph.Algorithms.Services; +using System; using System.Collections.Generic; using System.Diagnostics.Contracts; diff --git a/QuickGraph/Algorithms/Contracts/IAlgorithmContract.cs b/QuickGraph/Algorithms/Contracts/IAlgorithmContract.cs index af29bcd..47e095a 100644 --- a/QuickGraph/Algorithms/Contracts/IAlgorithmContract.cs +++ b/QuickGraph/Algorithms/Contracts/IAlgorithmContract.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Diagnostics.Contracts; namespace QuickGraph.Algorithms.Contracts diff --git a/QuickGraph/Algorithms/IAlgorithm.cs b/QuickGraph/Algorithms/IAlgorithm.cs index d66f6f6..779c666 100644 --- a/QuickGraph/Algorithms/IAlgorithm.cs +++ b/QuickGraph/Algorithms/IAlgorithm.cs @@ -1,10 +1,8 @@ -using System; -using QuickGraph.Algorithms.Services; -using System.Diagnostics.Contracts; +using System.Diagnostics.Contracts; namespace QuickGraph.Algorithms { - [ContractClass(typeof(Contracts.IAlgorithmContract<>))] + [ContractClass(typeof(Contracts.IAlgorithmContract<>))] public interface IAlgorithm<TGraph> : IComputation { diff --git a/QuickGraph/Algorithms/IDistanceRecorderAlgorithm.cs b/QuickGraph/Algorithms/IDistanceRecorderAlgorithm.cs index a14721b..cd3732c 100644 --- a/QuickGraph/Algorithms/IDistanceRecorderAlgorithm.cs +++ b/QuickGraph/Algorithms/IDistanceRecorderAlgorithm.cs @@ -1,6 +1,4 @@ -using System; - -namespace QuickGraph.Algorithms +namespace QuickGraph.Algorithms { /// <summary> /// An algorithm that exposes events to compute a distance map between vertices diff --git a/QuickGraph/Algorithms/IEdgePredecessorRecorderAlgorithm.cs b/QuickGraph/Algorithms/IEdgePredecessorRecorderAlgorithm.cs index 0c46d3d..081e4a1 100644 --- a/QuickGraph/Algorithms/IEdgePredecessorRecorderAlgorithm.cs +++ b/QuickGraph/Algorithms/IEdgePredecessorRecorderAlgorithm.cs @@ -1,6 +1,4 @@ -using System; - -namespace QuickGraph.Algorithms +namespace QuickGraph.Algorithms { public interface IEdgePredecessorRecorderAlgorithm<TVertex, TEdge> where TEdge : IEdge<TVertex> diff --git a/QuickGraph/Algorithms/ITreeBuilderAlgorithm.cs b/QuickGraph/Algorithms/ITreeBuilderAlgorithm.cs index 2e56de3..bf54ebe 100644 --- a/QuickGraph/Algorithms/ITreeBuilderAlgorithm.cs +++ b/QuickGraph/Algorithms/ITreeBuilderAlgorithm.cs @@ -1,6 +1,4 @@ -using System; - -namespace QuickGraph.Algorithms +namespace QuickGraph.Algorithms { public interface ITreeBuilderAlgorithm<TVertex,TEdge> where TEdge : IEdge<TVertex> diff --git a/QuickGraph/Algorithms/IVertexColorizerAlgorithm.cs b/QuickGraph/Algorithms/IVertexColorizerAlgorithm.cs index 671552b..9b2da6d 100644 --- a/QuickGraph/Algorithms/IVertexColorizerAlgorithm.cs +++ b/QuickGraph/Algorithms/IVertexColorizerAlgorithm.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; - -namespace QuickGraph.Algorithms +namespace QuickGraph.Algorithms { public interface IVertexColorizerAlgorithm<TVertex,TEdge> where TEdge : IEdge<TVertex> diff --git a/QuickGraph/Algorithms/IVertexPredecessorRecorderAlgorithm.cs b/QuickGraph/Algorithms/IVertexPredecessorRecorderAlgorithm.cs index f540db6..a8fe231 100644 --- a/QuickGraph/Algorithms/IVertexPredecessorRecorderAlgorithm.cs +++ b/QuickGraph/Algorithms/IVertexPredecessorRecorderAlgorithm.cs @@ -1,6 +1,4 @@ -using System; - -namespace QuickGraph.Algorithms +namespace QuickGraph.Algorithms { public interface IVertexPredecessorRecorderAlgorithm<TVertex,TEdge> : ITreeBuilderAlgorithm<TVertex, TEdge> diff --git a/QuickGraph/Algorithms/IVertexTimeStamperAlgorithm.cs b/QuickGraph/Algorithms/IVertexTimeStamperAlgorithm.cs index 7381b4d..a5fc7f7 100644 --- a/QuickGraph/Algorithms/IVertexTimeStamperAlgorithm.cs +++ b/QuickGraph/Algorithms/IVertexTimeStamperAlgorithm.cs @@ -1,6 +1,4 @@ -using System; - -namespace QuickGraph.Algorithms +namespace QuickGraph.Algorithms { public interface IVertexTimeStamperAlgorithm<TVertex,TEdge> where TEdge : IEdge<TVertex> diff --git a/QuickGraph/Algorithms/Observers/DisposableAction.cs b/QuickGraph/Algorithms/Observers/DisposableAction.cs index 56e8399..43f08b7 100644 --- a/QuickGraph/Algorithms/Observers/DisposableAction.cs +++ b/QuickGraph/Algorithms/Observers/DisposableAction.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Diagnostics.Contracts; namespace QuickGraph.Algorithms.Observers diff --git a/QuickGraph/Algorithms/RootedAlgorithmBase.cs b/QuickGraph/Algorithms/RootedAlgorithmBase.cs index c5db86d..169a385 100644 --- a/QuickGraph/Algorithms/RootedAlgorithmBase.cs +++ b/QuickGraph/Algorithms/RootedAlgorithmBase.cs @@ -1,7 +1,7 @@ -using System; -using QuickGraph.Algorithms.Services; -using System.Diagnostics.Contracts; +using QuickGraph.Algorithms.Services; +using System; using System.Collections.Generic; +using System.Diagnostics.Contracts; namespace QuickGraph.Algorithms { diff --git a/QuickGraph/Algorithms/Search/BreadthFirstSearchAlgorithm.cs b/QuickGraph/Algorithms/Search/BreadthFirstSearchAlgorithm.cs index 6e4452a..16691d4 100644 --- a/QuickGraph/Algorithms/Search/BreadthFirstSearchAlgorithm.cs +++ b/QuickGraph/Algorithms/Search/BreadthFirstSearchAlgorithm.cs @@ -1,11 +1,9 @@ -using System; -using System.Collections.Generic; - +using QuickGraph.Algorithms.Services; using QuickGraph.Collections; -using QuickGraph.Algorithms.Observers; -using QuickGraph.Algorithms.Services; -using System.Diagnostics.Contracts; +using System; +using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.Contracts; namespace QuickGraph.Algorithms.Search { diff --git a/QuickGraph/Algorithms/Search/DepthFirstSearchAlgorithm.cs b/QuickGraph/Algorithms/Search/DepthFirstSearchAlgorithm.cs index 6b6a6c3..4db9502 100644 --- a/QuickGraph/Algorithms/Search/DepthFirstSearchAlgorithm.cs +++ b/QuickGraph/Algorithms/Search/DepthFirstSearchAlgorithm.cs @@ -1,6 +1,6 @@ -using System; +using QuickGraph.Algorithms.Services; +using System; using System.Collections.Generic; -using QuickGraph.Algorithms.Services; using System.Diagnostics.Contracts; namespace QuickGraph.Algorithms.Search diff --git a/QuickGraph/Algorithms/Services/IAlgorithmComponent.cs b/QuickGraph/Algorithms/Services/IAlgorithmComponent.cs index 8cac175..f131b24 100644 --- a/QuickGraph/Algorithms/Services/IAlgorithmComponent.cs +++ b/QuickGraph/Algorithms/Services/IAlgorithmComponent.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace QuickGraph.Algorithms.Services +namespace QuickGraph.Algorithms.Services { public interface IAlgorithmComponent { diff --git a/QuickGraph/Algorithms/Services/IAlgorithmServices.cs b/QuickGraph/Algorithms/Services/IAlgorithmServices.cs index bdd269e..100e33c 100644 --- a/QuickGraph/Algorithms/Services/IAlgorithmServices.cs +++ b/QuickGraph/Algorithms/Services/IAlgorithmServices.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Diagnostics.Contracts; +using System.Diagnostics.Contracts; namespace QuickGraph.Algorithms.Services { diff --git a/QuickGraph/Algorithms/Services/ICancelManager.cs b/QuickGraph/Algorithms/Services/ICancelManager.cs index 528a668..77ed8af 100644 --- a/QuickGraph/Algorithms/Services/ICancelManager.cs +++ b/QuickGraph/Algorithms/Services/ICancelManager.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Text; using System.Threading; namespace QuickGraph.Algorithms.Services diff --git a/QuickGraph/Collections/EdgeEdgeDictionary.cs b/QuickGraph/Collections/EdgeEdgeDictionary.cs index 61ab1af..975be34 100644 --- a/QuickGraph/Collections/EdgeEdgeDictionary.cs +++ b/QuickGraph/Collections/EdgeEdgeDictionary.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Text; #if !SILVERLIGHT using System.Runtime.Serialization; #endif diff --git a/QuickGraph/Collections/EdgeList.cs b/QuickGraph/Collections/EdgeList.cs index 6c4b0ea..c544907 100644 --- a/QuickGraph/Collections/EdgeList.cs +++ b/QuickGraph/Collections/EdgeList.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Text; namespace QuickGraph.Collections { diff --git a/QuickGraph/Collections/IQueue.cs b/QuickGraph/Collections/IQueue.cs index 308d981..89d5146 100644 --- a/QuickGraph/Collections/IQueue.cs +++ b/QuickGraph/Collections/IQueue.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace QuickGraph.Collections +namespace QuickGraph.Collections { public interface IQueue<T> { diff --git a/QuickGraph/Collections/Queue.cs b/QuickGraph/Collections/Queue.cs index fbc7dd3..8f715d0 100644 --- a/QuickGraph/Collections/Queue.cs +++ b/QuickGraph/Collections/Queue.cs @@ -1,7 +1,6 @@ namespace QuickGraph.Collections { using System; - using System.Collections.Generic; #if !SILVERLIGHT [Serializable] diff --git a/QuickGraph/Collections/VertexEdgeDictionary.cs b/QuickGraph/Collections/VertexEdgeDictionary.cs index d8ecb20..0bc6196 100644 --- a/QuickGraph/Collections/VertexEdgeDictionary.cs +++ b/QuickGraph/Collections/VertexEdgeDictionary.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Text; #if !SILVERLIGHT using System.Runtime.Serialization; #endif diff --git a/QuickGraph/Collections/VertexList.cs b/QuickGraph/Collections/VertexList.cs index 33cacf4..01bf9c8 100644 --- a/QuickGraph/Collections/VertexList.cs +++ b/QuickGraph/Collections/VertexList.cs @@ -1,8 +1,6 @@ using System; using System.Collections.Generic; -using System.Text; #if !SILVERLIGHT -using System.Runtime.Serialization; #endif namespace QuickGraph.Collections diff --git a/QuickGraph/Contracts/IEdgeContract.cs b/QuickGraph/Contracts/IEdgeContract.cs index 5d37cb7..5855ae5 100644 --- a/QuickGraph/Contracts/IEdgeContract.cs +++ b/QuickGraph/Contracts/IEdgeContract.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.Contracts; +using System.Diagnostics.Contracts; namespace QuickGraph.Contracts { diff --git a/QuickGraph/Contracts/IEdgeSetContract.cs b/QuickGraph/Contracts/IEdgeSetContract.cs index 75d777e..815ceaf 100644 --- a/QuickGraph/Contracts/IEdgeSetContract.cs +++ b/QuickGraph/Contracts/IEdgeSetContract.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Linq; diff --git a/QuickGraph/Contracts/IGraphContract.cs b/QuickGraph/Contracts/IGraphContract.cs index 9be59a6..e3c49bf 100644 --- a/QuickGraph/Contracts/IGraphContract.cs +++ b/QuickGraph/Contracts/IGraphContract.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.Contracts; +using System.Diagnostics.Contracts; namespace QuickGraph.Contracts { diff --git a/QuickGraph/Contracts/IImplicitGraphContract.cs b/QuickGraph/Contracts/IImplicitGraphContract.cs index 19b9a02..1cab077 100644 --- a/QuickGraph/Contracts/IImplicitGraphContract.cs +++ b/QuickGraph/Contracts/IImplicitGraphContract.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Text; using System.Diagnostics.Contracts; using System.Linq; diff --git a/QuickGraph/Contracts/IImplicitUndirectedGraphContract.cs b/QuickGraph/Contracts/IImplicitUndirectedGraphContract.cs index a05cb2f..b24dbcf 100644 --- a/QuickGraph/Contracts/IImplicitUndirectedGraphContract.cs +++ b/QuickGraph/Contracts/IImplicitUndirectedGraphContract.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Text; using System.Diagnostics.Contracts; using System.Linq; diff --git a/QuickGraph/Contracts/IImplicitVertexSetContract.cs b/QuickGraph/Contracts/IImplicitVertexSetContract.cs index 2a93405..2443889 100644 --- a/QuickGraph/Contracts/IImplicitVertexSetContract.cs +++ b/QuickGraph/Contracts/IImplicitVertexSetContract.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Diagnostics.Contracts; +using System.Diagnostics.Contracts; namespace QuickGraph.Contracts { diff --git a/QuickGraph/Contracts/IIncidenceGraphContract.cs b/QuickGraph/Contracts/IIncidenceGraphContract.cs index ef30636..88a5912 100644 --- a/QuickGraph/Contracts/IIncidenceGraphContract.cs +++ b/QuickGraph/Contracts/IIncidenceGraphContract.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Text; using System.Diagnostics.Contracts; namespace QuickGraph.Contracts diff --git a/QuickGraph/Contracts/IMutableGraphContract.cs b/QuickGraph/Contracts/IMutableGraphContract.cs index 1187d4a..54f92b9 100644 --- a/QuickGraph/Contracts/IMutableGraphContract.cs +++ b/QuickGraph/Contracts/IMutableGraphContract.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Diagnostics.Contracts; namespace QuickGraph.Contracts diff --git a/QuickGraph/Contracts/IMutableIncidenceGraphContract.cs b/QuickGraph/Contracts/IMutableIncidenceGraphContract.cs index 43daf29..7578787 100644 --- a/QuickGraph/Contracts/IMutableIncidenceGraphContract.cs +++ b/QuickGraph/Contracts/IMutableIncidenceGraphContract.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Text; using System.Diagnostics.Contracts; using System.Linq; diff --git a/QuickGraph/Contracts/IMutableUndirectedGraphContract.cs b/QuickGraph/Contracts/IMutableUndirectedGraphContract.cs index 06c4de3..e9e645a 100644 --- a/QuickGraph/Contracts/IMutableUndirectedGraphContract.cs +++ b/QuickGraph/Contracts/IMutableUndirectedGraphContract.cs @@ -1,8 +1,7 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Diagnostics.Contracts; +using System.Linq; namespace QuickGraph.Contracts { diff --git a/QuickGraph/Contracts/IMutableVertexAndEdgeSetContract.cs b/QuickGraph/Contracts/IMutableVertexAndEdgeSetContract.cs index 2b52f75..b5199ac 100644 --- a/QuickGraph/Contracts/IMutableVertexAndEdgeSetContract.cs +++ b/QuickGraph/Contracts/IMutableVertexAndEdgeSetContract.cs @@ -1,8 +1,7 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Diagnostics.Contracts; +using System.Linq; namespace QuickGraph.Contracts { diff --git a/QuickGraph/Contracts/IMutableVertexListGraphContract.cs b/QuickGraph/Contracts/IMutableVertexListGraphContract.cs index 56c8625..4135c29 100644 --- a/QuickGraph/Contracts/IMutableVertexListGraphContract.cs +++ b/QuickGraph/Contracts/IMutableVertexListGraphContract.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Text; using System.Diagnostics.Contracts; namespace QuickGraph.Contracts diff --git a/QuickGraph/Contracts/IMutableVertexSetContract.cs b/QuickGraph/Contracts/IMutableVertexSetContract.cs index 62ce52d..8e19184 100644 --- a/QuickGraph/Contracts/IMutableVertexSetContract.cs +++ b/QuickGraph/Contracts/IMutableVertexSetContract.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Text; using System.Diagnostics.Contracts; using System.Linq; diff --git a/QuickGraph/Contracts/IUndirectedEdgeContract.cs b/QuickGraph/Contracts/IUndirectedEdgeContract.cs index 176a933..822ee03 100644 --- a/QuickGraph/Contracts/IUndirectedEdgeContract.cs +++ b/QuickGraph/Contracts/IUndirectedEdgeContract.cs @@ -1,6 +1,6 @@ using System; -using System.Diagnostics.Contracts; using System.Collections.Generic; +using System.Diagnostics.Contracts; namespace QuickGraph.Contracts { diff --git a/QuickGraph/Contracts/IUndirectedGraphContract.cs b/QuickGraph/Contracts/IUndirectedGraphContract.cs index 00d9425..f43dc5d 100644 --- a/QuickGraph/Contracts/IUndirectedGraphContract.cs +++ b/QuickGraph/Contracts/IUndirectedGraphContract.cs @@ -1,7 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Diagnostics.Contracts; namespace QuickGraph.Contracts diff --git a/QuickGraph/Contracts/IVertexSetContract.cs b/QuickGraph/Contracts/IVertexSetContract.cs index 92fe2a5..05c6eb0 100644 --- a/QuickGraph/Contracts/IVertexSetContract.cs +++ b/QuickGraph/Contracts/IVertexSetContract.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Text; using System.Diagnostics.Contracts; using System.Linq; diff --git a/QuickGraph/EdgeEdgeEventArgs.cs b/QuickGraph/EdgeEdgeEventArgs.cs index e697bf5..01a52b1 100644 --- a/QuickGraph/EdgeEdgeEventArgs.cs +++ b/QuickGraph/EdgeEdgeEventArgs.cs @@ -1,7 +1,4 @@ -using System; -using System.Diagnostics.Contracts; - -namespace QuickGraph +namespace QuickGraph { /// <summary> /// The handler for events involving two edges diff --git a/QuickGraph/EdgeExtensions.cs b/QuickGraph/EdgeExtensions.cs index 71b1a1c..fd031a3 100644 --- a/QuickGraph/EdgeExtensions.cs +++ b/QuickGraph/EdgeExtensions.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Diagnostics.Contracts; -using QuickGraph.Collections; using System.Linq; namespace QuickGraph diff --git a/QuickGraph/EdgePredicate.cs b/QuickGraph/EdgePredicate.cs index ee40aa2..0c85e33 100644 --- a/QuickGraph/EdgePredicate.cs +++ b/QuickGraph/EdgePredicate.cs @@ -1,5 +1,4 @@ -using System; -using System.Diagnostics.Contracts; +using System.Diagnostics.Contracts; namespace QuickGraph { diff --git a/QuickGraph/GraphExtensions.cs b/QuickGraph/GraphExtensions.cs index dcd37ab..4dd0dc0 100644 --- a/QuickGraph/GraphExtensions.cs +++ b/QuickGraph/GraphExtensions.cs @@ -1,10 +1,5 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Text; +using System.Collections.Generic; using System.Diagnostics.Contracts; -using QuickGraph.Collections; -using QuickGraph.Algorithms; using System.Linq; namespace QuickGraph diff --git a/QuickGraph/IEdgeListGraph.cs b/QuickGraph/IEdgeListGraph.cs index 8e0731b..fd6f91f 100644 --- a/QuickGraph/IEdgeListGraph.cs +++ b/QuickGraph/IEdgeListGraph.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; +using QuickGraph.Contracts; using System.Diagnostics.Contracts; -using QuickGraph.Contracts; namespace QuickGraph { diff --git a/QuickGraph/IEdgeSet.cs b/QuickGraph/IEdgeSet.cs index a357987..b81068f 100644 --- a/QuickGraph/IEdgeSet.cs +++ b/QuickGraph/IEdgeSet.cs @@ -1,7 +1,5 @@ -using System; +using QuickGraph.Contracts; using System.Collections.Generic; -using System.Text; -using QuickGraph.Contracts; using System.Diagnostics.Contracts; namespace QuickGraph diff --git a/QuickGraph/IGraph.cs b/QuickGraph/IGraph.cs index 83e6abb..5dc64d6 100644 --- a/QuickGraph/IGraph.cs +++ b/QuickGraph/IGraph.cs @@ -1,6 +1,5 @@ -using System; +using QuickGraph.Contracts; using System.Diagnostics.Contracts; -using QuickGraph.Contracts; namespace QuickGraph { diff --git a/QuickGraph/IImplicitGraph.cs b/QuickGraph/IImplicitGraph.cs index fa4c7f1..87e7132 100644 --- a/QuickGraph/IImplicitGraph.cs +++ b/QuickGraph/IImplicitGraph.cs @@ -1,6 +1,5 @@ -using System; +using QuickGraph.Contracts; using System.Collections.Generic; -using QuickGraph.Contracts; using System.Diagnostics.Contracts; namespace QuickGraph @@ -10,7 +9,7 @@ namespace QuickGraph /// </summary> /// <typeparam name="TVertex">The type of the vertex.</typeparam> /// <typeparam name="TEdge">The type of the edge.</typeparam> - [ContractClass(typeof(IImplicitGraphContract<,>))] + [ContractClass(typeof(IImplicitGraphContract<,>))] public interface IImplicitGraph<TVertex,TEdge> : IGraph<TVertex,TEdge> , IImplicitVertexSet<TVertex> diff --git a/QuickGraph/IImplicitUndirectedGraph.cs b/QuickGraph/IImplicitUndirectedGraph.cs index 9641ea9..a1dbd8c 100644 --- a/QuickGraph/IImplicitUndirectedGraph.cs +++ b/QuickGraph/IImplicitUndirectedGraph.cs @@ -1,7 +1,6 @@ -using System; +using QuickGraph.Contracts; using System.Collections.Generic; using System.Diagnostics.Contracts; -using QuickGraph.Contracts; namespace QuickGraph { diff --git a/QuickGraph/IImplicitVertexSet.cs b/QuickGraph/IImplicitVertexSet.cs index 2b7a4f2..91c7ba9 100644 --- a/QuickGraph/IImplicitVertexSet.cs +++ b/QuickGraph/IImplicitVertexSet.cs @@ -1,6 +1,5 @@ -using System; +using QuickGraph.Contracts; using System.Diagnostics.Contracts; -using QuickGraph.Contracts; namespace QuickGraph { diff --git a/QuickGraph/IIncidenceGraph.cs b/QuickGraph/IIncidenceGraph.cs index d63cccb..27773bc 100644 --- a/QuickGraph/IIncidenceGraph.cs +++ b/QuickGraph/IIncidenceGraph.cs @@ -1,6 +1,5 @@ -using System; +using QuickGraph.Contracts; using System.Collections.Generic; -using QuickGraph.Contracts; using System.Diagnostics.Contracts; namespace QuickGraph diff --git a/QuickGraph/IMutableEdgeListGraph.cs b/QuickGraph/IMutableEdgeListGraph.cs index 52386a4..2112998 100644 --- a/QuickGraph/IMutableEdgeListGraph.cs +++ b/QuickGraph/IMutableEdgeListGraph.cs @@ -1,7 +1,6 @@ -using System; +using QuickGraph.Contracts; using System.Collections.Generic; using System.Diagnostics.Contracts; -using QuickGraph.Contracts; namespace QuickGraph { diff --git a/QuickGraph/IMutableGraph.cs b/QuickGraph/IMutableGraph.cs index 97139f6..c048958 100644 --- a/QuickGraph/IMutableGraph.cs +++ b/QuickGraph/IMutableGraph.cs @@ -1,6 +1,6 @@ -using System; +using QuickGraph.Contracts; +using System; using System.Diagnostics.Contracts; -using QuickGraph.Contracts; namespace QuickGraph { diff --git a/QuickGraph/IMutableIncidenceGraph.cs b/QuickGraph/IMutableIncidenceGraph.cs index 43893f3..bb5ebf2 100644 --- a/QuickGraph/IMutableIncidenceGraph.cs +++ b/QuickGraph/IMutableIncidenceGraph.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; +using QuickGraph.Contracts; using System.Diagnostics.Contracts; -using QuickGraph.Contracts; namespace QuickGraph { diff --git a/QuickGraph/IMutableUndirectedGraph.cs b/QuickGraph/IMutableUndirectedGraph.cs index 859c5c5..b5c704d 100644 --- a/QuickGraph/IMutableUndirectedGraph.cs +++ b/QuickGraph/IMutableUndirectedGraph.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; +using QuickGraph.Contracts; using System.Diagnostics.Contracts; -using QuickGraph.Contracts; namespace QuickGraph { diff --git a/QuickGraph/IMutableVertexAndEdgeListGraph.cs b/QuickGraph/IMutableVertexAndEdgeListGraph.cs index e407f2b..609850b 100644 --- a/QuickGraph/IMutableVertexAndEdgeListGraph.cs +++ b/QuickGraph/IMutableVertexAndEdgeListGraph.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using QuickGraph.Contracts; -using System.Diagnostics.Contracts; - -namespace QuickGraph +namespace QuickGraph { /// <summary> /// A mutable vertex and edge list graph diff --git a/QuickGraph/IMutableVertexAndEdgeSet.cs b/QuickGraph/IMutableVertexAndEdgeSet.cs index 5a66005..a224dff 100644 --- a/QuickGraph/IMutableVertexAndEdgeSet.cs +++ b/QuickGraph/IMutableVertexAndEdgeSet.cs @@ -1,8 +1,5 @@ -using System; +using QuickGraph.Contracts; using System.Collections.Generic; -using System.Linq; -using System.Text; -using QuickGraph.Contracts; using System.Diagnostics.Contracts; namespace QuickGraph diff --git a/QuickGraph/IMutableVertexListGraph.cs b/QuickGraph/IMutableVertexListGraph.cs index 8a9e767..9332fa4 100644 --- a/QuickGraph/IMutableVertexListGraph.cs +++ b/QuickGraph/IMutableVertexListGraph.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; +using QuickGraph.Contracts; using System.Diagnostics.Contracts; -using QuickGraph.Contracts; namespace QuickGraph { @@ -10,7 +8,7 @@ namespace QuickGraph /// </summary> /// <typeparam name="TVertex"></typeparam> /// <typeparam name="TEdge"></typeparam> - [ContractClass(typeof(IMutableVertexListGraphContract<,>))] + [ContractClass(typeof(IMutableVertexListGraphContract<,>))] public interface IMutableVertexListGraph<TVertex, TEdge> : IMutableIncidenceGraph<TVertex, TEdge>, IMutableVertexSet<TVertex> diff --git a/QuickGraph/IMutableVertexSet.cs b/QuickGraph/IMutableVertexSet.cs index ec0b2af..e1d42a6 100644 --- a/QuickGraph/IMutableVertexSet.cs +++ b/QuickGraph/IMutableVertexSet.cs @@ -1,7 +1,6 @@ -using System; +using QuickGraph.Contracts; using System.Collections.Generic; using System.Diagnostics.Contracts; -using QuickGraph.Contracts; namespace QuickGraph { diff --git a/QuickGraph/IUndirectedEdge.cs b/QuickGraph/IUndirectedEdge.cs index b5c1796..29ed60c 100644 --- a/QuickGraph/IUndirectedEdge.cs +++ b/QuickGraph/IUndirectedEdge.cs @@ -1,6 +1,5 @@ -using System; +using QuickGraph.Contracts; using System.Diagnostics.Contracts; -using QuickGraph.Contracts; namespace QuickGraph { diff --git a/QuickGraph/IUndirectedGraph.cs b/QuickGraph/IUndirectedGraph.cs index 80966c7..17ee5d5 100644 --- a/QuickGraph/IUndirectedGraph.cs +++ b/QuickGraph/IUndirectedGraph.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; +using QuickGraph.Contracts; using System.Diagnostics.Contracts; -using QuickGraph.Contracts; namespace QuickGraph { diff --git a/QuickGraph/IVertexAndEdgeListGraph.cs b/QuickGraph/IVertexAndEdgeListGraph.cs index f73bdee..0ca6fff 100644 --- a/QuickGraph/IVertexAndEdgeListGraph.cs +++ b/QuickGraph/IVertexAndEdgeListGraph.cs @@ -1,6 +1,4 @@ -using System; - -namespace QuickGraph +namespace QuickGraph { /// <summary> /// A directed graph where vertices and edges can be enumerated efficiently. diff --git a/QuickGraph/IVertexListGraph.cs b/QuickGraph/IVertexListGraph.cs index 4e6cc92..1ec361a 100644 --- a/QuickGraph/IVertexListGraph.cs +++ b/QuickGraph/IVertexListGraph.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; - -namespace QuickGraph +namespace QuickGraph { /// <summary> /// A directed graph datastructure where out-edges can be traversed, diff --git a/QuickGraph/IVertexSet.cs b/QuickGraph/IVertexSet.cs index da3290e..cc8c2e4 100644 --- a/QuickGraph/IVertexSet.cs +++ b/QuickGraph/IVertexSet.cs @@ -1,8 +1,6 @@ -using System; +using QuickGraph.Contracts; using System.Collections.Generic; -using System.Text; using System.Diagnostics.Contracts; -using QuickGraph.Contracts; namespace QuickGraph { diff --git a/QuickGraph/Properties/AssemblyInfo.cs b/QuickGraph/Properties/AssemblyInfo.cs index ef049ed..0591c3b 100644 --- a/QuickGraph/Properties/AssemblyInfo.cs +++ b/QuickGraph/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/QuickGraph/UndirectedGraph.cs b/QuickGraph/UndirectedGraph.cs index ad7852e..40ba857 100644 --- a/QuickGraph/UndirectedGraph.cs +++ b/QuickGraph/UndirectedGraph.cs @@ -1,9 +1,8 @@ -using System; +using QuickGraph.Collections; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.Contracts; -using QuickGraph.Contracts; -using QuickGraph.Collections; namespace QuickGraph { diff --git a/QuickGraph/VertexPredicate.cs b/QuickGraph/VertexPredicate.cs index db825e9..f7ab328 100644 --- a/QuickGraph/VertexPredicate.cs +++ b/QuickGraph/VertexPredicate.cs @@ -1,5 +1,4 @@ -using System; -using System.Diagnostics.Contracts; +using System.Diagnostics.Contracts; namespace QuickGraph {