You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After removing a vertex using rem_vertex! from Graphs.jl, the graph gets broken. Consider the following MWE below. This creates a graph that looks like this:
JFK
| \
RDU-SFO
| /
PHX
It then removes the RDU vertex. This breaks the graph, and accessing e.g. G[:PHX, :SFO] now results in a KeyError even though that should not have been affected by removing RDU.
using Graphs, MetaGraphsNext
G =MetaGraph(
Graph(),
label_type=Symbol,
vertex_data_type=Nothing,
edge_data_type=Float64
)
G[:RDU] =nothing
G[:JFK] =nothing
G[:SFO] =nothing
G[:PHX] =nothing
G[:RDU, :JFK] =705.5
G[:RDU, :SFO] =2803.3
G[:SFO, :JFK] =2201.1
G[:SFO, :PHX] =2311.1
G[:PHX, :RDU] =2112.2
G[:PHX, :SFO]
#> 2311.1rem_vertex!(G, code_for(G, :RDU))
#> true# this should still print 2311.1, since we didn't remove PHX or SFO,# but instead it KeyErrors
G[:PHX, :SFO]
#> ERROR: KeyError: key (:PHX, :SFO) not found
Edit to add:
Julia 1.9.4 aarch64
Graphs 1.9.0
MetaGraphsNext 0.6.0
The text was updated successfully, but these errors were encountered:
After removing a vertex using
rem_vertex!
from Graphs.jl, the graph gets broken. Consider the following MWE below. This creates a graph that looks like this:It then removes the RDU vertex. This breaks the graph, and accessing e.g.
G[:PHX, :SFO]
now results in a KeyError even though that should not have been affected by removing RDU.Edit to add:
The text was updated successfully, but these errors were encountered: