Changeset 311:6635b11938fe in lemon-0.x for src/work/marci/edmonds_karp.h
- Timestamp:
- 04/06/04 14:00:34 (21 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@429
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/marci/edmonds_karp.h
r303 r311 10 10 #include <invalid.h> 11 11 #include <graph_wrapper.h> 12 #include <maps.h> 12 13 13 14 namespace hugo { … … 354 355 355 356 MG F; 356 typedef SubGraphWrapper<ResGW, DistanceMap<ResGW> > FilterResGW; 357 FilterResGW filter_res_graph(res_graph, dist); 357 ConstMap<typename ResGW::Node, bool> true_map(true); 358 typedef SubGraphWrapper<ResGW, ConstMap<typename ResGW::Node, bool>, 359 DistanceMap<ResGW> > FilterResGW; 360 FilterResGW filter_res_graph(res_graph, true_map, dist); 358 361 typename ResGW::NodeMap<typename MG::Node> res_graph_to_F(res_graph); 359 362 { … … 568 571 569 572 //Subgraph containing the edges on some shortest paths 570 typedef SubGraphWrapper<ResGW, DistanceMap<ResGW> > FilterResGW; 571 FilterResGW filter_res_graph(res_graph, dist); 573 ConstMap<typename ResGW::Node, bool> true_map(true); 574 typedef SubGraphWrapper<ResGW, ConstMap<typename ResGW::Node, bool>, 575 DistanceMap<ResGW> > FilterResGW; 576 FilterResGW filter_res_graph(res_graph, true_map, dist); 572 577 573 578 //Subgraph, which is able to delete edges which are already … … 592 597 593 598 __augment=false; 594 //computing blocking flow with dfs599 //computing blocking flow with dfs 595 600 typedef typename ErasingResGW::NodeMap<bool> BlockingReachedMap; 596 DfsIterator5< ErasingResGW, BlockingReachedMap >597 dfs(erasing_res_graph);601 DfsIterator5< ErasingResGW, BlockingReachedMap > 602 dfs(erasing_res_graph); 598 603 typename ErasingResGW::NodeMap<typename ErasingResGW::OutEdgeIt> 599 604 pred(erasing_res_graph); 600 605 pred.set(s, INVALID); 601 //invalid iterators for sources602 603 typename ErasingResGW::NodeMap<Number> free(erasing_res_graph);606 //invalid iterators for sources 607 608 typename ErasingResGW::NodeMap<Number> free(erasing_res_graph); 604 609 605 610 dfs.pushAndSetReached(s); … … 609 614 /*typename ErasingResGW::OutEdgeIt*/(dfs))) 610 615 { 611 if (dfs.isBNodeNewlyReached()) {616 if (dfs.isBNodeNewlyReached()) { 612 617 613 618 typename ErasingResGW::Node v=erasing_res_graph.aNode(dfs); … … 626 631 break; 627 632 } 628 } else {629 erasing_res_graph.erase(dfs);633 } else { 634 erasing_res_graph.erase(dfs); 630 635 } 631 636 } 632 637 } 633 638 634 if (__augment) {635 typename ErasingResGW::Node n=t;639 if (__augment) { 640 typename ErasingResGW::Node n=t; 636 641 Number augment_value=free[n]; 637 642 while (erasing_res_graph.valid(pred[n])) { … … 641 646 if (res_graph.resCap(e)==0) 642 647 erasing_res_graph.erase(e); 643 644 648 } 649 } 645 650 646 651 } //while (__augment)
Note: See TracChangeset
for help on using the changeset viewer.