1 / 12

And-Or Graphs

And-Or Graphs. CSCE 580 Spr03 Instructor: Marco Valtorta Hrishikesh J. Goradia Seang-Chan Ryu. And-Or Graphs. Technique for solving problems that can be decomposed into sub problems Links between nodes indicates relations between problems Or node: one of its successor node has to be solved

bryant
Télécharger la présentation

And-Or Graphs

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. And-Or Graphs CSCE 580 Spr03 Instructor: Marco Valtorta Hrishikesh J. Goradia Seang-Chan Ryu

  2. And-Or Graphs • Technique for solving problems that can be decomposed into sub problems • Links between nodes indicates relations between problems • Or node: one of its successor node has to be solved • And node: all of its successor node has to be solved • Problem can be specified by two thinks: start node, goal nodes. • Goal nodes: trivial (or primitive) problems • Cost can be attached to arcs or nodes

  3. And-Or Graphs • Difference between state-state representation and and or representation. solution: path vs. tree

  4. Search in and-or graphs a b c d e f g h i

  5. Search in and-or graphs • Use Prolog’s own search mechanism • Only get answer yes or no not solution graph. • Hard to extend to use cost as well • Infinite loop if there is a cycle a :- b. a :- c. b :- d, e. e :- h. c :- f, g. f :- h, i. d. g. h.

  6. Search in and-or graphs • Other representation :- op (600, xfx, --->). :- op (500, xfx, :). a ---> or : [b,c]. b ---> and : [d,e]. c ---> and : [f,g]. e ---> or : [h]. f ---> or : [h,i]. goal( d). goal( g). goal( h).

  7. Search in and-or graphs • Depth first search. • Modification of depth first search (restricting with maximum depth) – andor.pl • Iterative deepening. (increase the maximum depth as the search goes along).

  8. Applying and-or graphs • Adversarial situations, such as game playing, can often be represented as and-or trees • Nodes represent the situation • Arcs represent possible actions for each player • Each path represents the sequence of choices made alternately by the two opponents • In the case of game trees, one is interested in a winning strategy.

  9. Tic-tac-toe game • Max size of the state space for a complete solution = 9!

  10. Tic-tac-toe game • For pragmatic reasons, we will consider a subset of the tic-tac-toe problem. • The adjacent figure shows the initial state of our tic-tac-toe program. • Max. state space for our new problem = 4!

  11. Tic-tac-toe game • The winning positions (shown in red) are the goal states. • tictactoe.pl shows the complete Prolog code for our problem.

  12. Final comments… • For use in real-world applications, the AND-OR graphs technique computes the best state instead of a complete path to the terminal state. These graphs use minmax search and are called game trees. • The AND-OR technique for searching can be easily extended to accommodate cost in the graph problems

More Related