Enter your search keyword(s): Click to search our directories-AllWebHunt, Encyclopedic, TopChoice, Or Google, Alexa, About & Yahoo:

Puzzles
Home / Top / Shopping / Toys and Games / Games / Puzzles See also:
Related articles

Edit | Discuss Article

# N-puzzle

The n-puzzle is known in various versions, including the 8 puzzle, the 15 puzzle, and with various names. It is a sliding puzzle that consists of a grid of numbered squares with one square missing, and the labels on the squares jumbled up. If the grid is 3×3, the puzzle is called the 8-puzzle or 9-puzzle. If the grid is 4×4, the puzzle is called the 15-puzzle or 16-puzzle. The goal of the puzzle is to un-jumble the squares by only making moves which slide squares into the empty space, in turn revealing another empty space in the position of the moved piece.

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 Manhattan 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*.

It is possible to use parity arguments to show that some 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 labelled states into equivalence classes of reachable and unreachable states.

## How Sam Loyd made his fortune

In its most famous version, the fifteen puzzle is a game in which 15 of the 16 squares of a 4×4 frame are filled with numbered sliding pieces, leaving one space in which to slide one piece at a time. The object is to slide the 15 pieces into numerical order.

Thus, the goal is to produce this configuration:

If the pieces 14 and 15 are exchanged, resulting in the following initial configuration:
then the puzzle is not soluble.

The "hook" in the fifteen puzzle is that there are two distinct sets of positions which can be assembled from the pieces with different parity, and there is no way of moving between them using the allowed moves, as they preserve parity. The parity in this context (the invariant) is the parity (odd or even) of the number of pairs of pieces in reverse order plus the row number of the empty square. For the order of the 15 pieces consider line 2 after line 1, etc., like words on a page.

Thus an even permutation of the order of the 15 pieces can only be obtained if the empty square is not moved or moved two rows, and an odd permutation of the order of the 15 pieces can only be obtained if the empty square is moved one or three rows.

By contrast, note that considering the parity of permutations of all 16 squares (15 pieces plus empty square) is not meaningful here, because it changes with every move.

This allowed Sam Loyd, who invented the puzzle in the 1870s, to offer a prize of \$1000 which could never be claimed, fueling the popularity of the game. The game became a craze in both the USA and in Europe.

For larger versions of the fifteen puzzle, the problem of finding a solution is easy. The problem of finding the shortest solution is NP-hard.

Spilsbury Puzzle Co.
Offers hard to find puzzles, games, and gifts for all ages.
http://www.gopuzzles.com/

Leisure Store
Puzzles, card games, and crosswords for all ages.
http://www.leisurestore.com/

Frik-n-Frak's Curio Shack
Offers puzzle boxes, brain teasers, mechanical puzzles and gift ideas.
http://www.frik-n-frak.com

Lonpos Magic Pyramid Puzzles
Offers Lonpos magic pyramid puzzles containing many 2D and 3D problems in 12 levels of difficulty.
http://www.brain-teasers-puzzle.com

Puzzles Plus
Offers jigsaws, brain teasers, learning games, and 3D puzzles.
http://www.puzzlesplus.net/

JigBoxx Puzzles
Offering a large number of puzzles in a variety of themes. Canada.
http://www.jigboxx.com/

IQ Puzzles
Featuring a variety of puzzles, including jigsaws, 3-D, wooden boxes, and distanglements.
http://www.iqpuzzles.com/

Suttle's Shuffle
Brain buster puzzle.
http://www.suttles-shuffle.com/

Elverson Puzzle Company
Jacob's Revenge bottle and log stacker puzzles. Also a slot machine card game.
http://www.elversonpuzzle.com/

BrainPuzzles.com
Offering over 20 puzzles from simple to difficult.
http://www.brainpuzzles.com/

New Vision Toys
Maker of K'niblin Pins, a ring puzzle game.
http://quicksitebuilder.cnet.com/nvtjohnson/

Out of the Hat
Offering wooden puzzles, traditional english pub games, playing cards and jigsaw puzzles.
http://www.outofthehat.co.uk/

Geomy
Offering an assortment of symmetry puzzles.
http://www.paxes.co.jp/english/index-ep.html

Puzzle Master
Metal and wood puzzles for any age.
http://www.puzzlemaster.ca/

Puzzleman.com
An exclusive collection of three-dimensional mechanical puzzles.
http://www.puzzleman.com/

Cage Rage
Offering a ball-in-cage mechanical puzzle.
http://www.cagerage.com/

Mamasoes
Provides educational hand made puzzles for 2 to 6 year olds
http://www.mamasoes.com/

King Beaver Woodworks
Offering custom hand-crafted clothes hangers and puzzles using a child's name.
http://www.kingbeaver.com/

Tangle Toys - Twisted Good Fun
Mind boggling and stress relieving puzzles for all ages.
http://www.tangletoys.com

Birk Puzzles
Large cardboard puzzles for children.
http://www.bjorkholm.com/birk/start.html

Mindkind
Mechanical puzzles.
http://mindkind.iceweb-system.com/

Mr Puzzle Australia
Wooden puzzles and brainteasers. View by degree of difficulty. Printed solution with all puzzles.
http://www.mrpuzzle.com.au/

Puzzles Plus
Specialist retailer of jigsaws, puzzles and chess sets.
http://www.puzzlesplus.co.uk/

Little Folks Puzzle Company
Offers giant floor puzzles featuring big, chunky pieces for little hands.
http://www.littlefolkspuzzle.com/

OP Puzzle Company
Offers complete or plans for six piece three dimensional puzzle.
http://oploftbed.com/oppuzzle/

Imaginatorium Shop
Various sized puzzles from Japan. Includes temples, gardens, castles, landscapes, and art series.
http://imaginatorium.org/shop/

Jigsaw Jungle Puzzle Store
Sells a wide range of puzzles for all ages, including early years puzzles and 3d puzzles.
http://www.jigsawjungle.com

Best Quality Toys
Offers puzzles, games and wheeled toys. Also stocks the worlds largest puzzle.
http://www.bestqualitytoys.com/

It's Cubular
Offers mugs, candles and gift boxes for the crossword puzzle enthusiast.
http://itscubular.com/

Bits And Pieces UK
Offer their own exclusive puzzles. Their range includes, jigsaws, wooden brainteasers and other novelties.
http://www.bitsandpiecesuk.com

Magic Chain
Offers a novelty puzzle that will amuse and boggle everyone!
http://www.magic-chain.com

Puzzle Warehouse
Wide selection of puzzles from 500 to 18000 pieces. Also sell tavern puzzles.
http://www.puzzlewarehouse.com/