the graph to traverse on
direction in which to traverse
the ids of nodes that the walk starts from
limiting parameters
if set, tracks previous neighbors by occurrence
The priority of nodes adding to the queue.
Returns nodes ids that should be added to the queue after visiting node
.
Returns nodes ids that should be added to the queue after visiting node
.
(Changed in version 2.8.0) collect
has changed. The previous behavior can be reproduced with toSeq
.
We mark nodes using 3 'colors': Unenqueued
, Enqueued
, Visited
.
We mark nodes using 3 'colors': Unenqueued
, Enqueued
, Visited
.
Initially every node is implicitly marked with Unenqueued
.
Node is marked Enqueued
, when we add it to the queue. We mark
it Visited
just before returning with iterator's next
function.
Depth of visit of a given node.
Depth of visit of a given node.
direction in which to traverse
direction in which to traverse
Enqueues nodes
added after from
node is visited (or None
when equeueing initial nodes).
Enqueues nodes
added after from
node is visited (or None
when equeueing initial nodes).
Finds in the queue the node that will be visited next.
Finds in the queue the node that will be visited next.
Traverser only visits node Ids listed in some node's edges, and thus we know that node must exist, safe to assume graph.
Traverser only visits node Ids listed in some node's edges, and thus we know that node must exist, safe to assume graph.getNodeById return non-None value
the graph to traverse on
the graph to traverse on
the ids of nodes that the walk starts from
the ids of nodes that the walk starts from
If the queue is longer than the number of nodes that can be visited due to
maxSteps
bound, cuts the list of nodes that are to be added to the queue
in order not to add too many of them.
If the queue is longer than the number of nodes that can be visited due to
maxSteps
bound, cuts the list of nodes that are to be added to the queue
in order not to add too many of them.
Assumes that all nodes in the queue are being visited.
The priority of nodes adding to the queue.
The priority of nodes adding to the queue.
Number of nodes ever enqueued in the queue
.
Number of nodes ever enqueued in the queue
.
Performs action needed when visiting a node.
Performs action needed when visiting a node.
Queue that stores nodes to be visited next.
Queue that stores nodes to be visited next.
Set to true to deque a node from the queue before processing.
Set to true to deque a node from the queue before processing.
Checks if the node of a given color should be enqueued.
Checks if the node of a given color should be enqueued.
Action performed when visiting node node
(before iteratur retuns node
).
Action performed when visiting node node
(before iteratur retuns node
).
Should be implemented in subclass.
(Since version 2.10.0) use fold instead
Traverses in FIFO (breadth first) order but without any limit on the number of times every node can be visited. Every time the walk visits a node, it adds all its neighbors (along direction
dir
) to the queue.