Lecture 2: Problem Solving and Search

Size: px
Start display at page:

Download "Lecture 2: Problem Solving and Search"

Transcription

1 Lecture 2: Problem Solving and Search ACSC 368 Harris Papadopoulos Problem Solving as State-Space Search Consider finite problems that can be represented in terms of: an initial state, one or more goal states, and a set of operators to transform the system from one state to another. Solving the problem may correspond to: either reaching a goal state, or finding the best (or at least an acceptable) sequence of operations to reach a goal state. The Wolf, Goat and Cabbage Problem The Wolf, Goat and Cabbage Problem (cont.) A farmer and his wolf, goat, and cabbage come to the north side of a river that they wish to cross. There is a boat, but it has only room for two, and the farmer is the only one that can row. If the goat and the cabbage are left alone together, the goat will eat the cabbage. Similarly, if the wolf and the goat are together without the farmer, the goat will be eaten. Devise a series of crossings of the river so that all concerned make it across safely. itial State: Goal State: Operators: Wolf, goat, cabbage and farmer are on the north side of the river. Wolf, goat, cabbage and farmer are on the south side of the river. Farmer can move one thing at a time across the river in the boat, or he can cross alone. But the goat cannot be left alone with the cabbage or with the wolf. Prolog Representation of WGC Prolog Representation of WGC initial(([f, w, g, c], [])). final(([], [f, w, g, c])). % operators of the form: % next_state(state, NewState) next_state(([f N], S), (N, [f S])) :- move(n, S, N, S), safe(n). next_state((n, [f S]), ([f N], S)) :- move(s, N, S, N), safe(s). % move of w, or g, or c, and not f move(a, B, A, B). move(a, B, A, [M B]) :- select(m, A, A). % when is a side of the river safe if the farmer is not there? safe([g]). safe(l) :- not(member(g, L)).

2 Blind Search Systematic exploration of a search tree, making no use of knowledge about the particular problem. Depth-first search: Search used by the Prolog interpreter. Simple to implement, but may get stuck in an infinite branch and fail to find a goal state in another branch. May not find shortest route to goal. Breadth-first search: Visit all states at one level before moving on to the next. Will inevitably find a shortest route to a goal state, but requires a large amount of memory. Depth-First Search 2 A B C 3 D 4 E F Go H J K 8 Go L M N O P 6 Q 7 R S T U V Depth-First Search Algorithm To extend a path into an answer-path do if the path has reached a goal state then return it as an answer-path else if the current path can be extended to a new state then save the current state and continue to extend the path from the new state else backtrack to extend the path from the previous state to a different child To extend the path into a new state do find another state which can be reached from the last state in the path; the state found is the new state Depth-First Search Algorithm To extend a path into an answer-path do if the path has reached a goal state then return it as an answer-path else if the current path can be extended to a new state then save the current state and continue to extend the path from the new state else backtrack to extend the path from the previous state to a different child To extend the path into a new state do find another state which can be reached from the last state in the path and which does not already occur in the path; the state found is the new state Depth-First Search in Prolog depth_first_search(anspath) :- initial(it), depth_first([it], AnsPath). depth_first([s Path], [S]) :- final(s),!. depth_first([s Path], [S AnsPath]) :- extend([s Path], S), depth_first([s, S Path], AnsPath). extend([s Path], S) :- next_state(s, S), not(member(s, [S Path])). Breadth-First Search 2 A 3 B 4 C D 6 E 7 F 8 Go H J K Go L M N O P 2

3 Breadth-First Search Algorithm To search for an answer-path do create a queue containing a single path consisting of the initial state, and apply the breadth-first procedure to expand this queue until an answer-path is found. To expand a queue do if any path in the queue has reached a goal state then return that path as an answer-path else expand the first path of the queue in all possible ways creating a list of the resulting paths, append the list of extended paths to the end of the queue, remove the first path from the queue, and continue to expand the new queue Breadth-First Search Algorithm (cont.) To expand a path in all possible ways and create a list of the resulting paths do collect all paths S + path, where S is an extended state of path, into a list Breadth-First Search in Prolog breadth_first_search(anspath) :- initial(it), breadth_first([[it]], AnsPath). breadth_first(pathq, AnsPath) :- member([s RestP], PathQ), final(s),!, reverse([s RestP], AnsPath). breadth_first([path RestQ], AnsPath) :- expand(path, NewPaths), append(restq, NewPaths, PathQ), breadth_first(pathq, AnsPath). expand(path, List) :- setof([s Path], extend(path, S), List),!. expand(path, []). % in case setof fails: node has no successor Heuristic Search The use of heuristics, based on knowledge of the problem, improves the efficiency of a search process by providing a control strategy. Its effect is to prune the search tree. Heuristics are rules of thumb. They often provide a good solution but not necessarily the best: they are approximations and are not guaranteed to be right. They may even lead to a dead end. Heuristics may just be incorporated in operations (e.g. this state, such-and-such is likely to be a sensible action ). More usefully we calculate a heuristic evaluation function, which estimates the value of a possible next state. Evaluation Functions An evaluation function maps a problem state to a numeric value, which measures the desirability of that state relative to the problem to be solved; the smallest the value for a state, the more desirable it is. Which aspects of the problem state are considered, how these are evaluated, and how much weight is given to each one, are chosen in such a way that the value of the function at a given node in the search tree gives as good an estimate as possible of whether that node is on the path to a solution. Examples: Chess: Material advantage of the player. Route-finding: Distance from destination. Hill-Climbing Search Depth-First Search guided by an evaluation function (6) 2 A (28) B (29) C (48) 3 D 4 E (32) F Go H (22) J (36) (24) (3) (0) (29) K Go L M N (9) O P (2) (0) (2) (33) (88) (32) (24) (27) (6) (6) (3) 3

