edX course on AI
Implement 8-puzzle solver with BFS, DFS, A-star, and iterative depth A-star.
See project requirements here:
I use 4 classes to implement solutions:
- Board contains puzzle state and methods for manipulating tiles
- Node contains a Board and path of actions leading to that state (i.e. a tree) along with path costs
- Solver is an abstract base class for each type of solver (concrete class must implement solve method)
- Puzzle takes user input, creates a board, and solves it.
Command line execution (solver can be ast
|
bfs
| dfs
| ida
):
python3 driver.py ast 1,2,5,3,4,0,6,7,8