Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: Add into_edge_type for StableGraph#948

Open
tlaakkonen wants to merge 1 commit into
petgraph:masterfrom
tlaakkonen:stable-graph-into-edge-type
Open

feat: Add into_edge_type for StableGraph#948
tlaakkonen wants to merge 1 commit into
petgraph:masterfrom
tlaakkonen:stable-graph-into-edge-type

Conversation

@tlaakkonen
Copy link
Copy Markdown

This PR adds .into_edge_type() for StableGraph - it just calls .into_edge_type() on the underlying Graph directly.

The use case is some code that requires switching between directed and undirected graphs often while keeping the same node indices. This was possible but quite inefficient with the current API because you have to copy over all of the nodes and edges into a new graph (and I think it may also invalidate the edge indices when doing so, although this wasn't important for my application).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant