and/or graph search - wikimedia · 5a and/or graph 3 young won lim 14년 10월 27일 hanoi tower...

14
Young Won Lim 14년 10월 27일 Problem Reduction Hanoi Tower Monkey and Banana AND/OR Graph Search AND/OR Graph Search

Upload: others

Post on 06-Jun-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: AND/OR Graph Search - Wikimedia · 5A AND/OR Graph 3 Young Won Lim 14년 10월 27일 Hanoi Tower – Problem Reduction (1 1 1) B A C 1 2 3 1 2 3 B A C 1 2 3 B A C (1 2 2) (3 2 2)

Young Won Lim14년 10월 27일

● Problem Reduction● Hanoi Tower● Monkey and Banana● AND/OR Graph Search

AND/OR Graph Search

Page 2: AND/OR Graph Search - Wikimedia · 5A AND/OR Graph 3 Young Won Lim 14년 10월 27일 Hanoi Tower – Problem Reduction (1 1 1) B A C 1 2 3 1 2 3 B A C 1 2 3 B A C (1 2 2) (3 2 2)

Young Won Lim14년 10월 27일

Copyright (c) 2010 Young W. Lim.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".

Please send corrections (or suggestions) to [email protected].

This document was produced by using OpenOffice and Octave.

Page 3: AND/OR Graph Search - Wikimedia · 5A AND/OR Graph 3 Young Won Lim 14년 10월 27일 Hanoi Tower – Problem Reduction (1 1 1) B A C 1 2 3 1 2 3 B A C 1 2 3 B A C (1 2 2) (3 2 2)

5A AND/OR Graph 3 Young Won Lim14년 10월 27일

Hanoi Tower – Problem Reduction

(1 1 1)

BA

C

1 2 3 1 2 3

BA

C

1 2 3BA

C

(1 2 2) (3 2 2)

(3 3 3)

1 2 3BA

C

Page 4: AND/OR Graph Search - Wikimedia · 5A AND/OR Graph 3 Young Won Lim 14년 10월 27일 Hanoi Tower – Problem Reduction (1 1 1) B A C 1 2 3 1 2 3 B A C 1 2 3 B A C (1 2 2) (3 2 2)

5A AND/OR Graph 4 Young Won Lim14년 10월 27일

Hanoi Tower – State Space

(1 1 1)

(1 1 2)

(1 3 2)

(1 3 3)

(2 3 3)

(2 3 1)

(2 2 1)

(2 2 2)

(1 1 3)

(1 2 3)

(1 3 1) (1 2 1)

(1 2 2)

(3 2 2)

(2 3 2) (3 2 3) (3 2 1)

(2 1 2) (1 3 1) (3 3 1)

(2 2 3) (2 1 3) (2 1 1) (3 1 1) (3 1 2) (3 3 2) (3 3 3)

ABC

BC

A

C

A

B

C

AB

C

AB

A

C

B

A

BC

BC

A

C

B

A

AC

B

AC

B

C

AB

AC

B

B

AC

A

B

C

B

AC

AC

B

A

BC

ABC

BC

A

B

C

A

AB

C

AB

C

B

A

C

A

BC

ABC

A B

C

Page 5: AND/OR Graph Search - Wikimedia · 5A AND/OR Graph 3 Young Won Lim 14년 10월 27일 Hanoi Tower – Problem Reduction (1 1 1) B A C 1 2 3 1 2 3 B A C 1 2 3 B A C (1 2 2) (3 2 2)

5A AND/OR Graph 5 Young Won Lim14년 10월 27일

Key Operator

(1 1 1)

(1 2 2) (3 2 2)

(3 3 3)

ABC

C

AB

ABC

A B

C

Primitive Problem

Key Operator

Page 6: AND/OR Graph Search - Wikimedia · 5A AND/OR Graph 3 Young Won Lim 14년 10월 27일 Hanoi Tower – Problem Reduction (1 1 1) B A C 1 2 3 1 2 3 B A C 1 2 3 B A C (1 2 2) (3 2 2)

5A AND/OR Graph 6 Young Won Lim14년 10월 27일

AND/OR Graph

(1 1 1)

(1 2 2) (3 2 2)

(3 3 3)

ABC

C

AB

ABC

A B

C

Key Operator

Problem A

Problem B

Problem C

Problem D A

C DB

B AND C AND D

Page 7: AND/OR Graph Search - Wikimedia · 5A AND/OR Graph 3 Young Won Lim 14년 10월 27일 Hanoi Tower – Problem Reduction (1 1 1) B A C 1 2 3 1 2 3 B A C 1 2 3 B A C (1 2 2) (3 2 2)

5A AND/OR Graph 7 Young Won Lim14년 10월 27일

AND/OR Graph – Terminal Node

A

C DB

E OR F

(1 1 1)

(1 2 2) (3 2 2)

