next_neighbor¶
-
inline std::pair<node_type, label_type> libsemigroups::ActionDigraph::next_neighbor(node_type v, label_type i) const¶
Get the next neighbor of a node that doesn’t equal libsemigroups::UNDEFINED.
- Complexity
At worst \(O(n)\) where \(n\) equals out_degree().
- See
- Parameters
v – the node
i – the label
- Throws
LibsemigroupsException – if
vdoes not represent a node inthis.- Returns
Returns a std::pair
xwhere:x.secondis the minimum value in the range \([i, out_degree())\) such that neighbor(v, x.second) is not equal to libsemigroups::UNDEFINED; andx.firstis adjacent tovvia an edge labelledx.second; If neighbor(v, i) equals libsemigroups::UNDEFINED for every value in the range \([i, out_degree())\), thenx.firstandx.secondequal libsemigroups::UNDEFINED.