MilanPecov / 15-Puzzle-Solvers

This project solves the classic 15-puzzle using A* and Breadth First algorithms, implemented in Python. It features a combined heuristic of Manhattan Distance, Linear Conflict, and Walking Distance for optimal performance and includes a user-friendly graphical interface to visualize the solution
MIT License
48 stars 25 forks source link

It loops forever with this combination #2

Closed dliloch closed 3 years ago

dliloch commented 3 years ago

Hello, This combination makes it loop forever. puzzle = Puzzle([[1, 2, 3, 7], [12, 8, 15, 4], [13, 10, 11, 5], [ 9, 6, 14, 0]]) There are other combinations as well. Thanks,

MilanPecov commented 3 years ago

I added a check if the puzzle is solvable or not, this should be fixed now