Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Breadth-First Search (BFS)

Introduction

A breadth-first search (BFS) algorithm explores graph or tree structures by traversing level by level, visiting all nodes at the current depth before moving on to nodes at the next depth level. This strategy involves managing the frontier, which is the set of nodes that are yet to be explored. In BFS, the frontier is typically handled using a queue data structure, adhering to the "first-in, first-out" (FIFO) principle.

Usage

python maze.py maze.txt

Examples

Maze 1

img

Solution 1

img

States Explored: 6

img

Maze 2

img

Solution 2

img

States Explored: 77

img

Maze 3

img

Solution 3

img

States Explored: 545

img

References