Classification of Search Problems http www cis temple

Classification of Search Problems http: //www. cis. temple. edu/~ingargio/cis 587/readings/constraints. html State Space Search Constraint Satisfaction Problems Optimization Problems Search Uninformed Search Ch. Eick: Introduction to Search Heuristic Search

Example: State Space Search Figure Goal: find an operator sequence that leads from the start state to the goa State Space: a 3 x 3 matrix containing the numbers 1, …, 8 and *(empty) Operators: North, South, East, West Ch. Eick: Introduction to Search

Constraint Satisfaction Problems Problem: Assign value to a set of variable V, such that a set of constraints is satisfied. Example: 8 -Queen Problem: Place queens on a 8 x 8 chessboard so that they cannot capture each other Find values for: (x 1, y 1), …, (x 8, y 8) such that: ( i, j (xi, yi) (xj, yj) Attack((xi, yi), (xj, yj)) ) i j (xi, yi) (xj, yj) Ch. Eick: Introduction to Search

Optimization Problems n Maximize f(x, y, z)=|x-y-0. 2|*|x*z-0. 8|*|0. 3 -z*z*y| with x, y, z in [0, 1] Characteristics: n No explicit operators n the path that leads to the solution is not important n Frequently involves real numbers number of solutions is not finite n Problems might be complicated by additionally requiring that the solution satisfies a set of contraints. n Life is easier if the function is continuous and differentiable e. g. classical numerical optimization techniques can directly be applied n AI and evolutionary computing are more attractive for “nasty” optimization problems. Ch. Eick: Introduction to Search

Heuristic Search augment General Search Algorithms Ch. Eick: Introduction to Search Domain-specific Knowledge

Classification of Search Algorithms To be discussed in depth Next Tueseday!! State Space Search Backtracking Best First Search A* f(n)=g(n)+h(n) Expansion Search Uniform Cost Hill Climbing Breadth First Depth First Greedy Search f(n)=h(n) Expand the best state/node with respect To an evaluation function f: N R Remark: Many other search algorithms exist that do not appear above Ch. Eick: Introduction to Search

Characterization of State Space Search Algorithms A search strategy consists of the following: n A state space S, set of operators O: S S, an initial state, and a (set of) goal state(s). n A control strategy that determines how the search space will be searched; it consists of an operator selection and state selection function: – Operator selection function: selects which operator(s) is applied to a given state – State selection function: selects the state to which an operator (selected by the operator selection function) is applied next. Remarks: Operator selection functions only return operators that have not been applied yet, and state selection functions return only states that have not been completely expanded yet (some applicable operators have not been applied to this state yet); moreover, we assume that ties are broken randomly. Ch. Eick: Introduction to Search

Example: Search Strategies for the 8 Puzzle Strategy 1 (Breadth First): Operator Selection Function: select all operators State Selection Function: Select a state s giving preference to states that are closer to the initial state i(closeness is evaluated by the number of operator applications it took to reach s from i) Strategy 2 (Backtracking with depth bound set to 3): Operator Selection Function : Select (applicable) operator by priorities: N>S>E>W State Selection Function : If the most recently created state is less than 3 operator applications away from the initial state, use this state; otherwise, use the predecessor of the most recent state. Strategy 3 (Greedy Search) Operator Selection Function: select all operators State Selection Function: Select the state s that is closest to the goal state g using a distance function d(s, g)=“number of positions in which s and g disagree” Ch. Eick: Introduction to Search

Un-graded Homework 1 2004 Assume you have to search a labyrinth of interconnected rooms trying to find a particular room that contain a red flower. There will be many intersections of walkways that connect rooms all of which look completely the same; you will not know if you entered a particular crossing before; however, you will be given a piece of chalk that allow you to mark the to put signs of your own choosing on a wall. Devise a search strategy that will find a room with a red flower assuming that such a room exists. n To be discussed on Sept. 30, 2004 in class! n Goal State Ch. Eick: Introduction to Search

Un-graded Homework 1 Problems n n n Use of search strategies that are not suitable for real-time search problem (e. g. breadth first search as explained in the textbook or best first search) --- you cannot jump between states. Propose a suitable algorithm, but it is not clearly explained how chalk is used. Algorithm chooses backtracking direction prior to unexplored directions. Some strategies are not incompletely described, and it is therefore hard to say if they work. Some strategies do not cope properly with looping (reaching the same room twice) Goal State Ch. Eick: Introduction to Search

Un-graded Homework 1 Solutions Solution 1 (does not necessarily find the flower if search space is not finite): n If you enter a new intersection, number unexplored directions 1, 2, 3, …, with chalk (do not mark the unexplored direction) and follow direction 1 and mark that you followed this direction by underlining it: 1 n If you enter an already visited intersection, follow the lowest unexplored direction and underline it before you leave; if you reach a dead-end or you traveled all possible directions, backtrack by following the unmarked direction. Solution 2: same as Solution 1, but uses depth bound and iterative deepening (explore 10 crossings, 20 crossings, 30 crossings…); 2 1 Revised on October 7, 2004!! 1 2 start 3 Ch. Eick: Introduction to Search 2 1
- Slides: 11