thumb|right|a solved 15-puzzle the 15-puzzle (also called gem puzzle, boss puzzle, game of fifteen, mystic square and many others) is a sliding puzzle that consists of a frame of numbered square tiles in random order with one tile missing. the puzzle also exists in other sizes, particularly the smaller 8-puzzle. if the size is 3Ã3 tiles, the puzzle is called the 8-puzzle or 9-puzzle, and if 4Ã4 tiles, the puzzle is called the 15-puzzle or 16-puzzle named, respectively, for the number of tiles and the number of spaces. the object of the puzzle is to place the tiles in order (see diagram) by making sliding moves that use the empty space. the n-puzzle is a classical problem for modelling algorithms involving heuristics. commonly used heuristics for this problem include counting the number of misplaced tiles and finding the sum of the taxicab distances between each block and its position in the goal configuration. note that both are admissible, i.e., they never overestimate the number of moves left, which ensures optimality for certain search algorithms such as a*. ==solvability==  used a parity argument to show that half of the starting positions for the n-puzzle are impossible to resolve, no matter how many moves are made. this is done by considering a function of the tile configuration that is invariant under any valid move, and then using this to partition the space of all possible labeled states into two equivalence classes of reachable and unreachable states. the invariant is the parity of the permutation of all 16 squares plus the parity of the taxicab distance (number of rows plus number of columns) of the empty square from the lower right corner. this is an invariant because each move changes both the parity of the permutation and the parity of the taxicab distance. in particular if the empty square is in the lower right corner then the puzzle is solvable if and only if the permutation of the remaining pieces is even.  also showed that the converse holds on boards of size m&times;n provided m and n are both at least 2: all even permutations are solvable. this is straightforward but a little messy to prove by induction on m and n starting with m=n=2.  gave another proof, based on defining equivalence classes via a hamiltonian path.  studied the analogue of the 15 puzzle on arbitrary finite connected and non-separable graphs. (a graph is called separable if removing a vertex increases the number of components.) he showed that, except for polygons, and one exceptional graph on 7 vertices, it is possible to obtain all permutations unless the 
Combination_puzzles Mechanical_puzzles NP-complete_problems Permutations Puzzles