breadth_first_paths

compas.topology.breadth_first_paths(adjacency, root, goal)[source]

Return all paths from root to goal.

Parameters
  • adjacency (dict) – An adjacency dictionary.

  • root (hashable) – The identifier of the starting node.

  • goal (hashable) – The identifier of the ending node.

Yields

list – A path from root to goal.

Notes

Due to the nature of the search, the first path returned is the shortest.

Examples

>>>