A random walk iterator for a directed or undirected graph.
At each step the iterator selects a random (uniformly distributed) edge out of the current vertex
and follows it to the next vertex. In case of directed graphs the outgoing edge set is used. See
wikipedia for more
details.
In case a weighted walk is desired, edges are selected with probability respective to its weight
(out of the total weight of the edges). The walk can be bounded by number of steps (default
Long#MAX_VALUE . When the bound is reached the iterator is considered exhausted. Calling
next() on exhausted iterator will throw
NoSuchElementException.
In case a sink (i.e. no edges) vertex is reached, any consecutive calls to
next() will
throw
NoSuchElementException.
For this iterator to work correctly the graph must not be modified during iteration. Currently
there are no means to ensure that, nor to fail-fast. The results of such modifications are
undefined.