4 Hill-Climbing Search Algorithm To extend a path into an answer-path do if the path has reached a goal state then return it as an answer-path else if the current path can be extended to a new state then save the current state and continue to extend the path from the best new state else backtrack to extend the path from the previous state to the next best child To extend the path into the best new state do create a list of all possible states which can be reached from the last state in the path ordered in increasing value, and find the first state in this list which does not already occur in the path; this is the best new state Hill-Climbing Search in Prolog hill_climb_search(anspath) :- initial(it), hill_climb([it], AnsPath). hill_climb([s Path], [S]) :- final(s),!. hill_climb([s Path], [S AnsPath]) :- extend_best([s Path], S), hill_climb([s, S Path], AnsPath). extend_best([s Path], S) :- best_next_state(s, S), not(member(s, [S Path])). best_next_state(s, S) :- setof((v,ns), (next_state(s,ns), value(ns,v)), List), member((v, S), List). Best-First Search Breadth-First Search guided by an evaluation function (6) 2 A (28) 4 B (29) C (48) 3 D (24) E (32) F Go H (22) J (36) (3) (0) (29) K Go L M N (9) O P (2) (0) (2) (33) (88) (32) (24) (27) (6) (6) (3) Best-First Search Algorithm To search for an answer-path do start with a list containing just the initial state and its value, and apply the best-first procedure to expand this path-list until an answer-path is found. To expand a path-list with best-first search do if the first path in the list has reached a goal state then return that path as an answer-path else expand the first path in the list in all possible ways, creating a list of the resulting paths ordered in increasing value of the last state in each path, then merge this list with the list of the remaining paths to get a new ordered list, and continue to expand the new list Best-First Search in Prolog best_first_search(anspath) :- initial(it), value(it, V), best_first([[v,it]], AnsPath). best_first([[_,s Path] _], AnsPath) :- final(s),!, reverse([s Path], AnsPath). best_first([path Rest], AnsPath) :- expand(path, NewPaths), merge(newpaths, Rest, NewList), best_first(newlist, AnsPath). expand([_ Path], List) :- setof([v,s Path], (extend(path,s), value(s,v)), List),!. expand(_, []). % in case setof fails: node has no successor Best-First Search in Prolog (cont.) merge([], L, L) :-!. merge(l, [], L) :-!. merge([h T], [H2 T2], [H Rest]) :- less(h, H2),!, merge(t, [H2 T2], Rest). merge(l, [H2 T2], [H2 Rest]) :- merge(l, T2, Rest). less([v Path], [V2 Path2]) :- V < V2. Note: The first element of each list that represents a path, is the value of the last state in that path. 4

5 Cost Functions A cost function gives a path from the initial to the current state a numeric value. Normally one is looking for a path to the goal state with the smallest possible value of the cost function. This can be used in heuristic search: Best-cost search = breadth-first search + cost function Best-path search = breadth-first search + cost function + evaluation function Examples: Route-finding: Distance travelled. Repairing a car: Time to reach given state of repair, or financial cost Best-Cost Search Breadth-First Search guided by a cost function 4 A B 2 C D 8 E F Go 3 H 6 J K 0 Go L M N 7 O P Best-Cost Search in Prolog best_cost_search(anspath) :- initial(it), best_cost([[0,it]], AnsPath). best_cost([[_,s Path] _], AnsPath) :- final(s),!, reverse([s Path], AnsPath). best_cost([path Rest], AnsPath) :- expand(path, NewPaths), merge(newpaths, Rest, NewList), best_cost(newlist, AnsPath). Best-Cost Search in Prolog (cont.) expand([c, S Path], List) :- setof([c, S, S Path], (extend([s Path], S), costsum(s, C, S, C)), List),!. expand(_, []). costsum(s, C, S, C) :- cost(s, S, D), C is C + D. % in case setof fails: node has no successor Best-Path Search (A*) Breadth-First Search guided by cost + evaluation functions (6) A (28) 3 B (29) C (48) D (24) (32) E 4 F Go H (22) J (36) 8 9 (3) (0) (29) K 7 Go L M N (9) O P (2) (0) (2) (33) (88) (32) (24) (27) (6) (6) (3) Best-Path Search in Prolog best_path_search(anspath) :- initial(it), value(it, V), best_path([[v, V, it]], AnsPath). best_path([[_, _, S Path] _], AnsPath) :- final(s),!, reverse([s Path], AnsPath). best_path([path Rest], AnsPath) :- expand(path, NewPaths), merge(newpaths, Rest, NewList), best_path(newlist, AnsPath).

6 Best-Path Search in Prolog (cont.) expand([c, V, S Path], List) :- setof([c, V, S, S Path], (extend([s Path], S), recost(s,c,v,s,c,v)), List),!. expand(_, []). % in case setof fails: node has no successor recost(s, C, V, S, C, V) :- value(s, V), cost(s, S, D), C is C V + D + V. Optimality of A* The best-path, or A*, search algorithm uses a combined heuristic function as follows: For each node state n in the search tree, let g(n) be the cost of reaching that node, i.e. the sum of the costs of each step in the path to the node (exact), and h'(n) be the value of the evaluation function at node n (estimate). Then A* search minimises the combined function ƒ(n) where, ƒ(n) = g(n) + h'(n). It turns out that if the evaluation function h'(n) satisfies certain conditions, A* search is both complete and optimal. Optimality of A* Suppose the real value of the evaluation function is h(n). Then it can be proved that if h'(n) h(n) for every state n, the A* algorithm will never return a suboptimal path to the goal. Such an evaluation function, that never overestimates the cost to reach the goal, is said to be an admissible heuristic. Admissible heuristics are by nature optimistic, because they think the cost of solving the problem is less than it actually is. Explanation: Since g(n) is the exact cost to reach n, then if h'(n) is admissible we have as immediate consequence that ƒ(n) never overestimates the true cost of a solution through n. Developing Search Trees To develop a search tree, start at the initial state and carry out the search algorithm, only adding states to the tree when they are reached by path expansion under the algorithm. Do not include any repeated states on a given path through the tree. (States can of course be duplicated on different paths.) Stop the tree development, on a goal state, only when the algorithm would finish (which is not necessarily the first goal state found). Developing Search Trees for Heuristic Algorithms the case of heuristic search algorithms, the developed tree illustrates how the algorithm in question prunes back the search tree. order to develop the search tree of a given heuristic algorithm based on breadth-first, you need to create a table showing the path list considered by that algorithm at each point of time, together with the list generated by the expansion of each path. The paths in the resulting lists should also include their value and/or cost. Problem Characteristics The problem-solving approach may depend on the characteristics of the problem in question: Decomposable? Recovery possible from bad steps? Predictable universe? Obvious which is good solution? Is desired solution a state or a path? Does solving the problem require a large amount of knowledge? Human help needed? 6

7 Given the state-space graph: (9) 2 3 () Revision Exercise A B C (7) (4) 4 7 D (2) E (4) 4 6 Go (0) Develop the search tree created by the best-path (A*) search algorithm, making clear the order in which states are expanded. Adversary Search (Game Playing) Consider the simplest type of game: Deterministic (non-probabilistic) Open (fully observable environment) Two-player Turn-taking Zero-sum (equal and opposite utility functions of players at the end of the game) Example Game Placing Dominoes Placing Dominoes Game Tree Each player places a domino in turn to cover exactly two squares, on a 3 by 3 board. One player ( ) can place dominoes horizontally, and the other player ( You ) can place dominoes vertically. The winner is the last one who will be able to place a domino. The tree for this game is shown in the next slide. You - (You win) You - - Minimax Search Most game search trees are too large to look at all possible consequences of a move. So how well we play will depend on how far ahead we look (disregarding higher knowledge based on pattern matching and recognition), and how well we evaluate each possible state. Suppose we have an evaluation function applicable to each state of play (e.g. material value in pieces of chess). We can then choose the next move with the highest value. I would choose A. One-Ply Search A B C (8) (3) (-2) 7

8 You Minimise Maximise Two-Ply Search A B C D E F G H J K (9) (-6) (0) (0) (-2) (-4) (-3) (n) is the value of the evaluation function for each state from my viewpoint. Whereas I try to maximise the state as I see it, you try to minimise it. So to decide which move to take looking two steps ahead, I must back up the values. this case I would choose B as my next move. Minimax Value backing up the values of the end nodes we assume that both players play optimally. So for our moves, we back up the highest values, whereas for the opponent s moves, we back up the lowest values. The resulting value of each state is called its minimax value. Exercise - Three-Ply Search Suppose I look three steps ahead: You Minimise Max. L Maximise A B C D E F G H J K M N O P W X Y (8) (-2) () (3) (-0) (-2) (2) (4) () (-3) (3) (-) (7) (2) Now which move should I choose from? 8

Downloaded from ioenotes.edu.np

Downloaded from ioenotes.edu.np Chapter- 3: Searching - Searching the process finding the required states or nodes. - Searching is to be performed through the state space. - Search process is carried out by constructing a search tree.

More information

Artificial Intelligence (part 4c) Strategies for State Space Search. (Informed..Heuristic search)

Artificial Intelligence (part 4c) Strategies for State Space Search. (Informed..Heuristic search) Artificial Intelligence (part 4c) Strategies for State Space Search (Informed..Heuristic search) Search Strategies (The Order..) Uninformed Search breadth-first depth-first iterative deepening uniform-cost

More information

Introduction HEURISTIC SEARCH. Introduction. Heuristics. Two main concerns of AI researchers. Two problems with the search process

Introduction HEURISTIC SEARCH. Introduction. Heuristics. Two main concerns of AI researchers. Two problems with the search process HEURISTIC SERCH George F Luger RTIFICIL INTELLIGENCE 6th edition Structures and Strategies for Complex Problem Solving Introduction Two main concerns of I researchers 1) Representation of the knowledge

More information

COMP9414: Artificial Intelligence Informed Search

COMP9414: Artificial Intelligence Informed Search COMP9, Wednesday March, 00 Informed Search COMP9: Artificial Intelligence Informed Search Wayne Wobcke Room J- wobcke@cse.unsw.edu.au Based on slides by Maurice Pagnucco Overview Heuristics Informed Search

More information

CS 188: Artificial Intelligence. Recap Search I

CS 188: Artificial Intelligence. Recap Search I CS 188: Artificial Intelligence Review of Search, CSPs, Games DISCLAIMER: It is insufficient to simply study these slides, they are merely meant as a quick refresher of the high-level ideas covered. You

More information

Last time: Problem-Solving

Last time: Problem-Solving Last time: Problem-Solving Problem solving: Goal formulation Problem formulation (states, operators) Search for solution Problem formulation: Initial state??? 1 Last time: Problem-Solving Problem types:

More information

Monotonicity. Admissible Search: That finds the shortest path to the Goal. Monotonicity: local admissibility is called MONOTONICITY

Monotonicity. Admissible Search: That finds the shortest path to the Goal. Monotonicity: local admissibility is called MONOTONICITY Monotonicity Admissible Search: That finds the shortest path to the Goal Monotonicity: local admissibility is called MONOTONICITY This property ensures consistently minimal path to each state they encounter

More information

State Space Search. Many problems can be represented as a set of states and a set of rules of how one state is transformed to another.

State Space Search. Many problems can be represented as a set of states and a set of rules of how one state is transformed to another. State Space Search Many problems can be represented as a set of states and a set of rules of how one state is transformed to another. The problem is how to reach a particular goal state, starting from

More information

Chapter 3: Informed Search and Exploration. Dr. Daisy Tang

Chapter 3: Informed Search and Exploration. Dr. Daisy Tang Chapter 3: Informed Search and Exploration Dr. Daisy Tang Informed Search Definition: Use problem-specific knowledge beyond the definition of the problem itself Can find solutions more efficiently Best-first

More information

Fast Forward Planning. By J. Hoffmann and B. Nebel

Fast Forward Planning. By J. Hoffmann and B. Nebel Fast Forward Planning By J. Hoffmann and B. Nebel Chronology faster Traditional Optimal Sub-optimal ««1995 Graphplan-based Satplan-based 2000 Heuristic-based Fast Forward (FF) Winner of AIPS2000 Forward-chaining

More information

Chapters 3-5 Problem Solving using Search

Chapters 3-5 Problem Solving using Search CSEP 573 Chapters 3-5 Problem Solving using Search First, they do an on-line search CSE AI Faculty Example: The 8-puzzle Example: The 8-puzzle 1 2 3 8 4 7 6 5 1 2 3 4 5 6 7 8 2 Example: Route Planning

More information

INTRODUCTION TO HEURISTIC SEARCH

INTRODUCTION TO HEURISTIC SEARCH INTRODUCTION TO HEURISTIC SEARCH What is heuristic search? Given a problem in which we must make a series of decisions, determine the sequence of decisions which provably optimizes some criterion. What

More information

Artificial Intelligence CS 6364

