Changeset 194:a1680b3c516c in lemon-0.x for src/work
- Timestamp:
- 03/17/04 16:09:48 (21 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@271
- Location:
- src/work
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/edmonds_karp.h
r193 r194 533 533 public: 534 534 typedef typename Graph::Node Node; 535 typedef typename Graph::NodeIt NodeIt; 535 536 typedef typename Graph::Edge Edge; 536 537 typedef typename Graph::EdgeIt EdgeIt; … … 564 565 for(NodeIt s=G->template first<NodeIt>(); G->valid(s); G->next(s)) { 565 566 Number f=0; 566 for(OutEdgeIt e=G->template first<OutEdgeIt>( ); G->valid(e); G->next(e))567 for(OutEdgeIt e=G->template first<OutEdgeIt>(s); G->valid(e); G->next(e)) 567 568 f+=flow->get(e); 568 569 if (f<1) { … … 587 588 free.set(w, res_graph.free(e)); 588 589 } 589 if (T Map(res_graph.head(e))) {590 if (T->get(res_graph.head(e))) { 590 591 n=res_graph.head(e); 591 592 _augment=true; … … 599 600 if (_augment) { 600 601 //Node n=t; 601 Number augment_value=free.get( t);602 Number augment_value=free.get(n); 602 603 while (res_graph.valid(pred.get(n))) { 603 604 AugEdge e=pred.get(n); … … 806 807 } 807 808 } 808 template<typename MutableGraph> void run() {809 //int num_of_augmentations=0;810 //while (augmentOnShortestPath()) {811 while (augmentOnBlockingFlow<MutableGraph>()) {812 //std::cout << ++num_of_augmentations << " ";813 //std::cout<<std::endl;814 }815 } 809 // template<typename MutableGraph> void run() { 810 // //int num_of_augmentations=0; 811 // //while (augmentOnShortestPath()) { 812 // while (augmentOnBlockingFlow<MutableGraph>()) { 813 // //std::cout << ++num_of_augmentations << " "; 814 // //std::cout<<std::endl; 815 // } 816 // } 816 817 Number flowValue() { 817 818 Number a=0; 818 OutEdgeIt e;819 for(G->/*getF*/first(e , s); G->valid(e); G->next(e)) {819 EdgeIt e; 820 for(G->/*getF*/first(e); G->valid(e); G->next(e)) { 820 821 a+=flow->get(e); 821 822 } -
src/work/marci/makefile
r189 r194 10 10 11 11 12 BINARIES = edmonds_karp_demo preflow_demo_leda lg_vs_sg leda_graph_demo leda_bfs_dfs 12 BINARIES = edmonds_karp_demo preflow_demo_leda lg_vs_sg leda_graph_demo leda_bfs_dfs max_bipartite_matching_demo 13 13 #preflow_demo_boost edmonds_karp_demo_boost preflow_demo_jacint preflow_demo_athos edmonds_karp_demo_alpar 14 14 … … 28 28 leda_graph_demo: leda_graph_demo.o 29 29 $(CXX3) -Wall -O -L$(LEDAROOT) -o leda_graph_demo leda_graph_demo.o -lG -lL -lm 30 31 max_bipartite_matching_demo.o: 32 $(CXX3) -Wall -O -I.. -I../alpar -I$(LEDAROOT)/incl -I. -c max_bipartite_matching_demo.cc 33 34 max_bipartite_matching_demo: max_bipartite_matching_demo.o 35 $(CXX3) -Wall -O -L$(LEDAROOT) -o max_bipartite_matching_demo max_bipartite_matching_demo.o -lG -lL -lm 30 36 31 37 leda_bfs_dfs.o: -
src/work/marci/max_bipartite_matching_demo.cc
r192 r194 50 50 typedef Graph::InEdgeIt InEdgeIt; 51 51 52 Node s, t;52 //Node s, t; 53 53 //Graph::EdgeMap<int> cap(G); 54 54 //readDimacsMaxFlow(std::cin, G, s, t, cap); … … 66 66 G.addEdge(s_nodes[random(20)], t_nodes[random(20)]); 67 67 } 68 Graph::NodeMap<bool> s_map ; //false69 Graph::NodeMap<bool> t_map ; //false68 Graph::NodeMap<bool> s_map(G); //false 69 Graph::NodeMap<bool> t_map(G); //false 70 70 71 71 for(int i=0; i<20; ++i) { … … 77 77 std::cout << "on-the-fly max bipartite matching demo on wrapped leda graph..." << std::endl; 78 78 Graph::EdgeMap<int> flow(G); //0 flow 79 Graph::EdgeMap<int> cap acity(G, 1);79 Graph::EdgeMap<int> cap(G, 1); 80 80 81 81 Timer ts;
Note: See TracChangeset
for help on using the changeset viewer.