diff -r ee5959aa4410 -r c280de819a73 src/work/marci/leda_graph_demo.cc --- a/src/work/marci/leda_graph_demo.cc Sun Apr 17 18:57:22 2005 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,85 +0,0 @@ -// -*- c++ -*- -#include -#include - -#include -#include -#include -#include -#include - -using namespace lemon; - -using std::cout; -using std::endl; - -int main() { - leda::graph g; - typedef LedaGraphWrapper Graph; - Graph G(g); -// G.addNode(); -// G.addNode(); -// std::cout << G.nodeNum() << std::endl; - - typedef Graph::Node Node; - typedef Graph::NodeIt NodeIt; - typedef Graph::Edge Edge; - typedef Graph::EdgeIt EdgeIt; - typedef Graph::OutEdgeIt OutEdgeIt; - typedef Graph::InEdgeIt InEdgeIt; - - Node s, t; - Graph::EdgeMap cap(G); - readDimacsMaxFlow(std::cin, G, s, t, cap); - - -// cout << "bfs and dfs iterator demo on the directed graph" << endl; -// for(NodeIt n=G.first(); G.valid(n); G.next(n)) { -// cout << G.id(n) << ": "; -// cout << "out edges: "; -// for(OutEdgeIt e=G.first(n); G.valid(e); G.next(e)) -// cout << G.id(G.source(e)) << "-" << cap.get(e) << "->" << G.id(G.target(e)) << " "; -// cout << "in edges: "; -// for(InEdgeIt e=G.first(n); G.valid(e); G.next(e)) -// cout << G.id(G.source(e)) << "-" << cap.get(e) << "->" << G.id(G.target(e)) << " "; -// cout << endl; -// } - -// int i=0; -// for(EdgeIt e=G.first(); G.valid(e); G.next(e)) { cap.set(e, i); i+=3; } -// for(EdgeIt e=G.first(); G.valid(e); G.next(e)) { cout << cap.get(e) << " "; } -// cout << endl; - - { - //std::cout << "SmartGraph..." << std::endl; - std::cout << "on-the-fly edmonds karp demo on wrapped leda graph..." << std::endl; - Graph::EdgeMap flow(G); //0 flow - - - Timer ts; - ts.reset(); - - MaxFlow, Graph::EdgeMap > max_flow_test(G, s, t, flow, cap); - //max_flow_test.augmentWithBlockingFlow(); - int i=0; - while (max_flow_test.augmentOnShortestPath()) { -// for(EdgeIt e=G.template first(); e.valid(); ++e) { -// std::cout<<"("<"<(); e.valid(); ++e) { -// std::cout<<"("<"<