networkit.sampling

networkit.sampling.bfsSample(G, source=None, k=50)

Start a BFS from source node, return node-induced subgraph of the first k nodes discovered.

DEPRECATED. This function (and the networkit.sampling module) will be removed in future updates.

Parameters
  • G (networkit.Graph) – The input graph.

  • source (int, optional) – The starting node. If none is choosen, then a random node is picked. Default: None

  • k (int, optional) – Stop after k nodes are discovered. Default: 50

Returns

Subgraph based on bfsSample.

Return type

networkit.Graph