BFS open/closed pseudocode (Luger): OPEN as a FIFO queue
BFS open/closed pseudocode (Luger): OPEN as a FIFO queue
Answer
OPEN := [Start] CLOSED := [] while OPEN not empty: X := remove_front(OPEN) if goal(X): return path(X) add X to CLOSED OPEN := OPEN ++ (children(X) not in OPEN or CLOSED)
remove_front + append children to the back is the FIFO discipline: earliest-discovered states are expanded earliest, so the search clears a whole depth level before going deeper. CLOSED prevents re-expansion.