-
Notifications
You must be signed in to change notification settings - Fork 167
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
Add edge_indices methods to graph objects #323
Conversation
This commit adds a new method to the PyDiGraph (and PyDAG) and PyGraph classes, node_indices, which returns a list of a edge indices for all edges in the graph.
3ce1215
to
32a5aa8
Compare
Pull Request Test Coverage Report for Build 864293999
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few questions::
-
Are edge indices static identifiers for unique edges? What happens if I remove an edge, do others maintain their edge indices or get re-indexed? (I think this should be documented)
-
Are edge indices assigned in the order the edges were created? If so then I think they are not properties of the graph, i.e. two identical graphs could have different edge indices if they were created in different orders.
Co-authored-by: Ali Javadi-Abhari <[email protected]>
Yes, they're stable unique identifiers for each edge in the graph. If an edge is removed in the middle the other indices don't change. I agree this should be documented and I thought that it was in the class docstring for
They are, the index is just a key for uniquely identifying an edge they get assigned at edge creation time (the internal implementation is there is a |
This commit adds a new method to the PyDiGraph (and PyDAG) and PyGraph
classes, node_indices, which returns a list of a edge indices for all
edges in the graph.