(^192) | Chapter 7: Path Finding in AI
Figure 7-9. Sample Breadth-First Search tree for 8-puzzle
Example 7-4. Breadth-First Search implementation
public Solution search(INode initial, INode goal) {
// Return now if initial is the goal
if (initial.equals(goal)) { return new Solution (initial, goal); }
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
tina meador
(Tina Meador)
#1