A breadth-first search (BFS) is an algorithm for traversing a finite graph.