Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Nine Tile Problem

The problem consists of a permutation of tiles numbered 1-8 arranged in a 3x3 matrix along with a blank tile.


The aim is find the steps in order to arrange the 3x3 matrix of tiles in the following order:

1 2 3
4 5 6
7 8


  1. The blank tile can be swapped with any non-diagonal adjacent tile (Left, Right, Up, Down)
  2. No other movement/swap is allowed.

Example Initial Configuration

1 8 4
7 2 6
3 5


An initial configuration might be unsolvable.

AStar search

AStar search is the most widely known form of best-first search that aims at minimizing the total estimated solution cost. This is achieved by the search strategy by using heuristic functions in order to optimize decision making.

You can’t perform that action at this time.