rustworkx.PyGraph.incident_edges#

PyGraph.incident_edges(node, /)#

Return the list of edge indices incident to a provided node

You can later retrieve the data payload of this edge with get_edge_data_by_index() or its endpoints with get_edge_endpoints_by_index().

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.

Returns:

A list of the edge indices incident to a node in the graph

Return type:

EdgeIndices