root_of_scc

node_type libsemigroups::ActionDigraph::root_of_scc(node_type nd) const

Returns the root of a strongly connected components containing a given node.

Return

The root of the scc containing the node nd, a value of ActionDigraph::node_type.

Complexity

At most \(O(mn)\) where m is nr_nodes() and n is out_degree().

Parameters
  • nd: a node.

Exceptions