Skip to content

Add graph methods to to clear nodes or edges #984

@mtreinish

Description

@mtreinish

What is the expected enhancement?

If you want to remove all the edges or nodes in a graph there should be a method on the graph classes to do this efficiently. We should add PyDiGraph.clear() and PyDiGraph.clear_edges() (for PyGraph as well). This will mirror the same methods on the StableGraph type in petgraph to do an efficient removal of all nodes and/or edges https://docs.rs/petgraph/latest/petgraph/stable_graph/struct.StableGraph.html#method.clear and https://docs.rs/petgraph/latest/petgraph/stable_graph/struct.StableGraph.html#method.clear_edges

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions