1 CMPUT 412 Search Algorithms Csaba Szepesvári University of Alberta TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.:

Slides:



Advertisements
Similar presentations
An Introduction to Artificial Intelligence
Advertisements

HEURISTIC SEARCH Ivan Bratko Faculty of Computer and Information Sc. University of Ljubljana.
Informed Search Methods How can we improve searching strategy by using intelligence? Map example: Heuristic: Expand those nodes closest in “as the crow.
Solving Problem by Searching
Artificial Intelligence Chapter 9 Heuristic Search Biointelligence Lab School of Computer Sci. & Eng. Seoul National University.
1 Heuristic Search Chapter 4. 2 Outline Heuristic function Greedy Best-first search Admissible heuristic and A* Properties of A* Algorithm IDA*
CSCE 580 ANDREW SMITH JOHNNY FLOWERS IDA* and Memory-Bounded Search Algorithms.
Problem Solving Agents A problem solving agent is one which decides what actions and states to consider in completing a goal Examples: Finding the shortest.
Solving Problems by Searching Currently at Chapter 3 in the book Will finish today/Monday, Chapter 4 next.
CPSC 322, Lecture 5Slide 1 Uninformed Search Computer Science cpsc322, Lecture 5 (Textbook Chpt 3.4) January, 14, 2009.
Search Strategies Reading: Russell’s Chapter 3 1.
Touring problems Start from Arad, visit each city at least once. What is the state-space formulation? Start from Arad, visit each city exactly once. What.
CS171 Introduction to Computer Science II Graphs Strike Back.
Uninformed Search Jim Little UBC CS 322 – Search 2 September 12, 2014
Heuristic State Space Seach Henry Kautz. Assignment.
State Space Search Algorithms CSE 472 Introduction to Artificial Intelligence Autumn 2003.
CPSC 322, Lecture 9Slide 1 Search: Advanced Topics Computer Science cpsc322, Lecture 9 (Textbook Chpt 3.6) January, 23, 2009.
CPSC 322 Introduction to Artificial Intelligence October 27, 2004.
CSC344: AI for Games Lecture 5 Advanced heuristic search Patrick Olivier
CPSC 322, Lecture 9Slide 1 Search: Advanced Topics Computer Science cpsc322, Lecture 9 (Textbook Chpt 3.6) January, 22, 2010.
LaValle Chapter 2 (Sections ) [2.1] Discrete feasible planning formulation [2.2] Basic search techniques – To find discrete feasible plans – But.
Review: Search problem formulation
1 Heuristic Search 4 4.0Introduction 4.1An Algorithm for Heuristic Search 4.2Admissibility, Monotonicity, and Informedness 4.3Using Heuristics in Games.
Informed Search CSE 473 University of Washington.
Informed Search Methods How can we make use of other knowledge about the problem to improve searching strategy? Map example: Heuristic: Expand those nodes.
Using Search in Problem Solving
CSC344: AI for Games Lecture 4: Informed search
5-Nov-2003 Heuristic Search Techniques What do you do when the search space is very large or infinite? We’ll study three more AI search algorithms: Backtracking.
CS 188: Artificial Intelligence Spring 2006 Lecture 2: Queue-Based Search 8/31/2006 Dan Klein – UC Berkeley Many slides over the course adapted from either.
Uninformed Search (cont.)
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Heuristic Search Notes for Ch.12 of Bratko and Ch.2 of Shoham For CSCE 580.
1 Midterm Review cmsc421 Fall Outline Review the material covered by the midterm Questions?
State-Space Searches. 2 State spaces A state space consists of –A (possibly infinite) set of states The start state represents the initial problem Each.
State-Space Searches.
Informed Search Idea: be smart about what paths to try.
Dijkstra’s Algorithm and Heuristic Graph Search David Johnson.
Review: Search problem formulation Initial state Actions Transition model Goal state (or goal test) Path cost What is the optimal solution? What is the.
Informed Search Strategies
Problem Solving and Search Andrea Danyluk September 11, 2013.
Vilalta&Eick: Informed Search Informed Search and Exploration Search Strategies Heuristic Functions Local Search Algorithms Vilalta&Eick: Informed Search.
Heuristic Search In addition to depth-first search, breadth-first search, bound depth-first search, and iterative deepening, we can also use informed or.
Introduction to search Chapter 3. Why study search? §Search is a basis for all AI l search proposed as the basis of intelligence l inference l all learning.
Informed State Space Search Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
Computer Science CPSC 322 Lecture 9 (Ch , 3.7.6) Slide 1.
State-Space Searches. 2 State spaces A state space consists of A (possibly infinite) set of states The start state represents the initial problem Each.
Informed search strategies Idea: give the algorithm “hints” about the desirability of different states – Use an evaluation function to rank nodes and select.
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
For Monday Read chapter 4, section 1 No homework..
Review: Tree search Initialize the frontier using the starting state While the frontier is not empty – Choose a frontier node to expand according to search.
Lecture 3: Uninformed Search
Problem Spaces & Search CSE 573. © Daniel S. Weld 2 Logistics Mailing list Reading Ch 4.2, Ch 6 Mini-Project I Partners Game Playing?
Problem solving by search Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
Artificial Intelligence for Games Informed Search (2) Patrick Olivier
CSC3203: AI for Games Informed search (1) Patrick Olivier
Goal-based Problem Solving Goal formation Based upon the current situation and performance measures. Result is moving into a desirable state (goal state).
Search (continued) CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Uninformed search strategies A search strategy is defined by picking the order of node expansion Uninformed search strategies use only the information.
Slides by: Eric Ringger, adapted from slides by Stuart Russell of UC Berkeley. CS 312: Algorithm Design & Analysis Lecture #36: Best-first State- space.
Informed Search II CIS 391 Fall CIS Intro to AI 2 Outline PART I  Informed = use problem-specific knowledge  Best-first search and its variants.
Informed Search CSE 473 University of Washington.
CPSC 322, Lecture 6Slide 1 Uniformed Search (cont.) Computer Science cpsc322, Lecture 6 (Textbook finish 3.5) Sept, 17, 2012.
A* optimality proof, cycle checking CPSC 322 – Search 5 Textbook § 3.6 and January 21, 2011 Taught by Mike Chiang.
3.5 Informed (Heuristic) Searches This section show how an informed search strategy can find solution more efficiently than uninformed strategy. Best-first.
CPSC 322, Lecture 5Slide 1 Uninformed Search Computer Science cpsc322, Lecture 5 (Textbook Chpt 3.5) Sept, 13, 2013.
Brian Williams, Fall 041 Analysis of Uninformed Search Methods Brian C. Williams Sep 21 st, 2004 Slides adapted from: Tomas Lozano Perez,
For Monday Read chapter 4 exercise 1 No homework.
Romania. Romania Problem Initial state: Arad Goal state: Bucharest Operators: From any node, you can visit any connected node. Operator cost, the.
Artificial Intelligence Solving problems by searching.
Chapter 3.5 Heuristic Search. Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
CSE 473 University of Washington
Presentation transcript:

1 CMPUT 412 Search Algorithms Csaba Szepesvári University of Alberta TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA A A A A AA

2 Contents  Search problems on graphs  BFS  DFS, IDFS  A*  Outlook

3 Search problems on graphs  Single-pair shortest path problem: G=(V,E) g 2 V – goal state s 2 V – start state  Note: Graph could be implicit! (nodes generated as needed)  Examples: Shortest path on a map Solving logical puzzles Moving troops in a RTS game Finding a plan (AI)  Variants: All pairs shortest path problem Single-source shortest path problem Stochastic shortest path Infinite graphs (node=state, transition=move=action) Minimum cost optimal control (~reinforcement learning)..

4 Breadth-first search function BFS queue.add (s) while (!queue.empty()) n  queue.pop() if (goal(n)) return n; foreach (n,m) 2 E queue.add(m);  Space complexity ~ number of nodes at the deepest level; O(b d ) or O(|V|+|E|)  Time complexity: Same  Guarantees In finite graphs finds an optimal solution  Extension: costs; expand node with least cost from start

5 Depth-first search function dfs(n, &visited) if (goal(n)) return n; *visited.add(n) foreach (m,n) 2 E *if (!visited.has(m)) dfs(m,visited)  Space complexity: #elements visited  Time complexity: O(|V|+|E|), O(b d )  Guarantees: Finds the goal (without (*) only in loop-free graphs) Might not find the shortest path  Extensions Use a hash-table to store the list of visited nodes (or no list) + iterative deepening Advantage to BFS: Search can be directed

6 A* (Hart, Nilsson, Raphael, ’68) function A*(s) closed := ; q.insert([s]) while (!q.empty()) path  q.pop_first() n  path.last() if closed.has(n) continue if goal(n) return path closed.add(n) foreach (n,m) 2 E queue.add( list(p,m), c(p)+c(n,m)+h(m) ) return failure  Special best-first search algorithm  Idea: Prioritize node expansion by total estimated cost of the path through the node  Total cost = cost-so-far +cost-to-go (often: f=g+h)  h:V  R, h = h(n) “heuristic function” ~estimated cost-to-go  Guarantees Always finds a solution If h is optimistic, A* find the optimal soln  when no closed list is used -- or --  when h is monotonic Given h, optimally efficient  Time-complexity: O(2 L ), where L is the length of the optimal path |h-h * | = O(log h * )  poly(h)  Space-complexity: Might be the same  Extensions: IDA*, MA*, RBFS

7 Search terminology  If an algorithm A always.... finds a solution then A is complete.. finds an optimal solution then A is admissible.. does the least work amongst all admissible algorithm then A is optimally efficient

8 Outlook  Dijkstra A* with h(n)=0  Bellman-Ford: Computes cost-to-go with “value iteration” for all nodes in |V| iterations.  Pruning (beam search, ® - ¯,..)  Cost-to-go can be learnt (LRTA*, RL)  Problems can be stochastic (RL)  Monte-Carlo search; UCT (directed depth- first search, with changing cost-to-go estimates)  success in go