Newsgroups: comp.ai.games,comp.misc,comp.programming
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel-eecis!news.mathworks.com!newsfeed.internetmci.com!in3.uu.net!EU.net!sun4nl!aie.nl!news
From: Geert-Jan van Opdorp <geert@circe.aie.nl>
Subject: Re: Sliding Tiles Games ?
Sender: news@aie.nl (Usenet News)
Message-ID: <wpybjrm54c.fsf@circe.aie.nl>
Date: Wed, 7 Aug 1996 18:16:51 GMT
Lines: 41
X-Nntp-Posting-Host: circe.aie.nl
References: <Pine.SUN.3.91.960730104033.14189D-100000@lune.math.tau.ac.il>
	<DvGvt8.Gpu@twinkie.agile.com>
	<Pine.SUN.3.91.960806100624.10522C-100000@lune.math.tau.ac.il>
Organization: AI Engineering BV, Amsterdam, Netherlands
X-Newsreader: Gnus v5.2.25/XEmacs 19.14
Xref: glinda.oz.cs.cmu.edu comp.ai.games:5937 comp.misc:40667 comp.programming:30546

Mertens Ron <mertero@math.tau.ac.il> writes:

> 
> > This is usually called the 15 puzzle
> > 
> > Mertens Ron (mertero@math.tau.ac.il) wrote:
> > : It's realy a NPC problem 
> > 
> > Not at all.  Implement a priority queue.
> > The value of each position is a raw count
> > of the number of places a tile needs to move
> > to return "home", assuming that all other tiles
> > disappear (that is: do not block this tile)

This is usefull as an heuristic in the A* algorithm, but the the 
resources needed are still exponential in the size of the problem.
At least if you want the shortest path. Just any path is much
cheaper ofcourse.

> hmmm.
> Well,I still hold it's NPC (hell,That's what My book tells me.Usually I 
> believe those...)
> anyway,You don't really know how much moving you'll have to do.I 
> mean,It's an 8 piece puzzle or 15.but for an N-pieces,it might still take
> you lots (exp) time...I guess someone should check it...

Yes, right. 
I have a java A* class which I use in a 8puzzle applet. The applet takes
the number of tiles as a parameter, so it is easy to try more complex
cases. Turns out that 8 tiles is solved virtually instantly, but
11 tiles, when in a nasty starting position, can be almost too much
for my 16meg linux box. 

For those interested:
  http://www.aie.nl/~geert/java/public/EightPuzzle.html

-- 
Geert-Jan van Opdorp
AI-Engineering
Amsterdam, The Netherlands
geert@aie.nl
