This repository contains code to solve a 8-puzzle problem using Breadth First Search (BFS).
- Python 2.0 or above
- NumPy
- random
- collections
- copy
python 8_puzzle_solver.py
Three output textfile are generated:
- nodePath.txt contains states with elements in the column-wise format from the start state to the goal state.
- NodesInfo.txt stores information of a node_index and its parent in two columns for backtracking.
- Nodes.txt stores all the explored states.
plot_path.py file helps in visualizing the output of BFS. Visualization for start state 1 5 2 4 0 3 7 8 6 to reach the goal state 1 2 3 4 5 6 7 8 0 is given below: