<<Previous Fifteen Puzzle Extensions Next>>
Introduction

The puzzle
Overview
The Goal
Playing

The algorithm
Simple
Best solution
Search
Heuristic

Program Design
Search Classes
Extensions
Display

Download

Run

Comments

To solve a particular problem, like the "15 Puzzle", we use and extend the more generalized set of classes.

The specific classes developed for the "15-puzzle" are:

FifteenNode: This extends the NodeState abstract class and implements a representation of the state of the puzzle (as a simple grid of integers).
FifteenHeuristic: Implements the Heuristic interface, using the "Manhattan distance" measure.

To solve another problem domain all one needs is a similar set of classes. You need a class to represent the a current state and a method of computing a heuristic. Once you have these two, the search will be performed by the Searcher

Currently, the heuristic must be a positive integer.