(3 3 3)

ABC

C

AB

ABC

A B

C

Primitive Problem

Key Operator

E F G H

G OR H OR ...

Terminal Node

Page 8: AND/OR Graph Search - Wikimedia · 5A AND/OR Graph 3 Young Won Lim 14년 10월 27일 Hanoi Tower – Problem Reduction (1 1 1) B A C 1 2 3 1 2 3 B A C 1 2 3 B A C (1 2 2) (3 2 2)

5A AND/OR Graph 8 Young Won Lim14년 10월 27일

Monkey and Banana

goto

pushboxclimbbox

grasp

Page 9: AND/OR Graph Search - Wikimedia · 5A AND/OR Graph 3 Young Won Lim 14년 10월 27일 Hanoi Tower – Problem Reduction (1 1 1) B A C 1 2 3 1 2 3 B A C 1 2 3 B A C (1 2 2) (3 2 2)

5A AND/OR Graph 9 Young Won Lim14년 10월 27일

Monkey and Banana - State

(w, x, y, z)

w: the position of the monkey (horizontal, vertical)x: monkey on top of the box (1 or 0)y: the position of the box (horizontal, vertical)z: monkey grasping the banana (1 or 0)

(w, x, y, z)

(w, x, y, z)(w, x, y, z)

monkey box

on top of the box

grasping the banana

Page 10: AND/OR Graph Search - Wikimedia · 5A AND/OR Graph 3 Young Won Lim 14년 10월 27일 Hanoi Tower – Problem Reduction (1 1 1) B A C 1 2 3 1 2 3 B A C 1 2 3 B A C (1 2 2) (3 2 2)

5A AND/OR Graph 10 Young Won Lim14년 10월 27일

Operator Difference (1)

(w, 0, y, z) (u, 0, y, z)goto(u)

(w, 0, w, z) (v, 0, v, z)pushbox(v)

precondition: x = 0

difference: The monkey is not at the location u.

precondition: w = y, x = 0

difference: The box is not at the location v.

Page 11: AND/OR Graph Search - Wikimedia · 5A AND/OR Graph 3 Young Won Lim 14년 10월 27일 Hanoi Tower – Problem Reduction (1 1 1) B A C 1 2 3 1 2 3 B A C 1 2 3 B A C (1 2 2) (3 2 2)

5A AND/OR Graph 11 Young Won Lim14년 10월 27일

Operator Difference (2)

precondition: w = y, x = 0

difference: The monkey is not on the box.

precondition: x = y = C, x = 1, z = 0

difference: The monkey does not have bananas.

(w, 0, w, z) (w, 1, w, z)climbbox

(c, 1, c, 0) (c, 1, c, 1)grasp

Page 12: AND/OR Graph Search - Wikimedia · 5A AND/OR Graph 3 Young Won Lim 14년 10월 27일 Hanoi Tower – Problem Reduction (1 1 1) B A C 1 2 3 1 2 3 B A C 1 2 3 B A C (1 2 2) (3 2 2)

5A AND/OR Graph 12 Young Won Lim14년 10월 27일

Finding Key Operator (1)

(A, 0, B, 0) (C, 1, C, 1)

difference: The monkey does not have bananas.

(A, 0, B, 0) (C, 1, C, 1)(C, 1, C, 0)

difference: 1. The box is not at the location C. 2. The monkey is not at the location C. 3. The monkey is not on the box.

pushbox(C)goto(C)climbbox

P1

P2

grasp

Page 13: AND/OR Graph Search - Wikimedia · 5A AND/OR Graph 3 Young Won Lim 14년 10월 27일 Hanoi Tower – Problem Reduction (1 1 1) B A C 1 2 3 1 2 3 B A C 1 2 3 B A C (1 2 2) (3 2 2)

5A AND/OR Graph 13 Young Won Lim14년 10월 27일

Finding Key Operator (2)

(A, 0, B, 0) (C, 1, C, 1)(C, 1, C, 0)

difference: 1. The box is not at the location C. 2. The monkey is not at the location C. 3. The monkey is not on the box.

pushbox(C)goto(C)climbbox

precondition: w = y, x = 0

(A, 0, B, 0)(B, 0, B, 0)

(B, 0, B, 0) (C, 0, C, 0) (C, 1, C, 0)

(C, 1, C, 1)

P11

P12

P13

Page 14: AND/OR Graph Search - Wikimedia · 5A AND/OR Graph 3 Young Won Lim 14년 10월 27일 Hanoi Tower – Problem Reduction (1 1 1) B A C 1 2 3 1 2 3 B A C 1 2 3 B A C (1 2 2) (3 2 2)

Young Won Lim14년 10월 27일

References

[1] http://en.wikipedia.org/[2] 인공지능개론, 이광형, 조충호, 홍릉과학출판사, 2000