l4_pr_java3

l4_pr_java3 - Problem Set #2 Implement 4 kinds of...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Problem Solving with Java Session 4 Problem Set #2 • Implement 4 kinds of uninformed search: – DFS, BFS, DLS, IDS • Demonstrate that it works • Test it. • Do some analysis • Preview of PS3 – More testing of 4 search algorithms – Extend code to add A* search –E tc . What we expect Implementation should be well written! – Good use of data and procedural abstraction. • Define abstract data types rather than using built in types. • Don’t violate abstraction barriers. – Good use of classes • Abstract data types. • Appropriate use of subclassing • Appropriate use of interfaces – Good testing with Junit – Generalize generalize generalize… Depth-Limited Search Same as Depth-First Search except that after the depth limit has been reached it doesn’t go any deeper. S D B A C G C G D C G Level 1 Level 2 Level 0 Level 3 Compare BFS & DFS • Depth First Search – much slower than BFS • Breadth First Search – uses much more space than DFS • Breadth First finds shortest path – not DFS • Breadth First search guaranteed to find path BFS DFS Find Path Optimal Space Time Iterative Deepening (IDS) S D B A C G C G D C G Level 1 Level 2 Level 0 Level 3 Idea: • Explore tree in breadth-first order, using depth-first search. Î Search tree to
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Iterative Deepening (IDS) S D B A C G C G D C G Level 1 Level 2 Level 0 Level 3 Idea: • Explore tree in breadth-first order, using depth-first search. Î Search tree to depth 1, then 2, …. Iterative Deepening (IDS) S D B A C G C G D C G Idea: • Explore tree in breadth-first order, using depth-first search. Î Search tree to depth 1, then 2, then 3 …. Level 1 Level 2 Level 0 Level 3 Summary • Complexity analysis shows that breadth-first is preferred in terms of optimality and time, while depth-first is preferred in terms of space. • Iterative deepening draws the best from depth-first and breadth-first search. Abstract classes and interfaces
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/07/2011 for the course AERO 16.410 taught by Professor Brianwilliams during the Fall '05 term at MIT.

Page1 / 5

l4_pr_java3 - Problem Set #2 Implement 4 kinds of...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online