Top Banner
Searching for Macro- operators with Automatically Generated Heuristics István T. Hernádvölgyi University of Ottawa [email protected]
53

Searching for Macro-operators with Automatically Generated Heuristics

Dec 30, 2015

Download

Documents

Searching for Macro-operators with Automatically Generated Heuristics. Istv á n T. Hern á dv ö lgyi University of Ottawa [email protected]. Motivation. Time. 1 week. Korf 97. us. Korf 85. Sims 70, Osterlund 95. 1 sec. 50. 85. 455. 18. Quality. Subgoals and Macros. 1. 2. 3. - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Searching for Macro-operators with Automatically Generated Heuristics

Searching for Macro-operators with Automatically Generated Heuristics

István T. Hernádvölgyi

University of Ottawa

[email protected]

Page 2: Searching for Macro-operators with Automatically Generated Heuristics

Motivation

Time

Quality

1 sec

1 week

18 85

Korf 97

Korf 85

50 455

Sims 70, Osterlund 95us

Page 3: Searching for Macro-operators with Automatically Generated Heuristics

Subgoals and Macros

1 2 3 4 5

o1

o2

o3

o4

Page 4: Searching for Macro-operators with Automatically Generated Heuristics

1 2 3 4 5

Page 5: Searching for Macro-operators with Automatically Generated Heuristics

1

2

3

4

1

1

1

2

2 3

1 2 3 4 5

Page 6: Searching for Macro-operators with Automatically Generated Heuristics

1

1

1

1

1

2

2

2

2

3

3

3

4

4

1

1

1

1

1

1

1

1

1

2

2

2

2

2

3

3

1 2 3 4 5

Page 7: Searching for Macro-operators with Automatically Generated Heuristics

1

1

1

1

1

2

2

2

2

3

3

3

4

4

1

1

1

1

1

1

1

1

1

2

2

2

2

2

3

3

{}

{o1}

{o2}

{o3}

{o4}

{}

{o2,o1,o2}

{o3,o2,o3}

{o4,o3,o4}

{o3,o1,o3}

{}

{o4,o2,o4}

{}

{o4,o1,o4}

1 2 3 4 5

Page 8: Searching for Macro-operators with Automatically Generated Heuristics

1

1

1

1

1

2

2

2

2

3

3

3

4

4

1

1

1

1

1

1

1

1

1

2

2

2

2

2

3

3

{}

{o1}

{o2}

{o3}

{o4}

{}

{o2,o1,o2}

{o3,o2,o3}

{o4,o3,o4}

{o3,o1,o3}

{}

{o4,o2,o4}

{}

{o4,o1,o4}

4 1 2 5 3

Page 9: Searching for Macro-operators with Automatically Generated Heuristics

1

1

1

1

1

2

2

2

2

3

3

3

4

4

1

1

1

1

1

1

1

1

1

2

2

2

2

2

3

3

{}

{o1}

{o2}

{o3}

{o4}

{}

{o2,o1,o2}

{o3,o2,o3}

{o4,o3,o4}

{o3,o1,o3}

{}

{o4,o2,o4}

{}

{o4,o1,o4}

4 1 2 5 3

{o1}

Page 10: Searching for Macro-operators with Automatically Generated Heuristics

1

1

1

1

1

2

2

2

2

3

3

3

4

4

1

1

1

1

1

1

1

1

1

2

2

2

2

2

3

3

{}

{o1}

{o2}

{o3}

{o4}

{}

{o2,o1,o2}

{o3,o2,o3}

{o4,o3,o4}

{o3,o1,o3}

{}

{o4,o2,o4}

{}

{o4,o1,o4}

1 4 2 5 3

{o1,o2,o1,o2}

Page 11: Searching for Macro-operators with Automatically Generated Heuristics

1

1

1

1

1

2

2

2

2

3

3

3

4

4

1

1

1

1

1

1

1

1

1

2

2

2

2

2

3

3

{}

{o1}

{o2}

{o3}

{o4}

{}

{o2,o1,o2}

{o3,o2,o3}

{o4,o3,o4}

{o3,o1,o3}

{}

