Performs a breadth-first search to find all nodes reachable from source nodes.
a list of all nodes in the network