libSmalldb
v2.0.1
|
Depth First Search & friends.
Public Member Functions | |
runForward () | |
runBackward () | |
runBothWays () | |
onNode (?callable $callback) | |
Call $func when entering the node. More... | |
onEdge (?callable $callback) | |
Call $func when inspecting next nodes, before enqueuing them. More... | |
start (array $startNodes) | |
Start DFS from $startNodes. More... | |
Static Public Member Functions | |
static | DFS (NestedGraph $g) |
static | BFS (NestedGraph $g) |
Public Attributes | |
const | DFS_STRATEGY = 0x01 |
const | BFS_STRATEGY = 0x02 |
const | DIR_FORWARD = 0x10 |
const | DIR_BACKWARD = 0x20 |
const | DIR_BOTH = 0x30 |
|
static |
|
static |
runForward | ( | ) |
runBackward | ( | ) |
runBothWays | ( | ) |
onNode | ( | ?callable | $callback | ) |
Call $func when entering the node.
callable | $callback | function(Node $current_node) |
onEdge | ( | ?callable | $callback | ) |
start | ( | array | $startNodes | ) |
Start DFS from $startNodes.
Node[] | $startNodes List of starting nodes or their IDs. |
const DFS_STRATEGY = 0x01 |
const BFS_STRATEGY = 0x02 |
const DIR_FORWARD = 0x10 |
const DIR_BACKWARD = 0x20 |
const DIR_BOTH = 0x30 |