Python solution to sliding 8-puzzle
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore Initial commit Apr 18, 2016 Add docs Apr 19, 2016
LICENSE Initial commit Apr 18, 2016 Update Apr 20, 2016
table.pkl Refactor Apr 19, 2016


Python solution to sliding 8-puzzle. We start with the final state

8 4

and compute all states reachable by it, depth-first. The resulting table has ~180,000 entries and is saved to a file (table.pkl) for faster queries. The table takes about 6 seconds to be built and persisted on my machine, and subsequent queries are practically instantaneous. The worst case requires 30 steps to solve.