Class: DFSGraphTraversal

DFSGraphTraversal

A DFSGraphTraversal specifies a strategy for traversing an AbstractGraph in depth-first-search order. As is typical with depth-first-search, nodes to be visited (along with their state and data) are stored on a stack.

Constructor

new DFSGraphTraversal()

Constructs a DFSGraphTraversal
Source:

Methods

addAllNodes(nodes, state, data)

Adds all nodes to the stack. All nodes added will share the same state and data provided
Parameters:
Name Type Description
nodes Array.<AbstractNode>
state String
data Object
Source:

addNode(node, state, data)

Adds a node to the stack. When the node is visited, the current state and data object will be set to the ones provided
Parameters:
Name Type Description
node AbstractNode The node to add to the stack
state String The state to add to the stack
data * The data to add to the stack
Source:

hasEnded()

Source:

reset()

Source:

stepInner()

Source: