Skip to content

[BUG] #503

@mroughan

Description

@mroughan

Description of bug

Problem (or maybe my misunderstanding) of rem_vertex!

How to reproduce

julia> using Graphs
julia> g = path_graph(5)
{5, 4} undirected simple Int64 graph

julia> collect(edges(g))
4-element Vector{Graphs.SimpleGraphs.SimpleEdge{Int64}}:
 Edge 1 => 2
 Edge 2 => 3
 Edge 3 => 4
 Edge 4 => 5

julia> rem_vertex!(g, 2)
true

julia> collect(edges(g))
2-element Vector{Graphs.SimpleGraphs.SimpleEdge{Int64}}:
 Edge 2 => 4
 Edge 3 => 4

Expected behavior

I would have expected to see

julia> collect(edges(g))
2-element Vector{Graphs.SimpleGraphs.SimpleEdge{Int64}}:
 Edge 2 => 3
 Edge 3 => 4

Actual behavior

See above.

Code demonstrating bug

See above.

Version information

  • output from versioninfo() surrounded by backticks (``)
Julia Version 1.12.5
Commit 5fe89b8ddc1 (2026-02-09 16:05 UTC)
Build Info:
  Official https://julialang.org release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  • output from ] status Graphs surrounded by backticks (``)
Project AnnotatedGraphs v0.2.0
Status `~/Dropbox/src/Julia/AnnotatedGraphs.jl/Project.toml`
  [86223c79] Graphs v1.14.0

Additional context

It's possible I don't understand something in vertex removal?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions