rustworkx.PyDiGraph.edge_subgraph#

PyDiGraph.edge_subgraph(edge_list, /)#

Return a new PyDiGraph object for an edge induced subgraph of this graph

The induced subgraph contains each edge in edge_list and each node incident to any of those edges.

Parameters:

edge_list (list) – A list of edge tuples (2-tuples with the source and target node) to generate the subgraph from. In cases of parallel edges for a multigraph all edges between the specified node. In case of an edge specified that doesn’t exist in the graph it will be silently ignored.

Returns:

The edge subgraph

Return type:

PyDiGraph