4. Why is it that the best first search is more effective than hill climbing?

Similar documents
AI: A Modern Approach, Chpts. 3-4 Russell and Norvig

Informed search algorithms. Chapter 4, Sections 1 2 1

An Introduction to The A* Algorithm

Seminar. Path planning using Voronoi diagrams and B-Splines. Stefano Martina

Measuring the Performance of an Agent

Smart Graphics: Methoden 3 Suche, Constraints

Search methods motivation 1

6.02 Practice Problems: Routing

WAN Wide Area Networks. Packet Switch Operation. Packet Switches. COMP476 Networked Computer Systems. WANs are made of store and forward switches.

BASIC RULES OF CHESS

International Journal of Advanced Research in Computer Science and Software Engineering

Properties of Real Numbers

West Virginia University College of Engineering and Mineral Resources. Computer Engineering 313 Spring 2010

Random Map Generator v1.0 User s Guide

Lecture 2.1 : The Distributed Bellman-Ford Algorithm. Lecture 2.2 : The Destination Sequenced Distance Vector (DSDV) protocol

2. (a) Explain the strassen s matrix multiplication. (b) Write deletion algorithm, of Binary search tree. [8+8]

POLYNOMIAL FUNCTIONS

Binary Search Trees. A Generic Tree. Binary Trees. Nodes in a binary search tree ( B-S-T) are of the form. P parent. Key. Satellite data L R

Scheduling. Getting Started. Scheduling 79

Y. Xiang, Constraint Satisfaction Problems

Genetic Algorithms and Sudoku

Introduction Solvability Rules Computer Solution Implementation. Connect Four. March 9, Connect Four

Cpt S 223. School of EECS, WSU

The Taxman Game. Robert K. Moniot September 5, 2003

CAB TRAVEL TIME PREDICTI - BASED ON HISTORICAL TRIP OBSERVATION

Dynamic Programming. Lecture Overview Introduction

IE 680 Special Topics in Production Systems: Networks, Routing and Logistics*

Approximation Algorithms

SUPPLY CHAIN OPTIMIZATION MODELS IN THE AREA OF OPERATION

Operations: search;; min;; max;; predecessor;; successor. Time O(h) with h height of the tree (more on later).

Chinese postman problem

Answer Key for California State Standards: Algebra I

Session 7 Bivariate Data and Analysis

CS MidTerm Exam 4/1/2004 Name: KEY. Page Max Score Total 139

Geometry Solve real life and mathematical problems involving angle measure, area, surface area and volume.

PCB ROUTERS AND ROUTING METHODS

Networks and Paths. The study of networks in mathematics began in the middle 1700 s with a famous puzzle called the Seven Bridges of Konigsburg.

Location Information Services in Mobile Ad Hoc Networks

Complete Solution of the Eight-Puzzle and the Benefit of Node Ordering in IDA*

Dynamic programming. Doctoral course Optimization on graphs - Lecture 4.1. Giovanni Righini. January 17 th, 2013

Linear Programming for Optimization. Mark A. Schulze, Ph.D. Perceptive Scientific Instruments, Inc.

Project Scheduling: PERT/CPM

A. O. Odior Department of Production Engineering University of Benin, Edo State.

Binary Search Trees CMPSC 122

Area and Perimeter: The Mysterious Connection TEACHER EDITION

A Strategy for Teaching Finite Element Analysis to Undergraduate Students

TEACHER S GUIDE TO RUSH HOUR

Graph Theory Problems and Solutions

MEASURES OF VARIATION

Analysis of Micromouse Maze Solving Algorithms

USING BACKTRACKING TO SOLVE THE SCRAMBLE SQUARES PUZZLE

Question 2: How will changes in the objective function s coefficients change the optimal solution?

Fast Sequential Summation Algorithms Using Augmented Data Structures

for the Bill Hanlon

Introduction to Metropolitan Area Networks and Wide Area Networks

Decision Mathematics 1 TUESDAY 22 JANUARY 2008

25 Integers: Addition and Subtraction

Home Page. Data Structures. Title Page. Page 1 of 24. Go Back. Full Screen. Close. Quit

1. I have 4 sides. My opposite sides are equal. I have 4 right angles. Which shape am I?

Factorizations: Searching for Factor Strings

4 UNIT FOUR: Transportation and Assignment problems

INTERNATIONAL JOURNAL OF COMPUTER ENGINEERING & TECHNOLOGY (IJCET)

