A frontier is the collection of graph nodes currently being explored or awaiting expansion. Breadth-first search updates it layer by layer instead of immediately following one neighbor as depth-first search does. section 6.1.1
A breadth-first search updates the frontier by:
- Starting with the graph and starting node as the initial frontier. section 6.1.1
- Collecting neighboring nodes for every node in the current frontier. section 6.1.1
- Deleting the current frontier from the graph so visited nodes are not revisited. section 6.1.1
- Using the newly collected nodes as the next frontier and recording predecessors for path reconstruction. section 6.1.1 section 6.1.2
Search-state implementation
A search state can store the frontier, the remaining graph, and a predecessor graph: `type SearchState a = ([a], DiGraph a, DiGraph a)`. Each recursive step deletes the current frontier, computes children still present in the graph, concatenates them into `frontier'`, and continues searching. section 6.1.2