Artificial Intelligence CS 6364 Artificial Intelligence CS 6364 Professor Dan Moldovan Section 4 Informed Search and Adversarial Search Outline Best-first search Greedy best-first search A* search Heuristics revisited Minimax search

More information

The wolf sheep cabbage problem. Search. Terminology. Solution. Finite state acceptor / state space

The wolf sheep cabbage problem. Search. Terminology. Solution. Finite state acceptor / state space Search The wolf sheep cabbage problem What is search? Terminology: search space, strategy Modelling Uninformed search (not intelligent ) Breadth first Depth first, some variations omplexity space and time

More information

COMP9414: Artificial Intelligence Informed Search

COMP9414: Artificial Intelligence Informed Search COMP9, Monday 9 March, 0 Informed Search COMP9: Artificial Intelligence Informed Search Wayne Wobcke Room J- wobcke@cse.unsw.edu.au Based on slides by Maurice Pagnucco Overview Heuristics Informed Search

More information

Artificial Intelligence

Artificial Intelligence Artificial Intelligence Informed Search and Exploration Chapter 4 (4.1 4.2) A General Search algorithm: Chapter 3: Search Strategies Task : Find a sequence of actions leading from the initial state to

More information

CSE 473. Chapter 4 Informed Search. CSE AI Faculty. Last Time. Blind Search BFS UC-BFS DFS DLS Iterative Deepening Bidirectional Search

CSE 473. Chapter 4 Informed Search. CSE AI Faculty. Last Time. Blind Search BFS UC-BFS DFS DLS Iterative Deepening Bidirectional Search CSE 473 Chapter 4 Informed Search CSE AI Faculty Blind Search BFS UC-BFS DFS DLS Iterative Deepening Bidirectional Search Last Time 2 1 Repeated States Failure to detect repeated states can turn a linear

More information

Informed Search. Best-first search. Greedy best-first search. Intelligent Systems and HCI D7023E. Romania with step costs in km

Informed Search. Best-first search. Greedy best-first search. Intelligent Systems and HCI D7023E. Romania with step costs in km Informed Search Intelligent Systems and HCI D7023E Lecture 5: Informed Search (heuristics) Paweł Pietrzak [Sec 3.5-3.6,Ch.4] A search strategy which searches the most promising branches of the state-space

More information

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS Lecture 4, 4/11/2005 University of Washington, Department of Electrical Engineering Spring 2005 Instructor: Professor Jeff A. Bilmes Today: Informed search algorithms

More information

HEURISTIC SEARCH. 4.3 Using Heuristics in Games 4.4 Complexity Issues 4.5 Epilogue and References 4.6 Exercises

HEURISTIC SEARCH. 4.3 Using Heuristics in Games 4.4 Complexity Issues 4.5 Epilogue and References 4.6 Exercises 4 HEURISTIC SEARCH Slide 4.1 4.0 Introduction 4.1 An Algorithm for Heuristic Search 4.2 Admissibility, Monotonicity, and Informedness 4.3 Using Heuristics in Games 4.4 Complexity Issues 4.5 Epilogue and

More information

DFS. Depth-limited Search

DFS. Depth-limited Search DFS Completeness? No, fails in infinite depth spaces or spaces with loops Yes, assuming state space finite. Time complexity? O(b m ), terrible if m is much bigger than d. can do well if lots of goals Space

More information

Searching. Assume goal- or utilitybased. Next task to achieve is to determine the best path to the goal

Searching. Assume goal- or utilitybased. Next task to achieve is to determine the best path to the goal Searching Assume goal- or utilitybased agents: state information ability to perform actions goals to achieve Next task to achieve is to determine the best path to the goal CSC384 Lecture Slides Steve Engels,

More information

mywbut.com Informed Search Strategies-I

mywbut.com Informed Search Strategies-I Informed Search Strategies-I 1 3.1 Introduction We have outlined the different types of search strategies. In the earlier chapter we have looked at different blind search strategies. Uninformed search

More information

Artificial Intelligence. Chapters Reviews. Readings: Chapters 3-8 of Russell & Norvig.

Artificial Intelligence. Chapters Reviews. Readings: Chapters 3-8 of Russell & Norvig. Artificial Intelligence Chapters Reviews Readings: Chapters 3-8 of Russell & Norvig. Topics covered in the midterm Solving problems by searching (Chap. 3) How to formulate a search problem? How to measure

More information

Problem Solving: Informed Search

Problem Solving: Informed Search Problem Solving: Informed Search References Russell and Norvig, Artificial Intelligence: A modern approach, 2nd ed. Prentice Hall, 2003 (Chapters 1,2, and 4) Nilsson, Artificial intelligence: A New synthesis.

More information

CS61B Lecture #35. [The Lecture #32 notes covered lectures #33 and #34.] Today: Enumerated types, backtracking searches, game trees.

CS61B Lecture #35. [The Lecture #32 notes covered lectures #33 and #34.] Today: Enumerated types, backtracking searches, game trees. CS61B Lecture #35 [The Lecture #32 notes covered lectures #33 and #34.] Today: Enumerated types, backtracking searches, game trees. Coming Up: Graph Structures: DSIJ, Chapter 12 Last modified: Mon Nov

More information

Search : Lecture 2. September 9, 2003

Search : Lecture 2. September 9, 2003 Search 6.825: Lecture 2 September 9, 2003 1 Problem-Solving Problems When your environment can be effectively modeled as having discrete states and actions deterministic, known world dynamics known initial

More information

Informed search algorithms. Chapter 4

Informed search algorithms. Chapter 4 Informed search algorithms Chapter 4 Material Chapter 4 Section 1 - Exclude memory-bounded heuristic search 3 Outline Best-first search Greedy best-first search A * search Heuristics Local search algorithms

More information

Wissensverarbeitung. - Search - Alexander Felfernig und Gerald Steinbauer Institut für Softwaretechnologie Inffeldgasse 16b/2 A-8010 Graz Austria

