Class BFS

Inheritance Relationships

Base Type

Class Documentation

class BFS : public NetworKit::SSSP

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

Public Functions

BFS(const Graph &G, node source, bool storePaths = true, bool storeNodesSortedByDistance = false, node target = none)

Constructs the BFS 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.