-
Notifications
You must be signed in to change notification settings - Fork 195
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Information
- rustworkx version: 0.17.1
- Python version: 3.11
What is the current behavior?
JSON serialisation doesn't respect deleted nodes.
import rustworkx as rx
graph = rx.PyGraph()
graph.add_node("A") # index 0
graph.add_node("B") # index 1
graph.add_node("C") # index 2
graph.remove_node(1) # Remove middle node
print(f"Before JSON: {graph.node_indices()}")
json_str = rx.node_link_json(graph)
restored = rx.parse_node_link_json(json_str)
print(f"After JSON: {restored.node_indices()}")Buggy Behavior (BEFORE fix)
Before JSON: NodeIndices[0, 2]
After JSON: NodeIndices[0, 1]
Index 2 is renumbered as 1. I'd expect the graph to roundtrip as I refer to those indices in other objects.
Analogous to #1503
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working