rustworkx.PyGraph.incident_edge_index_map#

PyGraph.incident_edge_index_map(node, /)#

Return the index map of edges incident to a provided node

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 mapping and not error.

Returns:

A mapping of incident edge indices to the tuple (source, target, data). The source endpoint node index in this tuple will always be node to ensure you can easily identify that the neighbor node is the second element in the tuple for a given edge index.

Return type:

EdgeIndexMap