Kosaraju
-
template<class G>
class Kosaraju - #include <kosaraju.hpp>
Computes the strongly connected components of a directed graph. If there is a path from a vertex u to a vertex v, then scc(u) <= scc(v).
Public Functions
-
inline int sccCount() const
Returns the number of strongly connected components of the graph.
-
inline const std::vector<std::vector<int>> &sccs() const
Returns a vector containing the strongly connected components of the graph.
-
inline int scc(const int v) const
Returns the ID of the strongly connected component containing a given vertex.
-
inline int sccCount() const