Function NetworKit::GraphTools::subgraphFromNodes(const Graph&, const std::unordered_set<node>&)

Function Documentation

Graph NetworKit::GraphTools::subgraphFromNodes(const Graph &G, const std::unordered_set<node> &nodes)

Returns an induced subgraph of the input graph (including potential edge weights/directions)

The subgraph contains all given nodes and all edges which have both end points in nodes.

Parameters:
  • G – The input graph.

  • nodes – The nodes of the induced subgraph.

Returns:

Induced subgraph.