Wissensverarbeitung. - Search - Alexander Felfernig und Gerald Steinbauer Institut für Softwaretechnologie Inffeldgasse 16b/2 A-8010 Graz Austria - Search - Alexander Felfernig und Gerald Steinbauer Institut für Softwaretechnologie Inffeldgasse 16b/2 A-8010 Graz Austria 1 References Skriptum (TU Wien, Institut für Informationssysteme, Thomas Eiter

More information

Problem Solving & Heuristic Search

Problem Solving & Heuristic Search 190.08 Artificial 2016-Spring Problem Solving & Heuristic Search Byoung-Tak Zhang School of Computer Science and Engineering Seoul National University 190.08 Artificial (2016-Spring) http://www.cs.duke.edu/courses/fall08/cps270/

More information

Downloded from: CSITauthority.blogspot.com

Downloded from: CSITauthority.blogspot.com [Unit : Searching] (CSC 355) Central Department of Computer Science & Information Technology Tribhuvan University 1 Searching search problem Figure below contains a representation of a map. The nodes represent

More information

Today s s lecture. Lecture 3: Search - 2. Problem Solving by Search. Agent vs. Conventional AI View. Victor R. Lesser. CMPSCI 683 Fall 2004

Today s s lecture. Lecture 3: Search - 2. Problem Solving by Search. Agent vs. Conventional AI View. Victor R. Lesser. CMPSCI 683 Fall 2004 Today s s lecture Search and Agents Material at the end of last lecture Lecture 3: Search - 2 Victor R. Lesser CMPSCI 683 Fall 2004 Continuation of Simple Search The use of background knowledge to accelerate

More information

Algorithm Design Techniques (III)

Algorithm Design Techniques (III) Algorithm Design Techniques (III) Minimax. Alpha-Beta Pruning. Search Tree Strategies (backtracking revisited, branch and bound). Local Search. DSA - lecture 10 - T.U.Cluj-Napoca - M. Joldos 1 Tic-Tac-Toe

More information

Informed/Heuristic Search

Informed/Heuristic Search Informed/Heuristic Search Outline Limitations of uninformed search methods Informed (or heuristic) search uses problem-specific heuristics to improve efficiency Best-first A* Techniques for generating

More information

4 INFORMED SEARCH AND EXPLORATION. 4.1 Heuristic Search Strategies

4 INFORMED SEARCH AND EXPLORATION. 4.1 Heuristic Search Strategies 55 4 INFORMED SEARCH AND EXPLORATION We now consider informed search that uses problem-specific knowledge beyond the definition of the problem itself This information helps to find solutions more efficiently

More information

Informed Search Methods

Informed Search Methods Informed Search Methods How can we improve searching strategy by using intelligence? Map example: Heuristic: Expand those nodes closest in as the crow flies distance to goal 8-puzzle: Heuristic: Expand

More information

Lecture 5 Heuristics. Last Time: A* Search

Lecture 5 Heuristics. Last Time: A* Search CSE 473 Lecture 5 Heuristics CSE AI Faculty Last Time: A* Search Use an evaluation function f(n) for node n. f(n) = estimated total cost of path thru n to goal f(n) = g(n) + h(n) g(n) = cost so far to

More information

HEURISTIC SEARCH. 4.3 Using Heuristics in Games 4.4 Complexity Issues 4.5 Epilogue and References 4.6 Exercises

HEURISTIC SEARCH. 4.3 Using Heuristics in Games 4.4 Complexity Issues 4.5 Epilogue and References 4.6 Exercises 4 HEURISTIC SEARCH Slide 4.1 4.0 Introduction 4.1 An Algorithm for Heuristic Search 4.2 Admissibility, Monotonicity, and Informedness 4.3 Using Heuristics in Games 4.4 Complexity Issues 4.5 Epilogue and

More information

PAC-MAN is one of the most popular game

PAC-MAN is one of the most popular game SCHOOL OF DATA SCIENCE 1 Assignment1. Search in Pacman Project Report Shihan Ran - 15307130424 Abstract This project is aimed at designing a intelligent Pacman agent that is able to find optimal paths

More information

CS 188 Introduction to Artificial Intelligence Fall 2018 Note 1

CS 188 Introduction to Artificial Intelligence Fall 2018 Note 1 CS 188 Introduction to Artificial Intelligence Fall 2018 Note 1 These lecture notes are heavily based on notes originally written by Nikhil Sharma. Agents In artificial intelligence, the central problem

More information

Solving Problems by Searching

Solving Problems by Searching Solving Problems by Searching 1 Terminology State State Space Initial State Goal Test Action Step Cost Path Cost State Change Function State-Space Search 2 Formal State-Space Model Problem = (S, s, A,

More information

A* optimality proof, cycle checking

A* optimality proof, cycle checking A* optimality proof, cycle checking CPSC 322 Search 5 Textbook 3.6 and 3.7.1 January 21, 2011 Taught by Mike Chiang Lecture Overview Recap Admissibility of A* Cycle checking and multiple path pruning Slide

More information

Informed search strategies (Section ) Source: Fotolia

Informed search strategies (Section ) Source: Fotolia Informed search strategies (Section 3.5-3.6) Source: Fotolia Review: Tree search Initialize the frontier using the starting state While the frontier is not empty Choose a frontier node to expand according

More information

CS 380: Artificial Intelligence Lecture #4

CS 380: Artificial Intelligence Lecture #4 CS 380: Artificial Intelligence Lecture #4 William Regli Material Chapter 4 Section 1-3 1 Outline Best-first search Greedy best-first search A * search Heuristics Local search algorithms Hill-climbing

More information

Informed Search. CS 486/686: Introduction to Artificial Intelligence Fall 2013

Informed Search. CS 486/686: Introduction to Artificial Intelligence Fall 2013 Informed Search CS 486/686: Introduction to Artificial Intelligence Fall 2013 1 Outline Using knowledge Heuristics Bestfirst search Greedy bestfirst search A* search Variations of A* Back to heuristics

More information

COMP219: Artificial Intelligence. Lecture 10: Heuristic Search

COMP219: Artificial Intelligence. Lecture 10: Heuristic Search COMP219: Artificial Intelligence Lecture 10: Heuristic Search 1 Class Tests Class Test 1 (Prolog): Friday 17th November (Week 8), 15:00-17:00. Class Test 2 (Everything but Prolog) Friday 15th December

More information

Review Adversarial (Game) Search ( ) Review Constraint Satisfaction ( ) Please review your quizzes and old CS-271 tests

Review Adversarial (Game) Search ( ) Review Constraint Satisfaction ( ) Please review your quizzes and old CS-271 tests Review Agents (2.1-2.3) Mid-term Review Chapters 2-6 Review State Space Search Problem Formulation (3.1, 3.3) Blind (Uninformed) Search (3.4) Heuristic Search (3.5) Local Search (4.1, 4.2) Review Adversarial

More information

CS-171, Intro to A.I. Mid-term Exam Fall Quarter, 2017

CS-171, Intro to A.I. Mid-term Exam Fall Quarter, 2017 CS-171, Intro to A.I. Mid-term Exam Fall Quarter, 2017 YOUR NAME: YOUR ID: ID TO RIGHT: ROW: SEAT: Please turn off all cell phones now. The exam will begin on the next page. Please, do not turn the page

More information

Lecture 4: Search 3. Victor R. Lesser. CMPSCI 683 Fall 2010

Lecture 4: Search 3. Victor R. Lesser. CMPSCI 683 Fall 2010 Lecture 4: Search 3 Victor R. Lesser CMPSCI 683 Fall 2010 First Homework 1 st Programming Assignment 2 separate parts (homeworks) First part due on (9/27) at 5pm Second part due on 10/13 at 5pm Send homework

More information

Graph and Heuristic Search. Lecture 3. Ning Xiong. Mälardalen University. Agenda

Graph and Heuristic Search. Lecture 3. Ning Xiong. Mälardalen University. Agenda Graph and Heuristic earch Lecture 3 Ning iong Mälardalen University Agenda Uninformed graph search - breadth-first search on graphs - depth-first search on graphs - uniform-cost search on graphs General

More information

3.6.2 Generating admissible heuristics from relaxed problems

3.6.2 Generating admissible heuristics from relaxed problems 3.6.2 Generating admissible heuristics from relaxed problems To come up with heuristic functions one can study relaxed problems from which some restrictions of the original problem have been removed The

More information

Outline for today s lecture. Informed Search. Informed Search II. Review: Properties of greedy best-first search. Review: Greedy best-first search:

Outline for today s lecture. Informed Search. Informed Search II. Review: Properties of greedy best-first search. Review: Greedy best-first search: Outline for today s lecture Informed Search II Informed Search Optimal informed search: A* (AIMA 3.5.2) Creating good heuristic functions Hill Climbing 2 Review: Greedy best-first search: f(n): estimated

More information

2006/2007 Intelligent Systems 1. Intelligent Systems. Prof. dr. Paul De Bra Technische Universiteit Eindhoven

2006/2007 Intelligent Systems 1. Intelligent Systems. Prof. dr. Paul De Bra Technische Universiteit Eindhoven test gamma 2006/2007 Intelligent Systems 1 Intelligent Systems Prof. dr. Paul De Bra Technische Universiteit Eindhoven debra@win.tue.nl 2006/2007 Intelligent Systems 2 Informed search and exploration Best-first

More information

Uninformed Search Strategies AIMA 3.4

Uninformed Search Strategies AIMA 3.4 Uninformed Search Strategies AIMA 3.4 CIS 391-2015 1 The Goat, Cabbage, Wolf Problem (From xkcd.com) CIS 391-2015 2 But First: Missionaries & Cannibals Three missionaries and three cannibals come to a

More information

Learning Objectives. c D. Poole and A. Mackworth 2010 Artificial Intelligence, Lecture 3.3, Page 1

Learning Objectives. c D. Poole and A. Mackworth 2010 Artificial Intelligence, Lecture 3.3, Page 1 Learning Objectives At the end of the class you should be able to: devise an useful heuristic function for a problem demonstrate how best-first and A search will work on a graph predict the space and time

More information

Informed search algorithms. Chapter 4

Informed search algorithms. Chapter 4 Informed search algorithms Chapter 4 Outline Best-first search Greedy best-first search A * search Heuristics Memory Bounded A* Search Best-first search Idea: use an evaluation function f(n) for each node

More information

Informed Search and Exploration for Agents

Informed Search and Exploration for Agents Informed Search and Exploration for Agents R&N: 3.5, 3.6 Michael Rovatsos University of Edinburgh 29 th January 2015 Outline Best-first search Greedy best-first search A * search Heuristics Admissibility

More information

Artificial Intelligence

Artificial Intelligence Artificial Intelligence Search Marc Toussaint University of Stuttgart Winter 2015/16 (slides based on Stuart Russell s AI course) Outline Problem formulation & examples Basic search algorithms 2/100 Example:

More information

Finding optimal configurations Adversarial search

Finding optimal configurations Adversarial search CS 171 Introduction to AI Lecture 10 Finding optimal configurations Adversarial search Milos Hauskrecht milos@cs.pitt.edu 39 Sennott Square Announcements Homework assignment is out Due on Thursday next

More information

COMP219: Artificial Intelligence. Lecture 10: Heuristic Search

COMP219: Artificial Intelligence. Lecture 10: Heuristic Search COMP219: Artificial Intelligence Lecture 10: Heuristic Search 1 Class Tests Class Test 1 (Prolog): Tuesday 8 th November (Week 7) 13:00-14:00 LIFS-LT2 and LIFS-LT3 Class Test 2 (Everything but Prolog)

More information

CS 4700: Foundations of Artificial Intelligence. Bart Selman. Search Techniques R&N: Chapter 3

CS 4700: Foundations of Artificial Intelligence. Bart Selman. Search Techniques R&N: Chapter 3 CS 4700: Foundations of Artificial Intelligence Bart Selman Search Techniques R&N: Chapter 3 Outline Search: tree search and graph search Uninformed search: very briefly (covered before in other prerequisite

More information

Informed Search and Exploration

Informed Search and Exploration Ch. 04 p.1/39 Informed Search and Exploration Chapter 4 Ch. 04 p.2/39 Outline Best-first search A search Heuristics IDA search Hill-climbing Simulated annealing Ch. 04 p.3/39 Review: Tree search function

More information

CS 331: Artificial Intelligence Informed Search. Informed Search

CS 331: Artificial Intelligence Informed Search. Informed Search CS 331: Artificial Intelligence Informed Search 1 Informed Search How can we make search smarter? Use problem-specific knowledge beyond the definition of the problem itself Specifically, incorporate knowledge

More information

Artificial Intelligence

Artificial Intelligence COMP224 Artificial Intelligence The Meaning of earch in AI The terms search, search space, search problem, search algorithm are widely used in computer science and especially in AI. In this context the

More information

HW#1 due today. HW#2 due Monday, 9/09/13, in class Continue reading Chapter 3

HW#1 due today. HW#2 due Monday, 9/09/13, in class Continue reading Chapter 3 9-04-2013 Uninformed (blind) search algorithms Breadth-First Search (BFS) Uniform-Cost Search Depth-First Search (DFS) Depth-Limited Search Iterative Deepening Best-First Search HW#1 due today HW#2 due

More information

CPS 170: Artificial Intelligence Search

CPS 170: Artificial Intelligence   Search CPS 170: Artificial Intelligence http://www.cs.duke.edu/courses/spring09/cps170/ Search Instructor: Vincent Conitzer Search We have some actions that can change the state of the world Change resulting

More information

Informed (Heuristic) Search. Idea: be smart about what paths to try.

Informed (Heuristic) Search. Idea: be smart about what paths to try. Informed (Heuristic) Search Idea: be smart about what paths to try. 1 Blind Search vs. Informed Search What s the difference? How do we formally specify this? A node is selected for expansion based on

More information

Lecture 4: Informed/Heuristic Search

Lecture 4: Informed/Heuristic Search Lecture 4: Informed/Heuristic Search Outline Limitations of uninformed search methods Informed (or heuristic) search uses problem-specific heuristics to improve efficiency Best-first A* RBFS SMA* Techniques

More information

Computer Science and Software Engineering University of Wisconsin - Platteville. 3. Search (Part 1) CS 3030 Lecture Notes Yan Shi UW-Platteville

Computer Science and Software Engineering University of Wisconsin - Platteville. 3. Search (Part 1) CS 3030 Lecture Notes Yan Shi UW-Platteville Computer Science and Software Engineering University of Wisconsin - Platteville 3. Search (Part 1) CS 3030 Lecture Notes Yan Shi UW-Platteville Read: Textbook Chapter 3.7-3.9,3.12, 4. Problem Solving as

More information

Part I. Instructor: Dr. Wei Ding. Uninformed Search Strategies can find solutions to problems by. Informed Search Strategies

Part I. Instructor: Dr. Wei Ding. Uninformed Search Strategies can find solutions to problems by. Informed Search Strategies Informed Search and Exploration Part I Instructor: Dr. Wei Ding Fall 2010 1 Motivation Uninformed Search Strategies can find solutions to problems by Systematically generating new states Testing them against

More information

Expert Systems (Graz) Heuristic Search (Klagenfurt) - Search -

Expert Systems (Graz) Heuristic Search (Klagenfurt) - Search - Expert Systems (Graz) Heuristic Search (Klagenfurt) - Search - Institut für Softwaretechnologie Inffeldgasse 16b/2 A-8010 Graz Austria 1 References Skriptum (TU Wien, Institut für Informationssysteme,

More information

Seach algorithms The travelling salesman problem The Towers of Hanoi Playing games. Comp24412: Symbolic AI. Lecture 4: Search. Ian Pratt-Hartmann

Seach algorithms The travelling salesman problem The Towers of Hanoi Playing games. Comp24412: Symbolic AI. Lecture 4: Search. Ian Pratt-Hartmann Comp24412: Symbolic AI Lecture 4: Search Ian Pratt-Hartmann Room KB2.38: email: ipratt@cs.man.ac.uk 2016 17 Outline Seach algorithms The travelling salesman problem The Towers of Hanoi Playing games Typical

More information

Introduction to Intelligent Systems

Introduction to Intelligent Systems Problem Solving by Search Objectives Well-Defined Problems Tree search Uninformed search: BFS, DFS, DLS, and IDS Heuristic search: GBFS and A* Reference Russell & Norvig: Chapter 3 Y. Xiang, CIS 3700,

More information

Search. Intelligent agents. Problem-solving. Problem-solving agents. Road map of Romania. The components of a problem. that will take me to the goal!

Search. Intelligent agents. Problem-solving. Problem-solving agents. Road map of Romania. The components of a problem. that will take me to the goal! Search Intelligent agents Reflex agent Problem-solving agent T65 rtificial intelligence and Lisp Peter alenius petda@ida.liu.se epartment of omputer and Information Science Linköping University Percept

More information

Informed Search. Dr. Richard J. Povinelli. Copyright Richard J. Povinelli Page 1

Informed Search. Dr. Richard J. Povinelli. Copyright Richard J. Povinelli Page 1 Informed Search Dr. Richard J. Povinelli Copyright Richard J. Povinelli Page 1 rev 1.1, 9/25/2001 Objectives You should be able to explain and contrast uniformed and informed searches. be able to compare,

More information

Graph Theory

Graph Theory Graph Theory 2012.04.18 Our goal today is to learn some basic concepts in graph theory and explore fun problems using graph theory. A graph is a mathematical object that captures the notion of connection.

More information

Informed Search and Exploration

Informed Search and Exploration Artificial Intelligence Informed Search and Exploration Readings: Chapter 4 of Russell & Norvig. Best-First Search Idea: use a function f for each node n to estimate of desirability Strategy: Alwasy expand

More information

3 SOLVING PROBLEMS BY SEARCHING

3 SOLVING PROBLEMS BY SEARCHING 48 3 SOLVING PROBLEMS BY SEARCHING A goal-based agent aims at solving problems by performing actions that lead to desirable states Let us first consider the uninformed situation in which the agent is not

More information

Lecture 9. Heuristic search, continued. CS-424 Gregory Dudek

Lecture 9. Heuristic search, continued. CS-424 Gregory Dudek Lecture 9 Heuristic search, continued A* revisited Reminder: with A* we want to find the best-cost (C ) path to the goal first. To do this, all we have to do is make sure our cost estimates are less than

More information

Solving Problems by Searching

Solving Problems by Searching INF5390 Kunstig intelligens Solving Problems by Searching Roar Fjellheim Outline Problem-solving agents Example problems Search programs Uninformed search Informed search Summary AIMA Chapter 3: Solving

More information

CS510 \ Lecture Ariel Stolerman

CS510 \ Lecture Ariel Stolerman CS510 \ Lecture02 2012-10-03 1 Ariel Stolerman Midterm Evan will email about that after the lecture, at least 2 lectures from now. The exam will be given in a regular PDF (not an online form). We will

More information

Potential Midterm Exam Questions

Potential Midterm Exam Questions Potential Midterm Exam Questions 1. What are the four ways in which AI is usually viewed? Which of the four is the preferred view of the authors of our textbook? 2. What does each of the lettered items

More information

Artificial Intelligence p.1/49. n-queens. Artificial Intelligence p.2/49. Initial state: the empty board or a board with n random

Artificial Intelligence p.1/49. n-queens. Artificial Intelligence p.2/49. Initial state: the empty board or a board with n random Example: n-queens Put n queens on an n n board with no two queens on the same row, column, or diagonal A search problem! State space: the board with 0 to n queens Initial state: the empty board or a board

More information

CS-171, Intro to A.I. Mid-term Exam Fall Quarter, 2013

CS-171, Intro to A.I. Mid-term Exam Fall Quarter, 2013 CS-171, Intro to A.I. Mid-term Exam Fall Quarter, 2013 YOUR NAME AND ID NUMBER: YOUR ID: ID TO RIGHT: ROW: NO. FROM RIGHT: The exam will begin on the next page. Please, do not turn the page until told.

More information

Outline. Best-first search

Outline. Best-first search Outline Best-first search Greedy best-first search A* search Heuristics Local search algorithms Hill-climbing search Beam search Simulated annealing search Genetic algorithms Constraint Satisfaction Problems

More information

Artificial Intelligence

Artificial Intelligence Artificial Intelligence Lesson 1 1 About Lecturer: Prof. Sarit Kraus TA: Galit Haim: haimga@cs.biu.ac.il (almost) All you need can be found on the course website: http://u.cs.biu.ac.il/~haimga/teaching/ai/

More information

CPSC 436D Video Game Programming

CPSC 436D Video Game Programming CPSC 436D Video Game Programming Strategy & Adversarial Strategy Strategy Given current state, determine BEST next move Short term: best among immediate options Long term: what brings something closest

More information

Chapter 2 Classical algorithms in Search and Relaxation

Chapter 2 Classical algorithms in Search and Relaxation Chapter 2 Classical algorithms in Search and Relaxation Chapter 2 overviews topics on the typical problems, data structures, and algorithms for inference in hierarchical and flat representations. Part

More information

1 Introduction and Examples

1 Introduction and Examples 1 Introduction and Examples Sequencing Problems Definition A sequencing problem is one that involves finding a sequence of steps that transforms an initial system state to a pre-defined goal state for

More information

521495A: Artificial Intelligence

521495A: Artificial Intelligence 521495A: Artificial Intelligence Informed Search Lectured by Abdenour Hadid Adjunct Professor, CMVS, University of Oulu Slides adopted from http://ai.berkeley.edu Today Informed Search Heuristics Greedy

More information

Informed search algorithms

Informed search algorithms CS 580 1 Informed search algorithms Chapter 4, Sections 1 2, 4 CS 580 2 Outline Best-first search A search Heuristics Hill-climbing Simulated annealing CS 580 3 Review: General search function General-Search(

More information

Artificial Intelligence (part 4d)

Artificial Intelligence (part 4d) Artificial Intelligence (part 4d) BEHAVIOR OF HEURISTICS EVALUATIONS (USING HEURISTICS IN GAMES) Course Contents Again..Selected topics for our course. Covering all of AI is impossible! Key topics include:

More information

Introduction to Computer Science and Programming for Astronomers

Introduction to Computer Science and Programming for Astronomers Introduction to Computer Science and Programming for Astronomers Lecture 9. István Szapudi Institute for Astronomy University of Hawaii March 21, 2018 Outline Reminder 1 Reminder 2 3 Reminder We have demonstrated

More information

Informed Search. CS 486/686 University of Waterloo May 10. cs486/686 Lecture Slides 2005 (c) K. Larson and P. Poupart

Informed Search. CS 486/686 University of Waterloo May 10. cs486/686 Lecture Slides 2005 (c) K. Larson and P. Poupart Informed Search CS 486/686 University of Waterloo May 0 Outline Using knowledge Heuristics Best-first search Greedy best-first search A* search Other variations of A* Back to heuristics 2 Recall from last

More information

Informed search methods

Informed search methods CS 2710 Foundations of AI Lecture 5 Informed search methods Milos Hauskrecht milos@pitt.edu 5329 Sennott Square Announcements Homework assignment 2 is out Due on Tuesday, September 19, 2017 before the

More information

Informed search methods

Informed search methods Informed search methods Tuomas Sandholm Computer Science Department Carnegie Mellon University Read Section 3.5-3.7 of Russell and Norvig Informed Search Methods Heuristic = to find, to discover Heuristic

More information

TDDC17. Intuitions behind heuristic search. Recall Uniform-Cost Search. Best-First Search. f(n) =... + h(n) g(n) = cost of path from root node to n

TDDC17. Intuitions behind heuristic search. Recall Uniform-Cost Search. Best-First Search. f(n) =... + h(n) g(n) = cost of path from root node to n Intuitions behind heuristic search The separation property of GRAPH-SEARCH TDDC17 Seminar III Search II Informed or Heuristic Search Beyond Classical Search Find a heuristic measure h(n) which estimates

More information

Artificial Intelligence (part 4d)

Artificial Intelligence (part 4d) Artificial Intelligence (part 4d) BEHAVIOR OF HEURISTICS EVALUATIONS (USING HEURISTICS IN GAMES) HEURISTICS EVALUATIONS: (Admissibility,Monotonicity and Informedness) Admissibility Measures A search is

More information

University of Waterloo Department of Electrical and Computer Engineering ECE 457A: Cooperative and Adaptive Algorithms Midterm Examination

University of Waterloo Department of Electrical and Computer Engineering ECE 457A: Cooperative and Adaptive Algorithms Midterm Examination University of Waterloo Department of Electrical and Computer Engineering ECE 457A: Cooperative and Adaptive Algorithms Midterm Examination Exam Date/Time: Tuesday, June 13, 2017, 8:30-9:50 pm Exam Hall:

More information

Solving problems by searching

Solving problems by searching Solving problems by searching Chapter 3 Some slide credits to Hwee Tou Ng (Singapore) Outline Problem-solving agents Problem types Problem formulation Example problems Basic search algorithms Heuristics

More information