{o4,o2,o4}

{}

{o4,o1,o4}

1 2 4 5 3

{o1,o2,o1,o2,o4,o2,o4}

Page 12: Searching for Macro-operators with Automatically Generated Heuristics

1

1

1

1

1

2

2

2

2

3

3

3

4

4

1

1

1

1

1

1

1

1

1

2

2

2

2

2

3

3

{}

{o1}

{o2}

{o3}

{o4}

{}

{o2,o1,o2}

{o3,o2,o3}

{o4,o3,o4}

{o3,o1,o3}

{}

{o4,o2,o4}

{}

{o4,o1,o4}

1 2 3 5 4

{o1,o2,o1,o2,o4,o2,o4,o4,o1,o4} {o1,o2,o1,o2,o4,o2,o1,o4} {o2,o4,o3,o2}

Page 13: Searching for Macro-operators with Automatically Generated Heuristics

2

2

2

2

3

3

3

1

1

1

1

1

1

1

2

2

2

{}

{o2,o1,o2}

{o3,o2,o3}

{o4,o3,o4}

{o3,o1,o3}

{}

{o4,o2,o4}

Page 14: Searching for Macro-operators with Automatically Generated Heuristics

2 31 {}

2 31

2 31

231

2 31

2 31

231

231

2 31

231

231

231

{o3,o1,o3}

{o4,o2,o4}

{o1,o2,o1}

{o1,o3,o2}

{o1,o4,o1,o3}

{o2,o3,o1}

{o3,o2,o3}

{o2,o4,o2}

{o3,o4,o1}

{o2,o3,o4,o2,o3}

{o4,o3,o4}

Page 15: Searching for Macro-operators with Automatically Generated Heuristics
Page 16: Searching for Macro-operators with Automatically Generated Heuristics

Results

Page 17: Searching for Macro-operators with Automatically Generated Heuristics

The cost of merging subgoals

#macros avg/max length

States expanded to build table

Time to solve 10,000 problems

18 subgoals 258 5.6 / 13 108 million

(1 hour)

6 subgoals

(8,3,2,2,1)

2902

+ 96 million

9.7 / 13 ?

Page 18: Searching for Macro-operators with Automatically Generated Heuristics

Solution: use heuristics to speed up search for each macro

• For each subgoal, create a heuristic specifically for that subgoal

• Can combine this with the heuristic for the previous subgoal (because that subgoal is a subset of the current subgoal)

• Need to create these automatically, they are unintuitive spaces and the heuristics are “throw away”

Page 19: Searching for Macro-operators with Automatically Generated Heuristics

Previous WorkAutomatically Generated Heuristics• Absolver [Prieditis90]• Pattern Database [CulbersonSchaeffer96]

– 15 Puzzle, “don’t care tiles”, Rubik’s Cube [Korf97]

– Domain Abstraction [HolteHernadvolgyi99]

– Planning (Strips) [Edelkamp2000]

