Open matbesancon opened 6 years ago
Easy enough to programatically check via
a = fill(NaN, 3, 3)
all(isnan.(a))
before closing the issue, a similar problem occurs with unbounded mincost problem, in case of a path with negative cost and infinite capacity:
julia> flow = mincost_flow(g, capacity, demand, w, 5, 6)
WARNING: Not solved to optimality, status: Unbounded
6×6 Array{Float64,2}:
0.0 0.0 0.0 1.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 1.0
1.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0
(the path 5->1->4->6 should have a flow of +Inf)
Is the algorithm employed in the function mincostflow polynomial? If not, is there a possibility to replace the current function with a faster polynomial algorithm?
@elchiconuevo sorry I am replying extremely late: yes mincostflow is using a simplex solver under the hood, so polynomial in practice
When trying to solve a mincost flow on an infeasible network, we get a warning and a NaN matrix:
I find it explicit enough, but we could add a optimal boolean in the response tuple, so that users can check if it was feasible and then handle the flow.
Another option would be to return the JuMP status.