67 readNodeMap("label", nid). |
66 readNodeMap("label", nid). |
68 readNodeMap("coordinates_x", cx). |
67 readNodeMap("coordinates_x", cx). |
69 readNodeMap("coordinates_y", cy). |
68 readNodeMap("coordinates_y", cy). |
70 run(); |
69 run(); |
71 |
70 |
72 Circulation<Graph,int> gen(g,lo,up,delta,x); |
71 Circulation<Graph> gen(g,lo,up,delta); |
73 int ret=gen.run(); |
72 bool ret=gen.run(); |
74 if(ret==-1) |
73 if(ret) |
75 { |
74 { |
76 std::cout << "\nA feasible flow has been found.\n"; |
75 std::cout << "\nA feasible flow has been found.\n"; |
77 if(!gen.checkX(x)) std::cerr << "Oops!!!\n"; |
76 if(!gen.checkFlow()) std::cerr << "Oops!!!\n"; |
78 GraphWriter<Graph>("circulation-output.lgf", g). |
77 GraphWriter<Graph>("circulation-output.lgf", g). |
79 writeEdgeMap("lo_cap", lo). |
78 writeEdgeMap("lo_cap", lo). |
80 writeEdgeMap("up_cap", up). |
79 writeEdgeMap("up_cap", up). |
81 writeEdgeMap("flow", x). |
80 writeEdgeMap("flow", gen.flowMap()). |
82 writeNodeMap("delta", delta). |
81 writeNodeMap("delta", delta). |
83 writeEdgeMap("label", eid). |
82 writeEdgeMap("label", eid). |
84 writeNodeMap("label", nid). |
83 writeNodeMap("label", nid). |
85 writeNodeMap("coordinates_x", cx). |
84 writeNodeMap("coordinates_x", cx). |
86 writeNodeMap("coordinates_y", cy). |
85 writeNodeMap("coordinates_y", cy). |
87 run(); |
86 run(); |
88 } |
87 } |
89 else { |
88 else { |
90 std::cout << "\nThere is no such a flow\n"; |
89 std::cout << "\nThere is no such a flow\n"; |
91 Graph::NodeMap<int> bar(g); |
90 Graph::NodeMap<int> bar(g); |
92 gen.barrier(bar,ret); |
91 gen.barrierMap(bar); |
93 if(!gen.checkBarrier(bar)) std::cerr << "Dual Oops!!!\n"; |
92 if(!gen.checkBarrier()) std::cerr << "Dual Oops!!!\n"; |
94 |
93 |
95 GraphWriter<Graph>("circulation-output.lgf", g). |
94 GraphWriter<Graph>("circulation-output.lgf", g). |
96 writeEdgeMap("lo_cap", lo). |
95 writeEdgeMap("lo_cap", lo). |
97 writeEdgeMap("up_cap", up). |
96 writeEdgeMap("up_cap", up). |
98 writeNodeMap("barrier", bar). |
97 writeNodeMap("barrier", bar). |