Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ispobock/n_puzzle

BFS & A* algorithm to solve N_puzzle problem
https://github.com/ispobock/n_puzzle

astar bfs npuzzle python3

Last synced: 8 days ago
JSON representation

BFS & A* algorithm to solve N_puzzle problem

Awesome Lists containing this project

README

        

# N_puzzle
Two algorithms to solve [N_puzzle problem](https://en.wikipedia.org/wiki/15_puzzle).

![8-puzzle-example](./figs/8-puzzle.png)

## Requirements
- Python3

## Algorithms
- BFS (Breadth-first search)
- Can find an optimal solution, but time-consuming.
- A* algorithm
- An efficient heuristic algorithm.
- Cost function:`steps_from_start + manhattan_distance_to_goal`