Permanent link:

The graph scan algorithm traverses all reachable nodes in a graph. Its behaviour can be changed by plugging in different datastructures: Using an unordered set results in a random search, using a stack yields depth-first search, and using a queue gives breadth-first search.

Initially published 2017-11-29.