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

[BUG] mincut gives incorrect results for some SimpleGraphs #1589

Open
hansenjakob opened this issue Sep 2, 2021 · 0 comments
Open

[BUG] mincut gives incorrect results for some SimpleGraphs #1589

hansenjakob opened this issue Sep 2, 2021 · 0 comments
Labels
bug confirmed bug producing incorrect results

Comments

@hansenjakob
Copy link

Description of bug
The mincut function produces incorrect partitions for some graphs.

How to reproduce
The following code produces incorrect results:

edge_list = [(1,2), (1,3), (1,4), (1,5), (2,6), (3,4), (3,6), (4,6), (5,6)]
g = SimpleGraphFromIterator([Edge(e...) for e in edge_list])
labels, cut_size = mincut(g)

Expected behavior
cut_size should be at most 2 because both vertex 2 and vertex 5 have degree 2.

Actual behavior
cut_size is 3. In this instance, the cut given separates vertex 4 from the rest of the graph.

In experiments with random graphs, this behavior arises fairly frequently.

Version information

  • output from versioninfo() surrounded by backticks (``)
Julia Version 1.6.0
Commit f9720dc2eb (2021-03-24 12:55 UTC)
Platform Info:
 OS: macOS (x86_64-apple-darwin19.6.0)
 CPU: Apple M1
 WORD_SIZE: 64
 LIBM: libopenlibm
 LLVM: libLLVM-11.0.1 (ORCJIT, westmere)
Environment:
 JULIA_EDITOR = code
 JULIA_NUM_THREADS = 
  • output from ] status LightGraphs surrounded by backticks (``)
      Status `~/.julia/environments/v1.6/Project.toml`
  [093fc24a] LightGraphs v1.3.5
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug confirmed bug producing incorrect results
Projects
None yet
Development

No branches or pull requests

1 participant