root_of_scc¶
-
inline node_type libsemigroups::ActionDigraph::root_of_scc(node_type nd) const¶
Returns the root of a strongly connected components containing a given node.
- Complexity
At most \(O(mn)\) where
mis nr_nodes() andnis out_degree().
- Parameters
nd – a node.
- Throws
LibsemigroupsException – if it is not the case that every node has exactly out_degree() out-neighbors. In other words, if neighbor() is libsemigroups::UNDEFINED for any node
ndand any labellbl. If an exception is thrown,thismight be modified but is guaranteed to be in a valid state (basic exception guarantee).- Returns
The root of the scc containing the node
nd, a value of ActionDigraph::node_type.