<<Previous

Best Solution   

Next>>
Introduction

The puzzle
Overview
The Goal
Playing

The algorithm
Simple
Best solution
Search
Heuristic

Program Design
Search Classes
Extensions
Display

Download

Run

Comments



The simple algorithm is easy to follow, but it may not be the "best" (i.e., the one that uses the least number of moves) to get to the solution.

More than likely, moving the "1" to the top-left corner, then the "2", and so on...  is not the "optimal" way to solve the puzzle.

Suppose one started with the "solved state":

Suppose, one "moves" only the outer blocks, as follow:

  1. Move the "13", "14","15" to the right
  2. Move the "9", "5", "1" down
  3. Move the "2", "3","4" left
  4. Move the "8", "12","15" up
by doing this, one has "turned " the outermost ring of blocks counter-clockwise:

After a few more similar counter-clockwise moves, we might get:

 If one does not notice the pattern of the blocks, one might try to move the "1" back up the current column, instead of using a clockwise movement.

What is the "best" solution? That depends on what one values. One might want the one that takes a human being the least amount of time, one that takes a computer the least amount of time, or something else.

We are trying to get the solution that uses the least number of moves. In some contexts, this is not the best: for instance, if it takes ages to figure out a "least move" solution, and what one really values is the speed of the solution.