Explore a graph in rings around the start: every node one edge away, then every node two edges away, and so on. A first-in, first-out queue is what keeps the rings in order.
Explore a graph in rings around the start: every node one edge away, then every node two edges away, and so on. A first-in, first-out queue is what keeps the rings in order.