LightGraphsFlows.jl
LightGraphsFlows.jl copied to clipboard
Unable to run mincost_flow in latest version
Attempting to run the example code at https://juliagraphs.org/LightGraphsFlows.jl/latest/mincost.html give the following error:
ClpSolveris no longer supported. If you are using JuMP, upgrade to the latest version and useClp.Optimizerinstead. If you are using MathProgBase (e.g., vialingprog), you will need to upgrade to MathOptInterface (https://github.com/jump-dev/MathOptInterface.jl).
Replacing ClpSolver with Optimizer, then gives this error:
MethodError: no method matching mincost_flow(::SimpleDiGraph{Int64}, ::Array{Float64,2}, ::SparseMatrixCSC{Float64,Int64}, ::Array{Float64,2}, ::Optimizer, ::Int64, ::Int64) Closest candidates are: mincost_flow(::AG, !Matched::AbstractArray{T,1} where T, ::AbstractArray{T,2} where T, ::AbstractArray{T,2} where T, ::Any; kwargs...) where AG<:AbstractGraph at /home/
/.julia/packages/SimpleTraits/1wYi7/src/SimpleTraits.jl:338 mincost_flow(!Matched::Type{IsDirected{AG}}, !Matched::AG, !Matched::AbstractArray{T,1} where T, ::AbstractArray{T,2} where T, !Matched::AbstractArray{T,2} where T, ::Any; edge_demand, source_nodes, sink_nodes) where AG<:AbstractGraph at /home/ /.julia/packages/LightGraphsFlows/X92PO/src/mincost.jl:65
Versions:
- Julia 1.5.3
- JuMP 0.21.6
- LightGraphs 1.3.5
- LightGraphsFlows 0.4.1
Can Julia code that you are using to call mincost_flow?
From the error it looks like to call the function somehow like this:
mincost_flow(g, node_demand, edge_capacity, edge_cost, optimizer, 1, 2)
when you should probably call
mincost_flow(g, node_demand, edge_capacity, edge_cost, optimizer; source_nodes=[1], sink_nodes=[2])
I also saw that the documentation that you are using (and that is linked to in serveral places) is three years old - here are now updated docs for the latest stable version: https://juliagraphs.org/LightGraphsFlows.jl/stable/
perfect, should this be closed @adamlichtl ?
This is super helpful- thank you! It's working now, and thanks also for directing me to the stable version of the docs. It's ok to close this, but for the benefit of others, I'd recommend removing (or at least renaming to something other than latest), the stale documentation at https://juliagraphs.org/LightGraphsFlows.jl/latest/, since that is one of the top hits returned when searching online.

this is weird, latest is supposed to be on par with master
The problem was before, the documentation folder was called latest but was never updated. With the new ci scripts, we will have a folder stable and a folder dev. So we still need to update this on juliagraphs.org and remove the lastest folder.
For now I am trying to create a symlink from latest to stable but have not been successful so far.
We can just delete latest?
Yes, maybe there is no other option - maybe github cannot deal with symlinks to symlinks or so. We should just update juliagraphs.org then, and juliahub will also contain the incorrect link until we release a new version