Changeset 956:141f9c0db4a3 in lemon for test/connectivity_test.cc
 Timestamp:
 03/06/10 15:35:12 (10 years ago)
 Branch:
 default
 Children:
 957:f802439d2b58, 959:38213abd2911, 1041:f112c18bc304
 Phase:
 public
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

test/connectivity_test.cc
r696 r956 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 200320 095 * Copyright (C) 20032010 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 30 30 typedef ListDigraph Digraph; 31 31 typedef Undirector<Digraph> Graph; 32 33 { 34 Digraph d; 35 Digraph::NodeMap<int> order(d); 36 Graph g(d); 37 32 33 { 34 Digraph d; 35 Digraph::NodeMap<int> order(d); 36 Graph g(d); 37 38 38 check(stronglyConnected(d), "The empty digraph is strongly connected"); 39 39 check(countStronglyConnectedComponents(d) == 0, … … 49 49 check(countBiEdgeConnectedComponents(g) == 0, 50 50 "The empty graph has 0 biedgeconnected component"); 51 51 52 52 check(dag(d), "The empty digraph is DAG."); 53 53 check(checkedTopologicalSort(d, order), "The empty digraph is DAG."); … … 83 83 check(countBiEdgeConnectedComponents(g) == 1, 84 84 "This graph has 1 biedgeconnected component"); 85 85 86 86 check(dag(d), "This digraph is DAG."); 87 87 check(checkedTopologicalSort(d, order), "This digraph is DAG."); … … 102 102 Digraph::NodeMap<int> order(d); 103 103 Graph g(d); 104 104 105 105 Digraph::Node n1 = d.addNode(); 106 106 Digraph::Node n2 = d.addNode(); … … 109 109 Digraph::Node n5 = d.addNode(); 110 110 Digraph::Node n6 = d.addNode(); 111 111 112 112 d.addArc(n1, n3); 113 113 d.addArc(n3, n2); … … 137 137 check(!parallelFree(g), "This graph is not parallelfree."); 138 138 check(!simpleGraph(g), "This graph is not simple."); 139 139 140 140 d.addArc(n3, n3); 141 141 142 142 check(!loopFree(d), "This digraph is not loopfree."); 143 143 check(!loopFree(g), "This graph is not loopfree."); 144 144 check(!simpleGraph(d), "This digraph is not simple."); 145 145 146 146 d.addArc(n3, n2); 147 147 148 148 check(!parallelFree(d), "This digraph is not parallelfree."); 149 149 } 150 150 151 151 { 152 152 Digraph d; 153 153 Digraph::ArcMap<bool> cutarcs(d, false); 154 154 Graph g(d); 155 155 156 156 Digraph::Node n1 = d.addNode(); 157 157 Digraph::Node n2 = d.addNode(); … … 173 173 d.addArc(n6, n7); 174 174 d.addArc(n7, n6); 175 175 176 176 check(!stronglyConnected(d), "This digraph is not strongly connected"); 177 177 check(countStronglyConnectedComponents(d) == 3, … … 236 236 Digraph d; 237 237 Digraph::NodeMap<int> order(d); 238 238 239 239 Digraph::Node belt = d.addNode(); 240 240 Digraph::Node trousers = d.addNode(); … … 256 256 d.addArc(shirt, necktie); 257 257 d.addArc(necktie, coat); 258 258 259 259 check(dag(d), "This digraph is DAG."); 260 260 topologicalSort(d, order); … … 268 268 ListGraph g; 269 269 ListGraph::NodeMap<bool> map(g); 270 270 271 271 ListGraph::Node n1 = g.addNode(); 272 272 ListGraph::Node n2 = g.addNode(); … … 284 284 g.addEdge(n4, n7); 285 285 g.addEdge(n5, n7); 286 286 287 287 check(bipartite(g), "This graph is bipartite"); 288 288 check(bipartitePartitions(g, map), "This graph is bipartite"); 289 289 290 290 check(map[n1] == map[n2] && map[n1] == map[n6] && map[n1] == map[n7], 291 291 "Wrong bipartitePartitions()");
Note: See TracChangeset
for help on using the changeset viewer.