Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Unable to run mincost_flow in latest version #44

Open
alichtl opened this issue Feb 19, 2021 · 8 comments
Open

Unable to run mincost_flow in latest version #44

alichtl opened this issue Feb 19, 2021 · 8 comments

Comments

@alichtl
Copy link

alichtl commented Feb 19, 2021

Attempting to run the example code at https://juliagraphs.org/LightGraphsFlows.jl/latest/mincost.html give the following error:

ClpSolver is no longer supported. If you are using JuMP, upgrade to the latest version and use Clp.Optimizer instead. If you are using MathProgBase (e.g., via lingprog), 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
@simonschoelly
Copy link
Collaborator

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]) 

@simonschoelly
Copy link
Collaborator

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/

@matbesancon
Copy link
Member

perfect, should this be closed @adamlichtl ?

@alichtl
Copy link
Author

alichtl commented Feb 19, 2021

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.

image

@matbesancon
Copy link
Member

this is weird, latest is supposed to be on par with master

@simonschoelly
Copy link
Collaborator

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.

@matbesancon
Copy link
Member

We can just delete latest?

@simonschoelly
Copy link
Collaborator

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants