Function subgraph
Source pub fn subgraph<N, E, Ix>(
graph: &Graph<N, E, Ix>,
nodes: &HashSet<N>,
) -> Graph<N, E, Ix>
Expand description
Extracts a subgraph containing only the specified nodes
§Arguments
graph
- The input graph
nodes
- The set of nodes to include in the subgraph
§Returns
- A new graph containing only the specified nodes and edges between them