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

Incorrect MinCut result #27

@etiennedeg

Description

@etiennedeg

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions