Template Function NetworKit::Traversal::BFSfrom(const GraphT&, InputIt, InputIt, L)

Function Documentation

template<class InputIt, typename L, class GraphT>
void NetworKit::Traversal::BFSfrom(const GraphT &G, InputIt first, InputIt last, L handle)

Iterate over nodes in breadth-first search order starting from the unique nodes within the given range. All start nodes are visited at distance 0. Duplicate start nodes are ignored.

Parameters:
  • G – The input graph.

  • first – The first element of the start node range.

  • last – The end of the start node range.

  • handle – Takes a node, or a node and its distance from the nearest start node.

Throws:

std::runtime_error – If a start node is not in the graph.