-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deleting a node does not update keys in edge_data #69
Comments
Wow that is indeed a big bug. And I'm not sure we can fix it within MetaGraphsNext.jl because this behavior is an implementation detail of the SimpleGraph type from Graphs.jl. And if you use another graph type as basis (from VertexSafeGraphs.jl by example) things will be different. |
Preventing deletion would be too bad! I can think of various options. But the current code seems to make the following assumption: If the vertex being removed is not the "last" one, in the sense of having the last code, then the "last" vertex (initially with the last code) had its code changed to the deleted vertex's code. In my example above, deleting vertex Is this assumption valid for all graph types, not just |
Most likely my bad. The original code was inherited from the original metagraphs, which made that assumption I think, no idea if it holds in general. I wonder if the best solution is just to update |
Indeed, arranging the order of node labels based on the node labels themselves would be best! Ah but yes, that would require a total order on the labels, and no duplicate labels --which may already be required perhaps, anyway. Personally, I think it's fair to ask for labels that can be ordered, as vertices also have data. The biggest issues might be:
|
I'm not sure why arrange is the key, if memory serves it's only used to sort two vertices within an edge? |
I think changing this line https://github.com/JuliaGraphs/MetaGraphsNext.jl/blob/5eb369b473fd50c665dec95cb0c9c5b591aa68de/src/directedness.jl#L27C11-L27C11 to |
After deleting a vertex, the order of the codes for the other vertices can be reshuffled, such that the "standard" arrangement of vertex labels to identify undirected edges is modified. Yet, the keys of the edge data still follow the previous arrangement of vertex labels. Here is a minimal example.
We want to merge
:l4
with:l1
. First: connect:l4
to:l1
's neighbors, second: delete:l1
.The text was updated successfully, but these errors were encountered: