This repository contains a Python implementation of the Eight Puzzle problem, along with various search algorithms to find a solution from an initial state to a goal state.
The Puzzle
class represents the Eight Puzzle problem. The initial state is a 3x3 grid with 8 movable tiles and one blank square. The goal is to reach the configuration 1 2 3 4 5 6 7 8
. The puzzle states can be represented as strings, where the blank is symbolized by 0
. The class provides methods to transition from one state to another, and a play()
method to make random moves.
The repository also implements various search algorithms to find a solution to the Eight Puzzle problem:
- Depth First Search (
depth_first_search
) - Breadth First Search (
breadth_first_search
) - Depth Limited Search (
depth_limited_search
) - Iterative Deepening Search (
iterative_deepening_search
)
The repository includes functions to apply heuristic search algorithms:
- Greedy Search
- A* Search
- Clone this repository.
- Use the provided classes and functions to solve the Eight Puzzle problem and apply heuristic search.
- Adjust parameters and initial states as needed.