Multiplying and Dividing Signed Numbers. Finding the Product of Two Signed Numbers. (a) (3)( 4) ( 4) ( 4) ( 4) 12 (b) (4)( 5) ( 5) ( 5) ( 5) ( 5) 20

Study And Comparison Of Mobile Ad-Hoc Networks Using Ant Colony Optimization

Decision Mathematics D1. Advanced/Advanced Subsidiary. Friday 12 January 2007 Morning Time: 1 hour 30 minutes. D1 answer book

Chapter 4 Online Appendix: The Mathematics of Utility Functions

CS104: Data Structures and Object-Oriented Design (Fall 2013) October 24, 2013: Priority Queues Scribes: CS 104 Teaching Team

Learning to Search More Efficiently from Experience: A Multi-Heuristic Approach

CSE 326, Data Structures. Sample Final Exam. Problem Max Points Score 1 14 (2x7) 2 18 (3x6) Total 92.

Enumerating possible Sudoku grids

Traffic Engineering Management Concepts

Network Planning and Analysis

Session 6 Number Theory

What is a parabola? It is geometrically defined by a set of points or locus of points that are

2 SYSTEM DESCRIPTION TECHNIQUES

Sudoku puzzles and how to solve them

Introduction to Project Management

You can probably work with decimal. binary numbers needed by the. Working with binary numbers is time- consuming & error-prone.

A Review on Load Balancing In Cloud Computing 1

7 Literal Equations and

Practical Guide to the Simplex Method of Linear Programming

SUPPLEMENT TO CHAPTER 6 MINIMUM SPANNING-TREE PROBLEMS

Network Load Balancing Using Ant Colony Optimization

Series and Parallel Circuits

Contents. Sample worksheet from

Chapter 10: Network Flow Programming

CMPSCI611: Approximating MAX-CUT Lecture 20

CRITICAL PATH ANALYSIS AND GANTT CHARTS

Operation Count; Numerical Linear Algebra

FP1. HiSET TM Mathematics Practice Test

/ Operating Systems I. Process Scheduling. Warren R. Carithers Rob Duncan

The Effects of Start Prices on the Performance of the Certainty Equivalent Pricing Policy

Rational Exponents. Squaring both sides of the equation yields. and to be consistent, we must have

Krishna Institute of Engineering & Technology, Ghaziabad Department of Computer Application MCA-213 : DATA STRUCTURES USING C

Definition 8.1 Two inequalities are equivalent if they have the same solution set. Add or Subtract the same value on both sides of the inequality.

Chapter 6. Decoding. Statistical Machine Translation

Transcription:

Abstract: The following questions and exercises are from chapter 3, Informed Search. This chapter covers the use of heuristics in search and how to evaluate the effectiveness of heuristics and search algorithms. Various algorithms are covered as well. It starts with hill climbing, best first search, and beam search. These algorithms are all similar in that they are forward looking, determining the best path based only on an estimation of the distance remaining to their goal. Branch and bound algorithms are covered next as well as the A* algorithms which are backward looking in that they keep track of and make use of the distance traveled to determine the best path to their goal. Finally constraint satisfaction search, using constraints to break a problem into multiple smaller problems, and bidirectional search, searching from both ends until you meet in the middle, are covered. uestions: 2. Explain why hill climbing would be classified as a greedy algorithm. Hill climbing is a greedy algorithm because the next move is governed by a single measurement. It also does not track past moves or have an ability to recover from bad moves. 4. Why is it that the best first search is more effective than hill climbing? It is more effective because it keeps a list of open nodes that are on the fringe of the search and that can be later explored if needed. So if the search heads down a path that ends up being bad then the algorithm can backtrack to previous nodes in order to find an alternate path. 5. Explain how beam search works. Beam search is a modification to breadth first search. It works the same way as breadth first search but adds some heuristics in order to limit the breadth of the search to a specific width for each level of the search. For example, if the beam width is 2 then the search will only follow the 2 best options at each level of the search. An infinite beam width would be the same as a breadth first search.

