- compas.topology.breadth_first_traverse(adjacency, root, callback=None)
Traverse an adjacency dict in “breadth-first” order.
adjacency (dict) – Map of every node to a list of neighbouring nodes.
root (int) – The identifier of the starting node.
callback (callable, optional) – A callback function applied to every traversed node and its current neighbour.
set – The visited nodes.