h s H s( ) [ ' ]

: , | | | |D D D D1 2 1 2

Page 20: Searching for Macro-operators with Automatically Generated Heuristics

Pattern Database

1 2 3

4 5 6

7 8

1 2 3

6

181,440 15,120

Page 21: Searching for Macro-operators with Automatically Generated Heuristics

Pattern Database

6 3 4

8 7 5

12

6 3

12

Page 22: Searching for Macro-operators with Automatically Generated Heuristics

Domain Abstraction

1 2 3

4 5 6

7 8

181,440 5,040

Page 23: Searching for Macro-operators with Automatically Generated Heuristics

Rubik’s Cube

ULF UF URF

LF RF

DLF DF DRF

F

DL DR

DLB DB DRB

D

ULB UB URB

UL URU

ULB UL

LB

DLB DL

L

UR URB

RB

DR DRB

R

UB ULB

LB

DB DLB

B

Page 24: Searching for Macro-operators with Automatically Generated Heuristics

State Representation

URFURF

URBURB

ULBULB

ULFULF

DRFDRF

DRBDRB

DLBDLB

DLFDLF

UFUF

ULUL

URUR

UBUB

LFLF

LBLB

DLDL

RFRF

RBRB

DFDF

DBDB

DRDR

0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 0 0 0

DRFURF

ULBURB

ULFULB

DLBULF

DLFDRF

DRFDRB

URBDLB

DRBDLF

DLUF

URUL

RBUR

LBUB

LBLF

LFLB

UFDL

DRRF

ULRB

DFDF

DBDB

RFDR

2 0 1 0 1 0 2 0

0 1 0 0 0 0 1 1 0 0 0 1

Goal state (subscripts indicate orientation)

Typical start state

Page 25: Searching for Macro-operators with Automatically Generated Heuristics

Macro Search Space

URFURF

URBURB

ULBULB

ULFULF DRF DRB DLB DLF

UFUF

ULUL

URUR

UBUB

LFLF

LBLB

DLDL

RF RBDF DB DR

0 0 0 0

0 0 0 0 0 0 0 0 0

* * * *

* * *R F R B

URFURF

URBURB

ULBULB

ULFULF DRF DRB DLB DLF

UFUF

ULUL

URUR

UBUB

LFLF

LBLB

DLDL

RBDF DB

RFDR

0 0 0 0

0 0 0 0 0 0 0 1 0

* * * *

* * *R F R B

Goal state for the subgoal “fix RF and RB”

Typical start state for this subgoal

Page 26: Searching for Macro-operators with Automatically Generated Heuristics

Domain Abstraction

• “don’t care” about a cubie’s orientation

• Make 2 (or more) cubies indistinguishable from each other

• Continue to add abstractions until the abstract space is sufficiently small (2 million entries)

Page 27: Searching for Macro-operators with Automatically Generated Heuristics

Abstraction Example

AURF

AURB

BULB

BULF DRF DRB DLB DLF

CUF

CUL

CUR

CUB

DLF

DLB

DDL

RF RBDF DB DR

x x

x x x x x x x

0 0

0 0

* * * *

* * *R F R B

AURF

AURB

BULB

BULF DRF DRB DLB DLF

CUF

CUL

CUR

CUB

DLF

DLB

DDL

RBDF DB

RFDR

x x

x x x x x x x

0 0

1 0

* * * *

* * *R F R B

Abstracted goal state (x = orientation doesn’t matter)

Abstracted start state (typical)

Page 28: Searching for Macro-operators with Automatically Generated Heuristics

The cost of merging subgoals

#macros avg/max length

States expanded to build table

18 subgoals 258 5.6 / 13 108 million

(1 hour)

6 subgoals

(8,3,2,2,1)

2902

+ 96 million

9.7 / 13 2 billion + 250,000/problem

(27 hours + 1 second/problem)

Page 29: Searching for Macro-operators with Automatically Generated Heuristics

Contributions

• Automatically Generated Heuristics for Finding Macro-operators

• Merging Subgoals to Obtain Shorter Solutions

• 44% Improvement for Rubik’s Cube

• Method is General and Mostly Automatic

Page 30: Searching for Macro-operators with Automatically Generated Heuristics

Using Symmetries

Page 31: Searching for Macro-operators with Automatically Generated Heuristics

Using SymmetriesURF, URB,ULB,ULF,UF,UL,UR,UB

LF,LB,DL

RF,RB

DF,DB (> DR)

DRF,DRB

DLF (>DLB)

LF,RF,DR RF,RB,DR LB,RB,DL

DLF, DLB

DRF (> DRB)

LF,RB LF,LBLF, RF

Page 32: Searching for Macro-operators with Automatically Generated Heuristics

Kociemba’s Two-phase Algorithm

U D R L F B, , , , ,2 2 2 2

x y z x C y E z UDo o, , , , C

E

UD

o

o

: ,

: ,

:

C o rn e r O rien ta tio n s 3

E d g e O rien ta tio n s

U D slice d g es

7

2 1 8 7

2 2 0 4 8

1 2

44 9 5

11

x y x x C y E z EUD face UD slice, , , ,

h h x y h x z h y zm ax ( * ( , ) , * ( , ) , * ( , ))

Page 33: Searching for Macro-operators with Automatically Generated Heuristics

Open Questions

• Do the improvements carry over to other spaces?

• Does the order of the subgoals matter?

Page 34: Searching for Macro-operators with Automatically Generated Heuristics
Page 35: Searching for Macro-operators with Automatically Generated Heuristics
Page 36: Searching for Macro-operators with Automatically Generated Heuristics
Page 37: Searching for Macro-operators with Automatically Generated Heuristics
Page 38: Searching for Macro-operators with Automatically Generated Heuristics
Page 39: Searching for Macro-operators with Automatically Generated Heuristics
Page 40: Searching for Macro-operators with Automatically Generated Heuristics
Page 41: Searching for Macro-operators with Automatically Generated Heuristics
Page 42: Searching for Macro-operators with Automatically Generated Heuristics
Page 43: Searching for Macro-operators with Automatically Generated Heuristics
Page 44: Searching for Macro-operators with Automatically Generated Heuristics

Motivation

4 3 1 01 9.

4 3 2 5 2 0 0 3 2 7 4 4 8 9 8 5 6 0 0 0, , , , , ,

Page 45: Searching for Macro-operators with Automatically Generated Heuristics

Motivation

Time

Quality

1 sec

1 week

18 85

Korf 97

Korf 85Kociemba 92

50

Kloosterman 90 Thistlethwaite 80

455

Sims 70, Osterlund 95

human

Page 46: Searching for Macro-operators with Automatically Generated Heuristics

Merging Consecutive Subgoals

, ( , , . . . , ) ( ) , ( , ) , . . . , ( , , . . . , )f 1 2 1 1 2 1 2 1 2k k kf f f

f ( , , . . . , ) ( , , . . . , ) , . . . , ( , , . . . , ) , 1 2 1 1 2 1k i l j j kg g l k

g f f fi i j i i i i i j i i j( , , . . . , ) ( ) ( , ) .. . ( , , . . . , ) 1 1 1 1

g mi i j i i j( , , . . . , ) ( , , . . . , ) 1 1

Serial Decomposability [Korf83]

Idea:

Page 47: Searching for Macro-operators with Automatically Generated Heuristics
Page 48: Searching for Macro-operators with Automatically Generated Heuristics
Page 49: Searching for Macro-operators with Automatically Generated Heuristics
Page 50: Searching for Macro-operators with Automatically Generated Heuristics

Previous WorkMacro-Operators

• Stabilizer Chain [Sims70, Osterlund95]

• Bi-directional Partial-Match [Korf85]

S tab G G GG k k( , , . . . , ) . . ., , ,..., 1 2 1 1 2 1 2

1

Page 51: Searching for Macro-operators with Automatically Generated Heuristics

Domain Abstraction1. select two invariant cubies: c1 and c22. toss coin3. if (heads) // mask orientations4. if (both orientations masked)5. goto 16. mask orientations of c1 and c27. else // mask cubie identity8. if (mask(c1) == mask(c2) goto 19. select new mask A10. if (!masked(c1) && !masked(c2))11. c1 := A, c2 := A12. else if (masked(c1) && !masked(c2))13. all cubies with mask(c1) and c2 := A14. else if (!masked(c1) && masked(c2))15. all cubies with mask(c2) and c1 := A16. else // both has a mask17. cubies with mask(c1) and mask(c2) := A18. H := expand(N)19. if (H == 0) goto 120. return H

Page 52: Searching for Macro-operators with Automatically Generated Heuristics

Search

• IDA* [Korf85]

• Maximum of 3 pattern databases (5M entries)

• 18 subgoals

• 6 subgoals

• 10,000 random instances

URF URB ULB ULF UF UL UR UB

LF LB DL RF RB DF DB DR

DRF DRB DLF DLB

, , , , , , , ,

, , , , , , , ( ) ,

, , , ( )

{ , , , , , , , } ,

{ , , } ,{ , } ,{ , , ( )} ,

{ , } ,{ , ( )}

URF URB ULB ULF UF UL UR UB

LF LB DL RF RB DF DB DR

DRF DRB DLF DLB

Page 53: Searching for Macro-operators with Automatically Generated Heuristics

Statistics