diff -r c3f93631cd24 -r a5bff2813c4d src/work/marci/bipartite_graph_wrapper_test.cc --- a/src/work/marci/bipartite_graph_wrapper_test.cc Thu Apr 22 20:36:21 2004 +0000 +++ b/src/work/marci/bipartite_graph_wrapper_test.cc Fri Apr 23 07:41:48 2004 +0000 @@ -10,6 +10,8 @@ #include #include #include +#include +#include using namespace hugo; @@ -41,44 +43,35 @@ FOR_EACH_LOC(BGW::EdgeIt, e, bgw) { std::cout << bgw.tail(e) << "->" << bgw.head(e) << std::endl; } -// Graph::NodeMap pred(G); -// Timer ts; -// { -// ts.reset(); -// Graph::NodeMap reached(G); -// reached.set(s, true); -// pred.set(s, INVALID); -// std::queue bfs_queue; -// bfs_queue.push(t); -// while (!bfs_queue.empty()) { -// Node v=bfs_queue.front(); -// bfs_queue.pop(); -// OutEdgeIt e; -// for(G.first(e,v); G.valid(e); G.next(e)) { -// Node w=G.head(e); -// if (!reached[w]) { -// bfs_queue.push(w); -// reached.set(w, true); -// pred.set(w, e); -// } -// } -// } -// std::cout << ts << std::endl; -// } + BGW::NodeMap dbyj(bgw); + BGW::EdgeMap dbyxcj(bgw); -// { -// ts.reset(); -// BfsIterator< Graph, Graph::NodeMap > bfs(G); -// bfs.pushAndSetReached(s); -// pred.set(s, INVALID); -// while (!bfs.finished()) { -// ++bfs; -// if (G.valid(bfs) && bfs.isBNodeNewlyReached()) -// pred.set(bfs.bNode(), bfs); -// } -// std::cout << ts << std::endl; -// } + typedef stGraphWrapper stGW; + stGW stgw(bgw); + ConstMap const1map(1); + stGW::NodeMap ize(stgw); + stGW::EdgeMap flow(stgw); + + BfsIterator< BGW, BGW::NodeMap > bfs(bgw); + Graph::NodeIt si; + Graph::Node s; + s=g.first(si); + bfs.pushAndSetReached(BGW::Node(s)); + while (!bfs.finished()) ++bfs; + + BGW::EdgeMap cap(bgw); + BGW::EdgeMap flow1(bgw); + + typedef ResGraphWrapper< BGW, int, BGW::EdgeMap, BGW::EdgeMap > + RBGW; + RBGW rbgw(bgw, cap, flow1); + RBGW::NodeMap u(rbgw); + + + MaxFlow, stGW::EdgeMap > + max_flow_test(stgw, stgw.S_NODE, stgw.T_NODE, const1map, flow); + max_flow_test.augmentOnShortestPath(); return 0; }