The following trivial fix circumvents this bug, but there must be cleaner way to fix it (why all the graph is duplicated as views in Python data structures when rustworkx is used?).
@@ -145,7 +145,14 @@ class EdgeList:
continue
self.add_edge(enum, edata, eidx)
- def remove_edge(self, enum: tuple[int, int]):
+ def remove_edge(self, enum):
+ (u, v) = enum
+ try:
+ self.remove_edge_((u, v))
+ except ValueError:
+ self.remove_edge_((v, u))
+
+ def remove_edge_(self, enum: tuple[int, int]):
if enum not in self.num_to_data:
raise ValueError(f"Edge {enum} does not exist")
self.edges.remove(enum)
The following test succeeds with
networkx
back-end but fails withrustworkx
back-end. Edge keys in the tablenum_to_data
are directed.The following trivial fix circumvents this bug, but there must be cleaner way to fix it (why all the graph is duplicated as views in Python data structures when
rustworkx
is used?).