7. What does it mean for a heuristic to be more informed than another heuristic? When one heuristic is more informed than another it means that that heuristic saves us more effort in finding our goal than the other heuristic. For example it could allow us to solve a puzzle in fewer moves than another heuristic. 8. What is the idea behind branch and bound search? The idea behind branch and bound search is that the distance traveled is tracked and the shortest complete path so far is the one taken. As the search progresses if the current path becomes longer than a previous path, it can be abandoned while a previous and now shorter path is followed. It continues to expand only what is needed to know that it is currently still on the most optimal path. Exercises: 2. Explain why hill climbing is called a greedy algorithm. Hill climbing, at every step that it needs to make a choice will take the first path that is better than the current path. It also does not track past moves or have an ability to recover from bad moves. a. Describe some other algorithms that you know that are greedy. Dijkstra s shortest path algorithm is an example of a greedy algorithm. It always takes the shortest path found between two nodes until it reaches its destination. b. Explain how steepest ascent hill climbing is an improvement over simple hill climbing. Steepest ascent hill climbing is an improvement because it allows all successor nodes to be evaluated to see which is best rather than just taking the first one that is better. c. How does the best first search improve over hill climbing? Best first search maintains a list of open nodes that it can use to backtrack to a previous path that may be better than the current path. This allows it to recover from bad choices that end up not being fruitful.

3. Suggest an admissible heuristic, not mentioned in the text, for solving the 3 puzzle. An admissible heuristic would be to average the tiles out of place heuristic with the total manhattan distance heuristic. a. Employ your heuristic to conduct an A* search to solve the instance of the puzzle presented in this chapter. b. Is your heuristic more of less informed than the two heuristics that are presented?

Given that it is the average of the 2 heuristics and given that the manhattan distance is more informed than the number of tiles out of place, this heuristic is in general more informed than the number of tiles out of place and less informed than the total manhattan distance. 6. Consider the following variation of the n ueens Problem: If some of the squares that would be attacked by the placement are obstructed by the placement of pawns on an n x n chessboard, can more than n ueens be placed on the partial board that remains? For example, if file pawns are added to a 3 x 3 chessboard, then four nonattacking ueens may be placed on the board (Figure 3.30). P P P P P For ueens on a 3 x 3 Chessboard with five Pawns strategically placed. How many nonattacking ueens may be placed on a 5 x 5 chessboard if one has 3 Pawns at one s disposal? There are a couple of different ways in which to look at this problem. If we are allowed to flood the board with Pawns similar to the 3 x 3 example then we can always fit ceil(n/2) 2 ueens on the board using the same pattern. If we must take a valid solution and try and add more queens to it then we can do so if the solution has 4 squares open in a corner. This will not be possible for all solutions but it is possible for some. For example,

P P P 7. Use both the plain vanilla branch and bound, and branch and bound with dynamic programming, to get from the start node (S) to the goal node (G) in parts (a) and (b) of Figure 3.31. When all else is equal, explore nodes in alphabetical order. Note: The graph for part a in the book lacks a value for the path between E and F, so a value of 1 was assumed. Note: The boxes illustrating the steps in the traversal diagram highlight the nodes revealed in that step, the common parent of those nodes is the node that was opened in that step. a) Plain Vanilla Branch and Bound

Step 1: We expand our start node S to find nodes B and C. Step 2: Node B is at the top of our list since it has the lowest cost, we expand it to find nodes A and D. Step 3: Node A has the lowest overall cost of 2 so we expand it to find node D. Step 4: Node D has an overall cost of 3 which is more than the previously seen node C, so we expand node C to find nodes E and F. Step 5: Nodes E and F both have an overall cost of 6 which is more than the 3 we hav previously seen with node D. We expand node D to find node C. Step 6: C, with a cost of 4, is still our lowest costing path. We expand C to find nodes E and F. Step 7: Node D with a cost of 5 is now our lowest costing path so we expand it to reveal node C. Step 8: The just revealed node C is tied for lowest costing path with E and F at 6. C is taken first and expanded to reveal nodes E and F. Step 9: E at a cost of 6 is now our best path, we expand it to reveal node F. Step 10: F at a cost of 6 is now our best path, we expand it to reveal node G. This is our goal node but there still exists paths that have a cost that is less than that if G at 11 so they must be expanded until we can see that they cost more or that they yield a better result. Step 11: F at 7 is expanded to reveal G with a cost of 12. This is more than our curren best goal of G with a cost of 12 so we can abandon this path. Step 12: E with a cost of 8 is now expanded to reveal F with a cost of 9. Step 13: F with a cost of 8 is now expanded to reveal G with a cost of 13. This is more than our current best cost of 11 so this branch can be abandoned. Step 14: F with a cost of 9 is now expanded to reveal G with a cost of 14. This is more than our current best cost of 11 so this branch can be abandoned. Step 15: E with a cost of 10 is now expanded to reveal F with a cost of 11. Step 16: F with a cost of 10 is now expanded to reveal G with a cost of 12. This is more than our current best cost of 11 so this branch can be abandoned. Step 17: F with a cost of 11 is the same as our best path of G at 11 but since F needs to be evaluated before G we expand it to reveal G with a cost of 16. This branch can

