equal
deleted
inserted
replaced
25 //ListGraph::EdgeMap<int> flow(G); //0 flow |
25 //ListGraph::EdgeMap<int> flow(G); //0 flow |
26 |
26 |
27 double pre_time=currTime(); |
27 double pre_time=currTime(); |
28 preflow_push_max_flow<ListGraph, int> max_flow_test(G, s, t, cap); |
28 preflow_push_max_flow<ListGraph, int> max_flow_test(G, s, t, cap); |
29 max_flow_test.run(); |
29 max_flow_test.run(); |
30 ListGraph::NodeMap<bool> cut=max_flow_test.mincut(); |
30 ListGraph::NodeMap<bool> cut(G); |
|
31 max_flow_test.mincut(cut); |
31 int cut_value=0; |
32 int cut_value=0; |
32 for(EachEdgeIt e=G.first<EachEdgeIt>(); e.valid(); ++e) { |
33 for(EachEdgeIt e=G.first<EachEdgeIt>(); e.valid(); ++e) { |
33 if (cut.get(G.tail(e)) && !cut.get(G.head(e))) cut_value+=cap.get(e); |
34 if (cut.get(G.tail(e)) && !cut.get(G.head(e))) cut_value+=cap.get(e); |
34 } |
35 } |
35 double post_time=currTime(); |
36 double post_time=currTime(); |
48 //ListGraph::EdgeMap<int> flow(G); //0 flow |
49 //ListGraph::EdgeMap<int> flow(G); //0 flow |
49 |
50 |
50 double pre_time=currTime(); |
51 double pre_time=currTime(); |
51 preflow_push_hl<ListGraph, int> max_flow_test(G, s, t, cap); |
52 preflow_push_hl<ListGraph, int> max_flow_test(G, s, t, cap); |
52 max_flow_test.run(); |
53 max_flow_test.run(); |
53 ListGraph::NodeMap<bool> cut=max_flow_test.mincut(); |
54 ListGraph::NodeMap<bool> cut(G); |
|
55 max_flow_test.mincut(cut); |
54 int cut_value=0; |
56 int cut_value=0; |
55 for(EachEdgeIt e=G.first<EachEdgeIt>(); e.valid(); ++e) { |
57 for(EachEdgeIt e=G.first<EachEdgeIt>(); e.valid(); ++e) { |
56 if (cut.get(G.tail(e)) && !cut.get(G.head(e))) cut_value+=cap.get(e); |
58 if (cut.get(G.tail(e)) && !cut.get(G.head(e))) cut_value+=cap.get(e); |
57 } |
59 } |
58 double post_time=currTime(); |
60 double post_time=currTime(); |