Overview | 177
Path Finding
in AI
Managing the board state
copy( )returns an identical copy of the board state (except for the optional
stored data);equivalent (INode)determines whether two board states are
equal(sophisticatedimplementationsmaydetectrotationalsymmetriesinthe
boardstateorothermeansforequivalence).key( )returnsanobjectsuchthat
if two board states have the samekey( )result, then the board states are
equivalent.
Figure 7-3. Sample 8-puzzle search
Algorithms in a Nutshell
Algorithms in a Nutshell By Gary Pollice, George T. Heineman, Stanley Selkow ISBN:
9780596516246 Publisher: O'Reilly Media, Inc.
Prepared for Ming Yi, Safari ID: [email protected]
Licensed by Ming Yi
Print Publication Date: 2008/10/21 User number: 594243
© 2009 Safari Books Online, LLC. This PDF is made available for personal use only during the relevant subscription term, subject to the Safari Terms of Service. Any other use