Welcome to the 8-Puzzle Solver project! This project implements various algorithms to solve the classic 8-puzzle problem. The implemented algorithms include BFS, DFID, and Bidirectional Search. Additionally, the project includes a visualization feature using Matplotlib and basic heuristic calculations.
- Implemented Algorithms:
- Breadth-First Search (BFS)
- Depth-First Iterative Deepening (DFID)
- Bidirectional Search
- Visualization of the solution path using Matplotlib
- Basic heuristic calculations (not used in algorithms but displayed)
git clone https://github.com/your-username/8-puzzle.git cd 8-puzzle
You can run the main script to solve the puzzle using the desired algorithm and visualize the solution path. Here is an example of how to run the script: python 8_puzzle_BFS.py
BFS explores all possible states level by level, ensuring the shortest path to the goal.
DFID combines the benefits of depth-first and breadth-first search, exploring deeper nodes iteratively.
Bidirectional Search runs two simultaneous searches: one forward from the initial state and one backward from the goal state, meeting in the middle to find the solution faster.
An algorithm used to solve combinatorial optimization problems by systematically exploring branches of the search space, pruning branches that exceed the current best solution.
A local search algorithm that starts with an arbitrary solution and iteratively makes small changes, moving to neighboring states with better objective values until no improvement is found.
A graph traversal and search algorithm that finds the shortest path from a start node to a goal node by combining the cost to reach the node and the estimated cost from the node to the goal (using a heuristic).
A variant of A* that performs a series of depth-first searches with increasing cost limits, combining the space efficiency of DFS with the optimality of A*.
A search algorithm that explores a graph by expanding the most promising node chosen according to a specified rule or heuristic.
A heuristic search algorithm that explores a graph by expanding the most promising nodes up to a fixed number of best candidates (beam width) at each level, balancing between breadth-first and depth-first search.
Feel free to fork this repository, make improvements, and submit pull requests. Contributions are welcome!