Skip to content

[BUG] topological_sort returns duplicate vertices #213

@stev47

Description

@stev47

Description of bug
topological_sort may return duplicate vertices

How to reproduce

g = SimpleDiGraph([Edge(2 => 1)])
topological_sort(g)

Expected behavior

[2, 1]

Actual behavior

[2, 1, 1]

Code demonstrating bug
see above

Version information

julia> versioninfo()
Julia Version 1.8.3
Commit 0434deb161e (2022-11-14 20:14 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 4 × AMD A10-7860K Radeon R7, 12 Compute Cores 4C+8G
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, bdver3)
  Threads: 1 on 4 virtual cores
Environment:
  JULIA_PKG_USE_CLI_GIT = 1

(@v1.8) pkg> status Graphs
Status `~/.julia/environments/v1.8/Project.toml`
  [86223c79] Graphs v1.7.4 `~/.julia/dev/Graphs`

Additional context
none

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions