Exemplo n.º 1
0
 public void ComputeAll()
 {
     foreach (BidirectionalGraph <string, Edge <string> > graph in TestGraphFactory.GetBidirectionalGraphs())
     {
         Compute(graph);
     }
 }
Exemplo n.º 2
0
 public void PrimMinimumSpanningTreeAll()
 {
     foreach (var g in TestGraphFactory.GetUndirectedGraphs())
     {
         Prim(g);
     }
 }
Exemplo n.º 3
0
 public void FloydVsBellmannGraphML()
 {
     foreach (AdjacencyGraph <string, Edge <string> > graph in TestGraphFactory.GetAdjacencyGraphs())
     {
         Compare(graph, e => 1, (g, d) => new BellmanFordShortestPathAlgorithm <string, Edge <string> >(g, d));
     }
 }
 public void AllAdjacencyGraphRoots()
 {
     foreach (AdjacencyGraph <string, Edge <string> > graph in TestGraphFactory.GetAdjacencyGraphs())
     {
         Roots(graph);
     }
 }
Exemplo n.º 5
0
 public void PrimKruskalMinimumSpanningTreeAll()
 {
     foreach (var g in TestGraphFactory.GetUndirectedGraphs())
     {
         this.CompareRoot(g);
     }
 }
Exemplo n.º 6
0
 public void StronglyConnectedCondensation()
 {
     foreach (AdjacencyGraph <string, Edge <string> > graph in TestGraphFactory.GetAdjacencyGraphs_All())
     {
         RunStronglyConnectedCondensationAndCheck(graph);
     }
 }
Exemplo n.º 7
0
 public void SameOutEdgesAll()
 {
     foreach (var g in TestGraphFactory.GetAdjacencyGraphs())
     {
         this.SameOutEdges(g);
     }
 }
 public void SourceFirstTopologicalSort()
 {
     foreach (AdjacencyGraph <string, Edge <string> > graph in TestGraphFactory.GetAdjacencyGraphs_All())
     {
         RunSourceFirstTopologicalSortAndCheck(graph);
     }
 }
Exemplo n.º 9
0
 public void OutDegreeSumEqualsEdgeCountAll()
 {
     foreach (var g in TestGraphFactory.GetBidirectionalGraphs())
     {
         this.OutDegreeSumEqualsEdgeCount(g);
     }
 }
Exemplo n.º 10
0
 public void SortAll()
 {
     foreach (var g in TestGraphFactory.GetAdjacencyGraphs())
     {
         this.Sort(g);
     }
 }
Exemplo n.º 11
0
 public void AllVerticesAugmentor()
 {
     foreach (AdjacencyGraph <string, Edge <string> > graph in TestGraphFactory.GetAdjacencyGraphs_All())
     {
         RunAugmentationAndCheck(graph);
     }
 }
Exemplo n.º 12
0
 public void MultiSourceSinkGraphAugmentor()
 {
     foreach (BidirectionalGraph <string, Edge <string> > graph in TestGraphFactory.GetBidirectionalGraphs_All())
     {
         RunAugmentationAndCheck(graph);
     }
 }
Exemplo n.º 13
0
        public void ToDirectedGraphML_WithFormat()
        {
            foreach (AdjacencyGraph <string, Edge <string> > graph in TestGraphFactory.GetAdjacencyGraphs_All())
            {
                int           formattedNodes = 0;
                int           formattedEdges = 0;
                DirectedGraph directedGraph  = graph.ToDirectedGraphML(
                    graph.GetVertexIdentity(),
                    graph.GetEdgeIdentity(),
                    (vertex, node) =>
                {
                    Assert.IsNotNull(vertex);
                    Assert.IsNotNull(node);
                    ++formattedNodes;
                },
                    (edge, link) =>
                {
                    Assert.IsNotNull(edge);
                    Assert.IsNotNull(link);
                    ++formattedEdges;
                });
                Assert.IsNotNull(graph);

                Assert.AreEqual(graph.VertexCount, formattedNodes);
                Assert.AreEqual(graph.EdgeCount, formattedEdges);
                AssertGraphContentEquivalent(graph, directedGraph);
            }
        }
 public void UndirectedDepthFirstSearchAll()
 {
     foreach (UndirectedGraph <string, Edge <string> > graph in TestGraphFactory.GetUndirectedGraphs())
     {
         RunUndirectedDepthFirstSearchAndCheck(graph);
     }
 }
 public void WeaklyConnectedComponents()
 {
     foreach (AdjacencyGraph <string, Edge <string> > graph in TestGraphFactory.GetAdjacencyGraphs_All())
     {
         RunWeaklyConnectedComponentsAndCheck(graph);
     }
 }
 public void UndirectedDepthFirstSearchAll()
 {
     foreach (var g in TestGraphFactory.GetUndirectedGraphs())
     {
         this.UndirectedDepthFirstSearch(g);
     }
 }
 public void StronglyConnectedComponentAll()
 {
     foreach (AdjacencyGraph <string, Edge <string> > graph in TestGraphFactory.GetAdjacencyGraphs())
     {
         Compute(graph);
     }
 }
