Note
This is the documentation for the current state of the development branch of rustworkx. The documentation or APIs here can change prior to being released.
rustworkx.PyDiGraph.incident_edge_index_map#
- PyDiGraph.incident_edge_index_map(node, /, all_edges=False)#
Return the index map of edges incident to a provided node
By default this method will only return the outgoing edges of the provided
node. If you would like to access both the incoming and outgoing edges you can set theall_edgeskwarg toTrue.- Parameters:
node (int) – The node index to get incident edges from. If this node index is not present in the graph this method will return an empty list and not error.
all_edges (bool) – If set to
Trueboth incoming and outgoing edges tonodewill be returned. If set toFalse, only outgoing ones.
- Returns:
A mapping of incident edge indices to the tuple
(source, target, data)- Return type: