SlideShare a Scribd company logo
SUBMITTED TO: SUBMITTED BY:
MR. RAVI KHATWAL KRATI KATYAL
MCA 5TH SEM
AO* ALGORITHM &
PROBLEM REDUCTION
Topic Covered
 AND/OR Graph
 AO* Problem Reduction Algorithm
 Forward Chaining
 Backward Chaining
 Proof Tree Generated by Forward/Backward Chaining
 References
AND/OR graphs
 Some problems are best represented as achieving subgoals, some of which
achieved simultaneously and independently (AND)
 Up to now, only dealt with OR options
Complete Assignment
Copy Assignment Study Topic Do Assignment
Searching AND/OR graphs
 A solution in an AND-OR tree is a sub tree whose leafs are included in the goal
set
 Cost function: sum of costs in AND node
f(n) = f(n1) + f(n2) + …. + f(nk)
 How can we extend A* to search AND/OR trees? The AO* algorithm.
AND/OR search
 We must examine several nodes simultaneously when choosing the next move
A
B C D(3)
(4)
(5)
(9)
A
B C D
38
E F G H I J
17 9 27
(5) (10) (3) (4) (15) (10)
AND/OR Best-First-Search
 Traverse the graph (from the initial node) following the best current path.
 Pick one of the unexpanded nodes on that path and expand it. Add its
successors to the graph and compute f for each of them
 Change the expanded node’s f value to reflect its successors. Propagate the
change up the graph.
 Reconsider the current best solution and repeat until a solution is found
AND/OR Best-First-Search example
AND/OR Best-First-Search example
A Longer path may be better
AO* algorithm
1. Let G be a graph with only starting node INIT.
2. Repeat the followings until INIT is labeled SOLVED or
h(INIT) > FUTILITY
a) Select an unexpanded node from the most promising path from
INIT (call it NODE)
b) Generate successors of NODE. If there are none, set h(NODE) =
FUTILITY (i.e., NODE is unsolvable); otherwise for each
SUCCESSOR that is not an ancestor of NODE do the following:
i. Add SUCCESSSOR to G.
ii. If SUCCESSOR is a terminal node, label it SOLVED and set
h(SUCCESSOR) = 0.
iii. If SUCCESSPR is not a terminal node, compute its h
AO* algorithm (Cont.)
c) Propagate the newly discovered information up the graph by doing the
following: let S be set of SOLVED nodes or nodes whose h values have
been changed and need to have values propagated back to their parents.
Initialize S to Node. Until S is empty repeat the followings:
i. Remove a node from S and call it CURRENT.
ii. Compute the cost of each of the arcs emerging from CURRENT. Assign
minimum cost of its successors as its h.
iii. Mark the best path out of CURRENT by marking the arc that had the
minimum cost in step ii
iv. Mark CURRENT as SOLVED if all of the nodes connected to it through
new labeled arc have been labeled SOLVED
v. If CURRENT has been labeled SOLVED or its cost was just changed,
propagate its new cost back up through the graph. So add all of the
ancestors of CURRENT to S.
An Example
An Example
An Example
An Example
And or graph problem reduction using predicate logic
And or graph problem reduction using predicate logic
And or graph problem reduction using predicate logic
Proof Tree Generated by
Forward/Backward Chaining
Consider The Following Sentences
1. It is a crime for an American to sell weapons to hostile Nations.
2. Pakistan has some missiles.
3. All of its(Paksitan’s) missiles were sold to it by Colonel West.
4. Missiles are weapons
5. Enemy of America counts as “hostile”.
6. West is American.
7. The country Pakistan is an enemy of America.
a) Translate these sentenses into Formula in Predicate Logic.
b) Prove that “West is criminal” using forward chaining.
c) Prove that “West is criminal” using Backward chaining.
Solution A:
1. ∀X, Y, Z american(X) ⋀ weapon(Y) ⋀ sells(X,Y,Z) ⋀ hostile(Z) → criminal(X)
2. ∃X owns(pakistan, X) ⋀ missile(X)
3. ∀X missile(X) ⋀ owns(pakistan, X) → sells(west, X, pakistan)
4. Missile(X) → weapon(X)
5. Enemy(X, america) → hostile(X)
6. American(west)
7. Enemy(pakistan,america)
Solution B:
 Own(pakistan,m1)⋀missile(m1) ⋀ american(west) ⋀ enemy(pakistan, america)
