Bug fix in NetworkSimplex (#234)
authorPeter Kovacs <kpeter@inf.elte.hu>
Fri, 24 Apr 2009 12:22:06 +0200
changeset 613b1811c363299
parent 611 85cb3aa71cce
child 614 19b6f20e0ea2
Bug fix in NetworkSimplex (#234)
lemon/network_simplex.h
     1.1 --- a/lemon/network_simplex.h	Tue Apr 21 15:18:54 2009 +0100
     1.2 +++ b/lemon/network_simplex.h	Fri Apr 24 12:22:06 2009 +0200
     1.3 @@ -1144,6 +1144,7 @@
     1.4  
     1.5        // Run Circulation to check if a feasible solution exists
     1.6        typedef ConstMap<Arc, Flow> ConstArcMap;
     1.7 +      ConstArcMap zero_arc_map(0), inf_arc_map(inf_cap);
     1.8        FlowNodeMap *csup = NULL;
     1.9        bool local_csup = false;
    1.10        if (_psupply) {
    1.11 @@ -1164,17 +1165,17 @@
    1.12              circ_result = circ.run();
    1.13            } else {
    1.14              Circulation<GR, FlowArcMap, ConstArcMap, FlowNodeMap>
    1.15 -              circ(_graph, *_plower, ConstArcMap(inf_cap), *csup);
    1.16 +              circ(_graph, *_plower, inf_arc_map, *csup);
    1.17              circ_result = circ.run();
    1.18            }
    1.19          } else {
    1.20            if (_pupper) {
    1.21              Circulation<GR, ConstArcMap, FlowArcMap, FlowNodeMap>
    1.22 -              circ(_graph, ConstArcMap(0), *_pupper, *csup);
    1.23 +              circ(_graph, zero_arc_map, *_pupper, *csup);
    1.24              circ_result = circ.run();
    1.25            } else {
    1.26              Circulation<GR, ConstArcMap, ConstArcMap, FlowNodeMap>
    1.27 -              circ(_graph, ConstArcMap(0), ConstArcMap(inf_cap), *csup);
    1.28 +              circ(_graph, zero_arc_map, inf_arc_map, *csup);
    1.29              circ_result = circ.run();
    1.30            }
    1.31          }
    1.32 @@ -1191,17 +1192,17 @@
    1.33              circ_result = circ.run();
    1.34            } else {
    1.35              Circulation<RevGraph, FlowArcMap, ConstArcMap, NegNodeMap>
    1.36 -              circ(rgraph, *_plower, ConstArcMap(inf_cap), neg_csup);
    1.37 +              circ(rgraph, *_plower, inf_arc_map, neg_csup);
    1.38              circ_result = circ.run();
    1.39            }
    1.40          } else {
    1.41            if (_pupper) {
    1.42              Circulation<RevGraph, ConstArcMap, FlowArcMap, NegNodeMap>
    1.43 -              circ(rgraph, ConstArcMap(0), *_pupper, neg_csup);
    1.44 +              circ(rgraph, zero_arc_map, *_pupper, neg_csup);
    1.45              circ_result = circ.run();
    1.46            } else {
    1.47              Circulation<RevGraph, ConstArcMap, ConstArcMap, NegNodeMap>
    1.48 -              circ(rgraph, ConstArcMap(0), ConstArcMap(inf_cap), neg_csup);
    1.49 +              circ(rgraph, zero_arc_map, inf_arc_map, neg_csup);
    1.50              circ_result = circ.run();
    1.51            }
    1.52          }