Exemplo n.º 18
0
 public void TopologicalSortAll()
 {
     foreach (var g in TestGraphFactory.GetAdjacencyGraphs())
     {
         this.SortCyclic(g);
     }
 }
Exemplo n.º 19
0
 public void SameEdgeCountAll()
 {
     foreach (var g in TestGraphFactory.GetAdjacencyGraphs())
     {
         this.SameEdgeCount(g);
     }
 }
Exemplo n.º 20
0
 public void AdjacentDegreeSumEqualsTwiceEdgeCount()
 {
     foreach (UndirectedGraph <string, Edge <string> > graph in TestGraphFactory.GetUndirectedGraphs_All())
     {
         AssertAdjacentDegreeSumEqualsTwiceEdgeCount(graph);
     }
 }
Exemplo n.º 21
0
 public void UndirectedTopologicalSort()
 {
     foreach (UndirectedGraph <string, Edge <string> > graph in TestGraphFactory.GetUndirectedGraphs_All())
     {
         RunUndirectedTopologicalSortAndCheck(graph, true);
     }
 }
Exemplo n.º 22
0
 public void InDegreeSumEqualsEdgeCount()
 {
     foreach (BidirectionalGraph <string, Edge <string> > graph in TestGraphFactory.GetBidirectionalGraphs_All())
     {
         AssertInDegreeSumEqualsEdgeCount(graph);
     }
 }
Exemplo n.º 23
0
 public void ComputeAll()
 {
     foreach (var g in TestGraphFactory.GetBidirectionalGraphs())
     {
         this.Compute(g);
     }
 }
Exemplo n.º 24
0
 public void KruskalMinimumSpanningTree()
 {
     foreach (UndirectedGraph <string, Edge <string> > graph in TestGraphFactory.GetUndirectedGraphs_All())
     {
         Kruskal(graph);
     }
 }
Exemplo n.º 25
0
 public void KruskalMinimumSpanningTreeAll()
 {
     foreach (var g in TestGraphFactory.GetUndirectedGraphs())
     {
         Kruskal(g);
     }
 }
        public void SourceFirstBidirectionalTopologicalSort_DCT8()
        {
            BidirectionalGraph <string, Edge <string> > graph = TestGraphFactory.LoadBidirectionalGraph(GetGraphFilePath("DCT8.graphml"));

            RunSourceFirstTopologicalSortAndCheck(graph, TopologicalSortDirection.Forward);
            RunSourceFirstTopologicalSortAndCheck(graph, TopologicalSortDirection.Backward);
        }
 public void BestFirstFrontierSearch()
 {
     foreach (BidirectionalGraph <string, Edge <string> > graph in TestGraphFactory.GetBidirectionalGraphs_SlowTests())
     {
         RunAndCheckSearch(graph);
     }
 }
Exemplo n.º 28
0
 public void RandomWalk()
 {
     foreach (AdjacencyGraph <string, Edge <string> > graph in TestGraphFactory.GetAdjacencyGraphs_All())
     {
         RunRandomWalkAndCheck(graph);
     }
 }
Exemplo n.º 29
0
 public void AllAdjacencyGraphRoots()
 {
     foreach (var g in TestGraphFactory.GetAdjacencyGraphs())
     {
         Roots(g);
     }
 }
Exemplo n.º 30
0
 public void FloydVsDijkstraGraphML()
 {
     foreach (AdjacencyGraph <string, Edge <string> > graph in TestGraphFactory.GetAdjacencyGraphs_SlowTests())
     {
         CompareAlgorithms(graph, _ => 1, (g, d) => new DijkstraShortestPathAlgorithm <string, Edge <string> >(g, d));
     }
 }