AND/OR Graphs Ivan Bratko Faculty of Information and Computer Sc. University of Ljubljana Useful for solving problems by problem decomposition Searching.

Slides:



Advertisements
Similar presentations
PROBLEM SOLVING AND SEARCH
Advertisements

And-Or Graphs CSCE 580 Spr03 Instructor: Marco Valtorta Hrishikesh J. Goradia Seang-Chan Ryu.
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*
Problem-solving as search. History Problem-solving as search – early insight of AI. Newell and Simon’s theory of human intelligence and problem-solving.
Properties of breadth-first search Complete? Yes (if b is finite) Time? 1+b+b 2 +b 3 +… +b d + b(b d -1) = O(b d+1 ) Space? O(b d+1 ) (keeps every node.
1 Tree Searching Strategies Updated: 2010/12/27. 2 The procedure of solving many problems may be represented by trees. Therefore the solving of these.
CSC 423 ARTIFICIAL INTELLIGENCE
Artificial Intelligence (CS 461D)
Search Strategies CPS4801. Uninformed Search Strategies Uninformed search strategies use only the information available in the problem definition Breadth-first.
Mahgul Gulzai Moomal Umer Rabail Hafeez
Problem Solving by Searching
CPSC 322 Introduction to Artificial Intelligence October 27, 2004.
SE Last time: Problem-Solving Problem solving: Goal formulation Problem formulation (states, operators) Search for solution Problem formulation:
Review: Search problem formulation
Toy Problem: Missionaries and Cannibals
Cooperating Intelligent Systems Informed search Chapter 4, AIMA.
Using Search in Problem Solving
Pathfinding Algorithms Josh Palmer Rachael Beers.
Using Search in Problem Solving
CSC344: AI for Games Lecture 4: Informed search
Solving problems by searching
CS 561, Session 6 1 Last time: Problem-Solving Problem solving: Goal formulation Problem formulation (states, operators) Search for solution Problem formulation:
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?
Informed Search Idea: be smart about what paths to try.
Dijkstra’s Algorithm and Heuristic Graph Search David Johnson.
Problem Solving and Search Andrea Danyluk September 11, 2013.
Logic Programming Lecture 7: Search Strategies: Problem representations Depth-first, breadth-first, and AND/OR search.
Artificial Intelligence LECTURE 3 ARTIFICIAL INTELLIGENCE LECTURES BY ENGR. QAZI ZIA 1.
Chapter 4 Search in State Spaces Xiu-jun GONG (Ph. D) School of Computer Science and Technology, Tianjin University
CS 416 Artificial Intelligence Lecture 4 Uninformed Searches (cont) Lecture 4 Uninformed Searches (cont)
1 CO Games Development 1 Week 11 Search Methods Gareth Bellaby.
Informed (Heuristic) Search
Informed search algorithms Chapter 4. Outline Best-first search Greedy best-first search A * search Heuristics.
CHAPTER 4: INFORMED SEARCH & EXPLORATION Prepared by: Ece UYKUR.
Problem Reduction Search: AND/OR Graphs & Game Trees Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
A RTIFICIAL I NTELLIGENCE UNIT : 2 Search Techniques.
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
For Monday Read chapter 4, section 1 No homework..
Search exploring the consequences of possible actions.
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
Advanced Artificial Intelligence Lecture 2: Search.
Artificial Intelligence for Games Informed Search (2) Patrick Olivier
CSC3203: AI for Games Informed search (1) Patrick Olivier
Intelligent Control Methods Lecture 4: Searching in State Space Slovak University of Technology Faculty of Material Science and Technology in Trnava.
Artificial Intelligence University Politehnica of Bucharest Adina Magda Florea
1 Solving problems by searching Chapter 3. Depth First Search Expand deepest unexpanded node The root is examined first; then the left child of the root;
Search (continued) CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Informed Search and Heuristics Chapter 3.5~7. Outline Best-first search Greedy best-first search A * search Heuristics.
Problem Reduction So far we have considered search strategies for OR graph. In OR graph, several arcs indicate a variety of ways in which the original.
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 CSE 473 University of Washington.
Decomposition spaces Spring 2007, Juris Vīksna. Sample problem - Towers of Hanoi [Adapted from R.Shinghal]
3.5 Informed (Heuristic) Searches This section show how an informed search strategy can find solution more efficiently than uninformed strategy. Best-first.
Logic Programming Lecture 7: Search Strategies:
Artificial Intelligence Lecture No. 8 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
For Monday Read chapter 4 exercise 1 No homework.
Biointelligence Lab School of Computer Sci. & Eng. Seoul National University Artificial Intelligence Chapter 8 Uninformed Search.
Romania. Romania Problem Initial state: Arad Goal state: Bucharest Operators: From any node, you can visit any connected node. Operator cost, the.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Artificial Intelligence Solving problems by searching.
Chapter 3.5 Heuristic Search. Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
Dept. Computer Science, Korea Univ. Intelligent Information System Lab A I (Artificial Intelligence) Professor I. J. Chung.
Heuristic Search A heuristic is a rule for choosing a branch in a state space search that will most likely lead to a problem solution Heuristics are used.
Artificial Intelligence Problem solving by searching CSC 361
Introduction to Artificial Intelligence Lecture 9: Two-Player Games I
The Rich/Knight Implementation
The Rich/Knight Implementation
Presentation transcript:

AND/OR Graphs Ivan Bratko Faculty of Information and Computer Sc. University of Ljubljana Useful for solving problems by problem decomposition Searching AND/OR graphs: depth-first, breadth-first AO*, a generalisation of A*

Example: map with river, bridges at f,g Bridges at f, g

Problem: Find path from a to z Decomposition into subproblems

Relations among subproblems To solve P, solve P1 or P2 or... To solve Q, solve Q1 and Q2 and...

Solutions are trees cost = 9 cost = 8

AND/OR Graphs AND nodes, OR nodes Problem = start node + goal condition Solution = solution graph (tree) Cost of tree = sum of costs of tree’s arcs AND-related nodes independent Independence requirement relaxed: ordering w.r.t. solutions

Example of ordered subproblems: Tower of Hanoi disks a, b, c on peg 3 a on 3 b on 3 c on 3 Order of subprobl.: first c on 3, then b on 3,... abcabc

Other examples of AND/OR representations Two person, perfect information games (chess, checkers) Expert-system problem solving Design from “first principles”

AND/OR graphs for games

Design from “first principles” Design robot to transfer objects Function Transfer Subfunctions Grasp Lift... Components Grip1 Grip2... Motor1 Motor2...

Direct representation in Prolog: Prolog does AND/OR search a :- b; c. % OR-related successors b :- d, e. % AND-related successors d. g. e. % Goal nodes... ?- a. yes Shortcomings: no solution tree no costs susceptible to loops

Alternative representation of AND/OR graph :- op( 600, xfx, --->). :- op( 500, xfx, :). a ---> or : [b,c]. b ---> and : [d,e]. goal( d). goal( g). goal( h).

Form of solution tree % solve( Node, SolutionTree) SolutionTree = Node if goal( Node) Node ---> SubTree if Node has OR-succ. Node ---> and: SubTrees if Node has AND-succ. For example: SolutionTree = a ---> b ---> and : [ d, e ---> h]

% solve( Node, SolutionTree): depth-first AND/OR search solve( Node, Node) :- % Solution tree of goal node is Node itself goal(Node). solve( Node, Node ---> Tree) :- Node ---> or:Nodes, % Node is an OR-node member( Node1, Nodes), % Select a successor Node1 of Node solve( Node1, Tree). solve( Node, Node ---> and:Trees) :- Node ---> and:Nodes, % Node is an AND-node solveall( Nodes, Trees). % Solve all Node's successors % solveall( [Node1,Node2,...], [SolutionTree1,SolutionTree2,...]) solveall( [], []). solveall( [Node|Nodes], [Tree|Trees]) :- solve( Node, Tree), solveall( Nodes, Trees).

Simple refinements of depth-first AND/OR search Limit search depth (prevent infinite loops) Emulate breadth-first search by iterative deepening AND/OR search

Best-first AND/OR search Algorithm AO*, a generalisation of A* to AND/OR search Define: Cost of solution tree = Sum of tree’s arc costs Cost of node = cost of node’s optimal solution tree h(N) = heuristic estimate of cost of node N

Updated heuristic estimates of nodes Heuristic estimates of nodes are updated when new information becomes available during search (when search tree expands) H(N) = updated heuristic estimate of cost of (any) node in search tree H(N) = h(N) if N is a leaf in search tree H(N) = min i ( cost(N,N i ) + H(N i ) ) N N 1 N 2... H(N) = SUM i ( cost(N,N i ) + H(N i ) ) N N 1 N 2...

Example of AO* search AND/OR graph to be searched

Trace of AO* search

Best-first AND/OR search AO* program in Prolog: in Bratko 2001, Prolog Programming for AI, pages For simpler implementation, this program uses node evaluation function F defined as: F(N) = H(N) + cost(M,N), M predecessor of N Admissibility of AO*: AO* is admissible if h(N) =< h*(N) for all N (similar to admissibility of A*)