Changeset 379:a5bff2813c4d in lemon0.x for src/work/marci/bipartite_graph_wrapper_test.cc
 Timestamp:
 04/23/04 09:41:48 (20 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@509
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

src/work/marci/bipartite_graph_wrapper_test.cc
r368 r379 11 11 #include <bfs_iterator.h> 12 12 #include <graph_wrapper.h> 13 #include <maps.h> 14 #include <edmonds_karp.h> 13 15 14 16 using namespace hugo; … … 42 44 std::cout << bgw.tail(e) << ">" << bgw.head(e) << std::endl; 43 45 } 44 // Graph::NodeMap<OutEdgeIt> pred(G);45 // Timer ts;46 // {47 // ts.reset();48 // Graph::NodeMap<bool> reached(G);49 // reached.set(s, true);50 // pred.set(s, INVALID);51 // std::queue<Node> bfs_queue;52 // bfs_queue.push(t);53 // while (!bfs_queue.empty()) {54 // Node v=bfs_queue.front();55 // bfs_queue.pop();56 // OutEdgeIt e;57 // for(G.first(e,v); G.valid(e); G.next(e)) {58 // Node w=G.head(e);59 // if (!reached[w]) {60 // bfs_queue.push(w);61 // reached.set(w, true);62 // pred.set(w, e);63 // }64 // }65 // }66 46 67 // std::cout << ts << std::endl;68 // } 47 BGW::NodeMap<int> dbyj(bgw); 48 BGW::EdgeMap<int> dbyxcj(bgw); 69 49 70 // { 71 // ts.reset(); 72 // BfsIterator< Graph, Graph::NodeMap<bool> > bfs(G); 73 // bfs.pushAndSetReached(s); 74 // pred.set(s, INVALID); 75 // while (!bfs.finished()) { 76 // ++bfs; 77 // if (G.valid(bfs) && bfs.isBNodeNewlyReached()) 78 // pred.set(bfs.bNode(), bfs); 79 // } 80 // std::cout << ts << std::endl; 81 // } 50 typedef stGraphWrapper<BGW> stGW; 51 stGW stgw(bgw); 52 ConstMap<stGW::Edge, int> const1map(1); 53 stGW::NodeMap<int> ize(stgw); 54 stGW::EdgeMap<int> flow(stgw); 55 56 BfsIterator< BGW, BGW::NodeMap<bool> > bfs(bgw); 57 Graph::NodeIt si; 58 Graph::Node s; 59 s=g.first(si); 60 bfs.pushAndSetReached(BGW::Node(s)); 61 while (!bfs.finished()) ++bfs; 62 63 BGW::EdgeMap<bool> cap(bgw); 64 BGW::EdgeMap<bool> flow1(bgw); 65 66 typedef ResGraphWrapper< BGW, int, BGW::EdgeMap<bool>, BGW::EdgeMap<bool> > 67 RBGW; 68 RBGW rbgw(bgw, cap, flow1); 69 RBGW::NodeMap<int> u(rbgw); 70 71 72 MaxFlow<stGW, int, ConstMap<stGW::Edge, int>, stGW::EdgeMap<int> > 73 max_flow_test(stgw, stgw.S_NODE, stgw.T_NODE, const1map, flow); 74 max_flow_test.augmentOnShortestPath(); 82 75 83 76 return 0;
Note: See TracChangeset
for help on using the changeset viewer.