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_edges#
- PyDiGraph.incident_edges(node, /, all_edges=False)#
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 withget_edge_endpoints_by_index()
.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_edges
kwarg 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
True
both incoming and outgoing edges tonode
will be returned.
- Returns:
A list of the edge indices incident to a node in the graph
- Return type: