JuliaGraphs / LightGraphsFlows.jl

Flow algorithms on LightGraphs
Other
36 stars 11 forks source link

Incorrect MinCut result #27

Closed etiennedeg closed 3 years ago

etiennedeg commented 4 years ago

Hi, mincut seems to return false result with this graph: graphe Non-labeled edges have infinite capacity edges 1-2, 4-7, 5-7 and 6-7 are saturated after the running of the algorithm

Output: [1, 3, 6, 5] [2, 4, 7] 3.0 Expected Output [1, 2, 3, 4, 5, 6] [7] 3.0

The algorithm should find every reachable node from the source by a flow, it instead reaches nodes reachable by non saturated direct edges

How to reproduce:

flow_graph = lg.DiGraph(7)
capacity_matrix = zeros(7,7)
flow_edges = [
(1,2,2),(1,3,2),(2,4,4),(2,5,4),
(3,5,4),(3,6,4),(4,7,1),(5,7,1),(6,7,1)
]
for e in flow_edges
    u, v, f = e
    lg.add_edge!(flow_graph, u, v)
    capacity_matrix[u,v] = f
end
a,b,c= LightGraphsFlows.mincut(flow_graph, 1, 7, capacity_matrix, EdmondsKarpAlgorithm())
println(a)
println(b)
println(c)
etiennedeg commented 4 years ago

I made a PR : #32

matbesancon commented 4 years ago

@JuliaRegistrator register()

JuliaRegistrator commented 4 years ago

Error while trying to register: "File (Julia)Project.toml not found"

matbesancon commented 4 years ago

@JuliaRegistrator register()

JuliaRegistrator commented 4 years ago

Error while trying to register: "Tag with name 0.1.0 already exists and points to a different commit"

matbesancon commented 4 years ago

@JuliaRegistrator register()

JuliaRegistrator commented 4 years ago

Error while trying to register: Changing UUIDs is not allowed

matbesancon commented 4 years ago

@JuliaRegistrator register()

JuliaRegistrator commented 4 years ago

Registration pull request created: JuliaRegistries/General/9016

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.3.1 -m "<description of version>" aa8e14e76daa38cd7ee7291b376f4a722541edbd
git push origin v0.3.1