Newsgroups: comp.ai.games
Path: cantaloupe.srv.cs.cmu.edu!rochester!cornellcs!newsstand.cit.cornell.edu!portc01.blue.aol.com!news-peer.gsl.net!news.gsl.net!hunter.premier.net!feed1.news.erols.com!howland.erols.net!EU.net!usenet2.news.uk.psi.net!uknet!usenet1.news.uk.psi.net!uknet!psinntp!psinntp!ncrgw2.ncr.com!ncrhub6!ncrcan!news
From: Michael Cupit <mcupit@century1.canada.ncr.com>
Subject: Re: Slide-puzzle solving
Message-ID: <E020Cx.43o@ncrcan.canada.ncr.com>
Sender: news@ncrcan.canada.ncr.com (Network News)
Reply-To: mcupit@century1.canada.ncr.com (mcupit)
Organization: AT&T Global Information Solutions
X-Newsreader: DiscussIT 2.5.1.3 for MS Windows [AT&T Software Products Division]
References: <y9f9190o39i.fsf@gere.ifi.uio.no>
Date: Tue, 29 Oct 1996 20:17:20 GMT
Lines: 31


>==========Lars Haugseth, 10/21/96==========
>
>
>I need an algorithm for solving slide-puzzles, especially for
>3x3 grids, but a generic algorithm is prefered.
>
>I want the pieces to end up in this manner:
>
>+---+---+---+
>| 1 | 2 | 3 |
>+---+---+---+
>| 4 | 5 | 6 |
>+---+---+---+
>| 7 | 8 |   |
>+---+---+---+
>
>Any hints would be greatly appreciated.
>
>-- 
>Lars Haugseth <larshau@ifi.uio.no>

How about assigning 1 point for each square that is in the
correct position. Look at each of the two or three moves that
are possible for each situation, and choose the move that gives
the greatest point value. Then reassess the next two or three
moves and select again. Be careful not to allow the program to
undo the last move, or you might end up in a loop.

Michael Cupit <michael@ontrac.ccs.yorku.ca>