↓ Rule(3) and {m1/X}
 Own(pakistan,m1)⋀missile(m1) ⋀ sells(west,m1, pakistan) ⋀ american(west)
⋀enemy(pakistan, america)
↓ Rule(4) and {m1/X}
 Own(pakistan,m1) ⋀ missile(m1) ⋀ weapon(m1) ⋀ sells(west, m1, pakistan,) ⋀
enemy(pakistan, america) ⋀ american(west)
↓ Rule(5) and {pakistan/X}
 Own(pakistan,missile(m1) ⋀weapon(m1) ⋀ sells(west, m1, pakistan) ⋀
hostile(pakistan) ⋀ enemy(pakistan,america) ⋀ american(west)
↓ Rule(1) {west/X, Y/m1, Z/pakistan}
 criminal (west)
Showing Procedure Using AND/OR Graph
Solution C:
 Here, we start with our goal as given in figure
 Criminal(west)
 ↑ Rule(1) & {west/X}
 american(west) ⋀ weapon(Y) ⋀ sells(wet, Y, Z) ⋀ hostile(Z)
 ↑ Rule(6)
 weapon(Y) ⋀ sells(west, Y, Z) ⋀ hostile(Z)
 ↑ Rule(5) & {Z/X}
 weapon(Y) ⋀ sells(west, Y, Z) ⋀ enemy(Z, America)
 ↑ Rule(7) & {pakistan/Z}
 weapon(Y) ⋀ sells(west, Y, pakistan)
 ↑ Rule(4) & {Y/X}
 missile(Y) ⋀ sells(west, Y, pakistan)
 ↑ Rule(2,b) and {Y/m1}
 sells(west, Y, pakistan)
 ↑ Rule(3) {Y/X}
 missile(Y) ⋀ owns(pakistan, Y)
 ↑ Rule(2, a)and (2, b) and {Y/m1}
 Nil
Showing Procedure Using AND/OR Graph
References
 Book Reference
 Artificial Intelligence – Amit Barjatiya & Dinesh Diggiwal
 Artificial Intelligence – Russell & Norvig
 Web Reference
 www.wikipedia.org
 artificialintelligence-notes.blogspot.in
And or graph problem reduction using predicate logic

More Related Content

PPTX
Problem reduction AND OR GRAPH & AO* algorithm.ppt
PPT
pushdown automata
PPTX
A* Algorithm
PPTX
Informed and Uninformed search Strategies
PPT
Knowledge Representation & Reasoning
PPTX
CONTEXT FREE GRAMMAR
PPTX
Hill climbing algorithm
PPT
Hill climbing
Problem reduction AND OR GRAPH & AO* algorithm.ppt
pushdown automata
A* Algorithm
Informed and Uninformed search Strategies
Knowledge Representation & Reasoning
CONTEXT FREE GRAMMAR
Hill climbing algorithm
Hill climbing

What's hot (20)

PPTX
And or graph
PDF
A* Search Algorithm
PPTX
Problem solving agents
PPTX
convex hull
PPTX
Chapter 9 morphological image processing
PDF
I. AO* SEARCH ALGORITHM
DOCX
Multiversion Concurrency Control Techniques
PPTX
Psuedo color
PDF
I. Hill climbing algorithm II. Steepest hill climbing algorithm
PDF
Syntax Directed Definition and its applications
PPTX
Constraint satisfaction problems (csp)
PPT
Planning
PPTX
Uninformed search /Blind search in AI
PDF
Digital Image Processing: Image Enhancement in the Frequency Domain
PPT
Artificial Intelligence: Case-based & Model-based Reasoning
PPTX
search strategies in artificial intelligence
PPTX
daa-unit-3-greedy method
PDF
I. Mini-Max Algorithm in AI
PDF
Problem Characteristics in Artificial Intelligence
And or graph
A* Search Algorithm
Problem solving agents
convex hull
Chapter 9 morphological image processing
I. AO* SEARCH ALGORITHM
Multiversion Concurrency Control Techniques
Psuedo color
I. Hill climbing algorithm II. Steepest hill climbing algorithm
Syntax Directed Definition and its applications
Constraint satisfaction problems (csp)
Planning
Uninformed search /Blind search in AI
Digital Image Processing: Image Enhancement in the Frequency Domain
Artificial Intelligence: Case-based & Model-based Reasoning
search strategies in artificial intelligence
daa-unit-3-greedy method
I. Mini-Max Algorithm in AI
Problem Characteristics in Artificial Intelligence
Ad

Viewers also liked (6)

PPT
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
PPT
PPT
Knapsack problem using fixed tuple
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Knapsack problem using fixed tuple
Ad

Similar to And or graph problem reduction using predicate logic (20)

PPT
Jarrar.lecture notes.aai.2011s.ch4.informedsearch
PDF
DSA (Data Structure and Algorithm) Questions
DOCX
graphin-c1.pnggraphin-c1.txt1 22 3 83 44 5.docx
PPTX
Algorithm Homework Help
PDF
Monad presentation scala as a category
PDF
Heuristic Searching: A* Search
DOCX
MTH 2001 Project 2Instructions• Each group must choos.docx
PPTX
Unit ii-ppt
PDF
Real World Haskell: Lecture 5
PDF
04 greedyalgorithmsii 2x2
PDF
Answers withexplanations
PPT
Unit 2 Topic 4 Informed search strategies AO.ppt
PPTX
Sorting2
PPTX
Network Design Assignment Help
DOCX
Cs6660 compiler design november december 2016 Answer key
PPTX
PDF
preTEST2A MAT225 Multivariable Calculus
PDF
2020 preTEST2A
PPT
test pre
PDF
preTEST2A Solution MAT225 Multivariable Calculus
Jarrar.lecture notes.aai.2011s.ch4.informedsearch
DSA (Data Structure and Algorithm) Questions
graphin-c1.pnggraphin-c1.txt1 22 3 83 44 5.docx
Algorithm Homework Help
Monad presentation scala as a category
Heuristic Searching: A* Search
MTH 2001 Project 2Instructions• Each group must choos.docx
Unit ii-ppt
Real World Haskell: Lecture 5
04 greedyalgorithmsii 2x2
Answers withexplanations
Unit 2 Topic 4 Informed search strategies AO.ppt
Sorting2
Network Design Assignment Help
Cs6660 compiler design november december 2016 Answer key
preTEST2A MAT225 Multivariable Calculus
2020 preTEST2A
test pre
preTEST2A Solution MAT225 Multivariable Calculus

Recently uploaded (20)

PPTX
ECG_Course_Presentation د.محمد صقران ppt
PPTX
Introduction to Fisheries Biotechnology_Lesson 1.pptx
PPTX
2. Earth - The Living Planet Module 2ELS
PDF
Placing the Near-Earth Object Impact Probability in Context
PPTX
cpcsea ppt.pptxssssssssssssssjjdjdndndddd
PDF
Mastering Bioreactors and Media Sterilization: A Complete Guide to Sterile Fe...
PDF
SEHH2274 Organic Chemistry Notes 1 Structure and Bonding.pdf
PPT
The World of Physical Science, • Labs: Safety Simulation, Measurement Practice
PPT
POSITIONING IN OPERATION THEATRE ROOM.ppt
PPTX
The KM-GBF monitoring framework – status & key messages.pptx
PDF
An interstellar mission to test astrophysical black holes
PDF
HPLC-PPT.docx high performance liquid chromatography
PPTX
Introduction to Cardiovascular system_structure and functions-1
PPTX
2. Earth - The Living Planet earth and life
PPTX
Microbiology with diagram medical studies .pptx
PPTX
Protein & Amino Acid Structures Levels of protein structure (primary, seconda...
PDF
ELS_Q1_Module-11_Formation-of-Rock-Layers_v2.pdf
PPTX
Taita Taveta Laboratory Technician Workshop Presentation.pptx
PDF
Biophysics 2.pdffffffffffffffffffffffffff
PPTX
microscope-Lecturecjchchchchcuvuvhc.pptx
ECG_Course_Presentation د.محمد صقران ppt
Introduction to Fisheries Biotechnology_Lesson 1.pptx
2. Earth - The Living Planet Module 2ELS
Placing the Near-Earth Object Impact Probability in Context
cpcsea ppt.pptxssssssssssssssjjdjdndndddd
Mastering Bioreactors and Media Sterilization: A Complete Guide to Sterile Fe...
SEHH2274 Organic Chemistry Notes 1 Structure and Bonding.pdf
The World of Physical Science, • Labs: Safety Simulation, Measurement Practice
POSITIONING IN OPERATION THEATRE ROOM.ppt
The KM-GBF monitoring framework – status & key messages.pptx
An interstellar mission to test astrophysical black holes
HPLC-PPT.docx high performance liquid chromatography
Introduction to Cardiovascular system_structure and functions-1
2. Earth - The Living Planet earth and life
Microbiology with diagram medical studies .pptx
Protein & Amino Acid Structures Levels of protein structure (primary, seconda...
ELS_Q1_Module-11_Formation-of-Rock-Layers_v2.pdf
Taita Taveta Laboratory Technician Workshop Presentation.pptx
Biophysics 2.pdffffffffffffffffffffffffff
microscope-Lecturecjchchchchcuvuvhc.pptx

And or graph problem reduction using predicate logic

  • 1. SUBMITTED TO: SUBMITTED BY: MR. RAVI KHATWAL KRATI KATYAL MCA 5TH SEM AO* ALGORITHM & PROBLEM REDUCTION
  • 2. Topic Covered  AND/OR Graph  AO* Problem Reduction Algorithm  Forward Chaining  Backward Chaining  Proof Tree Generated by Forward/Backward Chaining  References
  • 3. AND/OR graphs  Some problems are best represented as achieving subgoals, some of which achieved simultaneously and independently (AND)  Up to now, only dealt with OR options Complete Assignment Copy Assignment Study Topic Do Assignment
  • 4. Searching AND/OR graphs  A solution in an AND-OR tree is a sub tree whose leafs are included in the goal set  Cost function: sum of costs in AND node f(n) = f(n1) + f(n2) + …. + f(nk)  How can we extend A* to search AND/OR trees? The AO* algorithm.
  • 5. AND/OR search  We must examine several nodes simultaneously when choosing the next move A B C D(3) (4) (5) (9) A B C D 38 E F G H I J 17 9 27 (5) (10) (3) (4) (15) (10)
  • 6. AND/OR Best-First-Search  Traverse the graph (from the initial node) following the best current path.  Pick one of the unexpanded nodes on that path and expand it. Add its successors to the graph and compute f for each of them  Change the expanded node’s f value to reflect its successors. Propagate the change up the graph.  Reconsider the current best solution and repeat until a solution is found
  • 9. A Longer path may be better
  • 10. AO* algorithm 1. Let G be a graph with only starting node INIT. 2. Repeat the followings until INIT is labeled SOLVED or h(INIT) > FUTILITY a) Select an unexpanded node from the most promising path from INIT (call it NODE) b) Generate successors of NODE. If there are none, set h(NODE) = FUTILITY (i.e., NODE is unsolvable); otherwise for each SUCCESSOR that is not an ancestor of NODE do the following: i. Add SUCCESSSOR to G. ii. If SUCCESSOR is a terminal node, label it SOLVED and set h(SUCCESSOR) = 0. iii. If SUCCESSPR is not a terminal node, compute its h
  • 11. AO* algorithm (Cont.) c) Propagate the newly discovered information up the graph by doing the following: let S be set of SOLVED nodes or nodes whose h values have been changed and need to have values propagated back to their parents. Initialize S to Node. Until S is empty repeat the followings: i. Remove a node from S and call it CURRENT. ii. Compute the cost of each of the arcs emerging from CURRENT. Assign minimum cost of its successors as its h. iii. Mark the best path out of CURRENT by marking the arc that had the minimum cost in step ii iv. Mark CURRENT as SOLVED if all of the nodes connected to it through new labeled arc have been labeled SOLVED v. If CURRENT has been labeled SOLVED or its cost was just changed, propagate its new cost back up through the graph. So add all of the ancestors of CURRENT to S.
  • 19. Proof Tree Generated by Forward/Backward Chaining Consider The Following Sentences 1. It is a crime for an American to sell weapons to hostile Nations. 2. Pakistan has some missiles. 3. All of its(Paksitan’s) missiles were sold to it by Colonel West. 4. Missiles are weapons 5. Enemy of America counts as “hostile”. 6. West is American. 7. The country Pakistan is an enemy of America.
  • 20. a) Translate these sentenses into Formula in Predicate Logic. b) Prove that “West is criminal” using forward chaining. c) Prove that “West is criminal” using Backward chaining.
  • 21. Solution A: 1. ∀X, Y, Z american(X) ⋀ weapon(Y) ⋀ sells(X,Y,Z) ⋀ hostile(Z) → criminal(X) 2. ∃X owns(pakistan, X) ⋀ missile(X) 3. ∀X missile(X) ⋀ owns(pakistan, X) → sells(west, X, pakistan) 4. Missile(X) → weapon(X) 5. Enemy(X, america) → hostile(X) 6. American(west) 7. Enemy(pakistan,america)
  • 22. Solution B:  Own(pakistan,m1)⋀missile(m1) ⋀ american(west) ⋀ enemy(pakistan, america) ↓ Rule(3) and {m1/X}  Own(pakistan,m1)⋀missile(m1) ⋀ sells(west,m1, pakistan) ⋀ american(west) ⋀enemy(pakistan, america) ↓ Rule(4) and {m1/X}  Own(pakistan,m1) ⋀ missile(m1) ⋀ weapon(m1) ⋀ sells(west, m1, pakistan,) ⋀ enemy(pakistan, america) ⋀ american(west) ↓ Rule(5) and {pakistan/X}  Own(pakistan,missile(m1) ⋀weapon(m1) ⋀ sells(west, m1, pakistan) ⋀ hostile(pakistan) ⋀ enemy(pakistan,america) ⋀ american(west) ↓ Rule(1) {west/X, Y/m1, Z/pakistan}  criminal (west)
  • 23. Showing Procedure Using AND/OR Graph
  • 24. Solution C:  Here, we start with our goal as given in figure  Criminal(west)  ↑ Rule(1) & {west/X}  american(west) ⋀ weapon(Y) ⋀ sells(wet, Y, Z) ⋀ hostile(Z)  ↑ Rule(6)  weapon(Y) ⋀ sells(west, Y, Z) ⋀ hostile(Z)  ↑ Rule(5) & {Z/X}  weapon(Y) ⋀ sells(west, Y, Z) ⋀ enemy(Z, America)  ↑ Rule(7) & {pakistan/Z}  weapon(Y) ⋀ sells(west, Y, pakistan)  ↑ Rule(4) & {Y/X}
  • 25.  missile(Y) ⋀ sells(west, Y, pakistan)  ↑ Rule(2,b) and {Y/m1}  sells(west, Y, pakistan)  ↑ Rule(3) {Y/X}  missile(Y) ⋀ owns(pakistan, Y)  ↑ Rule(2, a)and (2, b) and {Y/m1}  Nil
  • 26. Showing Procedure Using AND/OR Graph
  • 27. References  Book Reference  Artificial Intelligence – Amit Barjatiya & Dinesh Diggiwal  Artificial Intelligence – Russell & Norvig  Web Reference  www.wikipedia.org  artificialintelligence-notes.blogspot.in