Changeset 1091:9eac00ea588f in lemon-main for test
- Timestamp:
- 08/09/13 14:07:27 (11 years ago)
- Branch:
- default
- Parents:
- 1088:4000b7ef4e01 (diff), 1090:70b199792735 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Phase:
- public
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
test/connectivity_test.cc
r1084 r1091 98 98 check(simpleGraph(g), "This graph is simple."); 99 99 } 100 101 { 102 ListGraph g; 103 ListGraph::NodeMap<bool> map(g); 104 105 ListGraph::Node n1 = g.addNode(); 106 ListGraph::Node n2 = g.addNode(); 107 108 ListGraph::Edge e1 = g.addEdge(n1, n2); 109 ::lemon::ignore_unused_variable_warning(e1); 110 check(biNodeConnected(g), "Graph is bi-node-connected"); 111 112 ListGraph::Node n3 = g.addNode(); 113 ::lemon::ignore_unused_variable_warning(n3); 114 check(!biNodeConnected(g), "Graph is not bi-node-connected"); 115 } 116 100 117 101 118 { -
test/connectivity_test.cc
r1089 r1091 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003-20 095 * Copyright (C) 2003-2010 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 32 33 33 { 34 34 Digraph d; 35 35 Digraph::NodeMap<int> order(d); 36 36 Graph g(d); 37 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 bi-edge-connected component"); 51 51 52 52 check(dag(d), "The empty digraph is DAG."); 53 53 check(checkedTopologicalSort(d, order), "The empty digraph is DAG."); … … 84 84 check(countBiEdgeConnectedComponents(g) == 1, 85 85 "This graph has 1 bi-edge-connected component"); 86 86 87 87 check(dag(d), "This digraph is DAG."); 88 88 check(checkedTopologicalSort(d, order), "This digraph is DAG."); … … 120 120 Digraph::NodeMap<int> order(d); 121 121 Graph g(d); 122 122 123 123 Digraph::Node n1 = d.addNode(); 124 124 Digraph::Node n2 = d.addNode(); … … 127 127 Digraph::Node n5 = d.addNode(); 128 128 Digraph::Node n6 = d.addNode(); 129 129 130 130 d.addArc(n1, n3); 131 131 d.addArc(n3, n2); … … 155 155 check(!parallelFree(g), "This graph is not parallel-free."); 156 156 check(!simpleGraph(g), "This graph is not simple."); 157 157 158 158 d.addArc(n3, n3); 159 159 160 160 check(!loopFree(d), "This digraph is not loop-free."); 161 161 check(!loopFree(g), "This graph is not loop-free."); 162 162 check(!simpleGraph(d), "This digraph is not simple."); 163 163 164 164 d.addArc(n3, n2); 165 165 166 166 check(!parallelFree(d), "This digraph is not parallel-free."); 167 167 } 168 168 169 169 { 170 170 Digraph d; 171 171 Digraph::ArcMap<bool> cutarcs(d, false); 172 172 Graph g(d); 173 173 174 174 Digraph::Node n1 = d.addNode(); 175 175 Digraph::Node n2 = d.addNode(); … … 191 191 d.addArc(n6, n7); 192 192 d.addArc(n7, n6); 193 193 194 194 check(!stronglyConnected(d), "This digraph is not strongly connected"); 195 195 check(countStronglyConnectedComponents(d) == 3, … … 254 254 Digraph d; 255 255 Digraph::NodeMap<int> order(d); 256 256 257 257 Digraph::Node belt = d.addNode(); 258 258 Digraph::Node trousers = d.addNode(); … … 275 275 d.addArc(shirt, necktie); 276 276 d.addArc(necktie, coat); 277 277 278 278 check(dag(d), "This digraph is DAG."); 279 279 topologicalSort(d, order); … … 287 287 ListGraph g; 288 288 ListGraph::NodeMap<bool> map(g); 289 289 290 290 ListGraph::Node n1 = g.addNode(); 291 291 ListGraph::Node n2 = g.addNode(); … … 303 303 g.addEdge(n4, n7); 304 304 g.addEdge(n5, n7); 305 305 306 306 check(bipartite(g), "This graph is bipartite"); 307 307 check(bipartitePartitions(g, map), "This graph is bipartite"); 308 308 309 309 check(map[n1] == map[n2] && map[n1] == map[n6] && map[n1] == map[n7], 310 310 "Wrong bipartitePartitions()");
Note: See TracChangeset
for help on using the changeset viewer.