gravatar
kpeter (Peter Kovacs)
kpeter@inf.elte.hu
Bug fix in NetworkSimplex (#234)
0 1 0
default
1 file changed with 7 insertions and 6 deletions:
↑ Collapse diff ↑
Ignore white space 12 line context
... ...
@@ -1141,12 +1141,13 @@
1141 1141
        }
1142 1142
        art_cost = (art_cost + 1) * _node_num;
1143 1143
      }
1144 1144

	
1145 1145
      // Run Circulation to check if a feasible solution exists
1146 1146
      typedef ConstMap<Arc, Flow> ConstArcMap;
1147
      ConstArcMap zero_arc_map(0), inf_arc_map(inf_cap);
1147 1148
      FlowNodeMap *csup = NULL;
1148 1149
      bool local_csup = false;
1149 1150
      if (_psupply) {
1150 1151
        csup = _psupply;
1151 1152
      } else {
1152 1153
        csup = new FlowNodeMap(_graph, 0);
... ...
@@ -1161,23 +1162,23 @@
1161 1162
          if (_pupper) {
1162 1163
            Circulation<GR, FlowArcMap, FlowArcMap, FlowNodeMap>
1163 1164
              circ(_graph, *_plower, *_pupper, *csup);
1164 1165
            circ_result = circ.run();
1165 1166
          } else {
1166 1167
            Circulation<GR, FlowArcMap, ConstArcMap, FlowNodeMap>
1167
              circ(_graph, *_plower, ConstArcMap(inf_cap), *csup);
1168
              circ(_graph, *_plower, inf_arc_map, *csup);
1168 1169
            circ_result = circ.run();
1169 1170
          }
1170 1171
        } else {
1171 1172
          if (_pupper) {
1172 1173
            Circulation<GR, ConstArcMap, FlowArcMap, FlowNodeMap>
1173
              circ(_graph, ConstArcMap(0), *_pupper, *csup);
1174
              circ(_graph, zero_arc_map, *_pupper, *csup);
1174 1175
            circ_result = circ.run();
1175 1176
          } else {
1176 1177
            Circulation<GR, ConstArcMap, ConstArcMap, FlowNodeMap>
1177
              circ(_graph, ConstArcMap(0), ConstArcMap(inf_cap), *csup);
1178
              circ(_graph, zero_arc_map, inf_arc_map, *csup);
1178 1179
            circ_result = circ.run();
1179 1180
          }
1180 1181
        }
1181 1182
      } else {
1182 1183
        // LEQ problem type
1183 1184
        typedef ReverseDigraph<const GR> RevGraph;
... ...
@@ -1188,23 +1189,23 @@
1188 1189
          if (_pupper) {
1189 1190
            Circulation<RevGraph, FlowArcMap, FlowArcMap, NegNodeMap>
1190 1191
              circ(rgraph, *_plower, *_pupper, neg_csup);
1191 1192
            circ_result = circ.run();
1192 1193
          } else {
1193 1194
            Circulation<RevGraph, FlowArcMap, ConstArcMap, NegNodeMap>
1194
              circ(rgraph, *_plower, ConstArcMap(inf_cap), neg_csup);
1195
              circ(rgraph, *_plower, inf_arc_map, neg_csup);
1195 1196
            circ_result = circ.run();
1196 1197
          }
1197 1198
        } else {
1198 1199
          if (_pupper) {
1199 1200
            Circulation<RevGraph, ConstArcMap, FlowArcMap, NegNodeMap>
1200
              circ(rgraph, ConstArcMap(0), *_pupper, neg_csup);
1201
              circ(rgraph, zero_arc_map, *_pupper, neg_csup);
1201 1202
            circ_result = circ.run();
1202 1203
          } else {
1203 1204
            Circulation<RevGraph, ConstArcMap, ConstArcMap, NegNodeMap>
1204
              circ(rgraph, ConstArcMap(0), ConstArcMap(inf_cap), neg_csup);
1205
              circ(rgraph, zero_arc_map, inf_arc_map, neg_csup);
1205 1206
            circ_result = circ.run();
1206 1207
          }
1207 1208
        }
1208 1209
      }
1209 1210
      if (local_csup) delete csup;
1210 1211
      if (!circ_result) return false;
0 comments (0 inline)