Template Class BreadthFirstSearch

Inheritance Relationships

Base Type

Class Documentation

template<class GraphT>
class BreadthFirstSearch : public NetworKit::SingleSourceShortestPaths<GraphT>

The BFS class is used to do a breadth-first search on a Graph from a given source node.

Public Functions

inline BreadthFirstSearch(const GraphT &G, NodeT source, bool storePaths = true, bool storeNodesSortedByDistance = false, NodeT target = nullNodeId)

Constructs the BreadthFirstSearch class for G and source node source.

Parameters:
  • G – The graph

  • source – The source node of the breadth-first search

  • storePaths – Paths are reconstructable and the number of paths is stored.

  • storeNodesSortedByDistance – Store a vector of nodes ordered in increasing distance from the source.

  • target – The target node.

virtual void run() override

Breadth-first search from source.