now be abandoned. All paths have now been evaluated to a point where they either terminate or cost more than our best path to G with a cost of 11. The goal node was found in step 10 with an optimal cost of 11. a) Branch and Bound with Dynamic Programming Step 1: We expand our start node S to find nodes B and C.

Step 2: Node B is at the top of our list since it has the lowest cost, we expand it to find nodes A and D. Step 3: Node A has the lowest overall cost of 2 so we expand it to find node D again. This path to D has an overall cost of 3 versus the previous path to D which had an overall cost of 5 so we abandon the previous path to D. Step 4: Node D has an overall cost of 3 which is more than the previously seen node C, so we expand node C to find nodes E and F. Step 5: Nodes E and F both have an overall cost of 6 which is more than the 3 we hav previously seen with node D. We expand node D to find node C again and reach the end of this subtree since we already have a shorter path to C. Step 6: Nodes E and F have the same overall cost and so we break the tie using alphabetical order. We expand node E to find node F again. Step 7: We continue back from our previous F since it was the shorter path and expand it to find node G. Node G is our goal with an overall cost of 11. The goal node was found in step 7 with an optimal cost of 11. b) Plain Vanilla Branch and Bound

Step 1: We expand node S to reveal nodes A and C.

Step 2: A and C have the same cost so we expand A to reveal B and C. Step 3: C has the lowest cost so we it to reveal B and D. Step 4: B is opened to reveal E. Step 5: B is opened again to reveal E. Step 6: C is opened again to reveal B and D. Step 7: B is opened again to reveal E. Step 8: D is opened to reveal E again and our goal node G. Step 9: E is opened to reveal C again. Step 10: E is opened again to reveal C again. Step 11: C is opened again to reveal B and D again. The cost to D is higher than the cost to our goal node so D will not be followed any further. Step 12: C is opened again to reveal B and D again. Step 13: D is opened to reveal E again and our goal node G. The cost of this path to G is higher than the previous path to G. Step 14: E is opened again to reveal C again. Step 15: E is opened again to reveal C again. Step 16: B is opened again to reveal E again. The cost to E is higher than the cost to our goal node so E will not be followed any further. Step 17: B is opened again to reveal E again. The cost to E is higher than the cost to our goal node so E will not be followed any further. Step 18: C is opened again to reveal B and D again. The cost to D is higher than the cost to our goal node so D will not be followed any further. Step 19: C is opened again to reveal B and D again. The cost to D is higher than the cost to our goal node so D will not be followed any further. Step 20: E is opened to reveal C again. Step 21: B is opened again to reveal E again. The cost to E is higher than the cost to our goal node so E will not be followed any further.

Step 22: B is opened again to reveal E again. The cost to E is higher than the cost to our goal node so E will not be followed any further. Step 23: C is opened again to reveal B and D again. The cost to both B and D is highe than the cost to our goal node so neither node will not be followed any further. The goal node was found in step 8 with a optimal cost of 9. b) Branch and Bound with Dynamic Programming Step 1: We expand node S to reveal nodes A and C.

Step 2: A and C have the same cost so we expand A to reveal B and C. C has already been seen at a lower cost so we will not be following it again. Step 3: C has the lowest cost so we it to reveal B and D. B has already been seen at an equal value so we will not be following it again. Step 4: B has the lowest cost so we expand it to reveal 3. Step 5: D is tied with E but is opened first because ties are broken alphabetically. E and G are revealed. E has already been encountered at a lower cost. G is our goal node and was found with a cost of 9. Step 6: E is next to be evaluated since it still has a lower cost than our goal. C is revealed, since we have seen it before at a lower cost it ends our traversal. The goal node was found in step 5 with a optimal cost of 9. 9. Suggest an admissible heuristic for the Water Jug Problem. If the cost is equal to the amount of water moved then an admissible heuristic could be the absolute value of the goal subtracted from the value of the jug that can hold the goal. This is admissible because it is always less than or equal to the cost to the solution. a. Employ your heuristic to conduct an A* search to solve the instance of this problem presented in Chapter 1. h(n) = x 12 where x is the number of quarts of water in the 18 qt jug. f(n) = the number of quarts of water that have been moved. The possible moves at each step are filling the large container from the well (WA), filling the small container from the well (WB), pouring the large container into the small container (AB), pouring the small container into the large container (BA), dumping the large container into the well (AW), dumping the small container into the well (BW). The solution is found on step 17 and there are no competing paths that need to be evaluated.