edgegraph.traversal.breadthfirst

edgegraph.traversal.breadthfirst#

Breadth-first search and traversal functions.

The functions here perform searches and traversals of graphs in a breadth-first manner. The implementations are iterative.

See also

The algorithm used by all the functions herein visits vertices in the following order. Note that the choice of which branch to take at any given node (e.g., visiting v9 before v10) is determined by the structure of the universe.

object v1
object v2
object v3
object v4
object v5
object v6
object v7
object v8
object v9
object v10
object v11
object v12

v1 -- v2
v1 -- v3
v1 -- v4
v2 -- v5
v2 -- v6
v4 -- v7
v4 -- v8
v5 -- v9
v5 -- v10
v7 -- v11
v7 -- v12

Functions

bfs(uni, start, attrib, val)

Perform a breadth-first search.

bft(uni, start[, direction_sensitive, ...])

Perform a breadth-first traversal.