14
Dynamic State-Space Partitioning in External- Memory Graph Search Rong Zhou and Eric A. Hansen Palo Alto Research Center Mississippi State University

Dynamic State-Space Partitioning in External-Memory Graph Search Rong Zhou † and Eric A. Hansen ‡ † Palo Alto Research Center ‡ Mississippi State University

Embed Size (px)

Citation preview

Page 1: Dynamic State-Space Partitioning in External-Memory Graph Search Rong Zhou † and Eric A. Hansen ‡ † Palo Alto Research Center ‡ Mississippi State University

Dynamic State-Space Partitioning in External-Memory Graph Search

Rong Zhou† and Eric A. Hansen‡

†Palo Alto Research Center‡Mississippi State University

Page 2: Dynamic State-Space Partitioning in External-Memory Graph Search Rong Zhou † and Eric A. Hansen ‡ † Palo Alto Research Center ‡ Mississippi State University

External-memory graph search

Internal memory vs. External memory

1 ~ 4 GB 160 GB ~ 1.5 TB External memory is cheap and almost inexhaustible But random access of external memory (e.g., for

duplicate detection) is 105 ~ 106 times slower than internal memory

Page 3: Dynamic State-Space Partitioning in External-Memory Graph Search Rong Zhou † and Eric A. Hansen ‡ † Palo Alto Research Center ‡ Mississippi State University

Previous work

Hash-based delayed duplicate detection [Korf & Schultze AAAI-05; Korf JACM-08]

Structured duplicate detection [Zhou & Hansen AAAI-04, 06]

Both use state-space abstraction to … partition nodes into buckets or disk files leverage graph local structure to save RAM

or disk space

Page 4: Dynamic State-Space Partitioning in External-Memory Graph Search Rong Zhou † and Eric A. Hansen ‡ † Palo Alto Research Center ‡ Mississippi State University

Structured duplicate detection [Zhou & Hansen AAAI-04]

Localizes memory references in duplicate detection by exploiting graph structure revealed by a state-space projection function

Example of projection function

0 1 15blank pos. =

??? ??

?

??

? ? ?? ? ? ?

??? ???

??

? ? ?? ? ? ?

??? ??

?

??

? ? ?? ? ?

?

Page 5: Dynamic State-Space Partitioning in External-Memory Graph Search Rong Zhou † and Eric A. Hansen ‡ † Palo Alto Research Center ‡ Mississippi State University

Abstract state-space graph

Created by state-space projection function

ExampleB0 B3B1 B2

B8

B4 B5 B6 B7

16 abstract states> 10 trillion states

31

4 65

2

8

7

9 10 11

12 13 14 15

B9 B10 B11

B12 B13 B14 B15

Page 6: Dynamic State-Space Partitioning in External-Memory Graph Search Rong Zhou † and Eric A. Hansen ‡ † Palo Alto Research Center ‡ Mississippi State University

Duplicate-detection scope

A set of blocks (of stored nodes) that is guaranteed to contain all stored successor nodes of the currently-expanding node

B1B0 B4

B0 B3B1 B2

B8

B4 B5 B6 B7

B9 B10 B11

B12 B13 B14 B15

B0 B1

B4

B3B2

B8

B5 B6 B7

B9 B10 B11

B12 B13 B14 B15

B2 B3 B5

B6 B7 B8

B15B14…

Page 7: Dynamic State-Space Partitioning in External-Memory Graph Search Rong Zhou † and Eric A. Hansen ‡ † Palo Alto Research Center ‡ Mississippi State University

Edge Partitioning

Reduces duplicate-detection scope to one block of stored nodes – Guaranteed!

B1

B0 B3B1 B2

B8

B4 B5 B6 B7

B9 B10 B11

B12 B13 B14 B15

B1B0 B3B2

B8

B5 B6 B7

B9 B10 B11

B12 B13 B14 B15

B4

B2 B3 B5

B6 B7 B8

B15B14

B0 B4

B3B2

B8

B5 B6 B7

B9 B10 B11

B12 B13 B14 B15

B4

B1B0

B4

B1

B4

Page 8: Dynamic State-Space Partitioning in External-Memory Graph Search Rong Zhou † and Eric A. Hansen ‡ † Palo Alto Research Center ‡ Mississippi State University

What is a good abstraction?

Capture local structure DDD: Interleaving expansion and merging SDD: Fewer incremental expansions

Distribute nodes evenly into buckets Make sure largest bucket fits in RAM Not too many buckets

Achieving both is challenging, especially for static abstraction

Page 9: Dynamic State-Space Partitioning in External-Memory Graph Search Rong Zhou † and Eric A. Hansen ‡ † Palo Alto Research Center ‡ Mississippi State University

A pathological example

Degenerative state-space projection function 3

1

4 65

2

8 7

9 10 11

12 13 14 15

31

4 65

2

8

7

9 10 11

12 13 14 15

3

1

4 65

2

8 7

9 10 11

12 13 14 15

31

4 65

2

8

7

9 10 11

12 13 14 15

In theory, there are 518,918,400 buckets.

Start Goal

But most (> 99.99%) of them are empty!

Page 10: Dynamic State-Space Partitioning in External-Memory Graph Search Rong Zhou † and Eric A. Hansen ‡ † Palo Alto Research Center ‡ Mississippi State University

Greedy abstraction algorithm

Starts with a “blank” abstraction Mark all state variables as unselected While ( size of abstract graph M )

Find an unselected variable Vi s.t. adding it to current abstraction minimizes largest bucket size

Add Vi into set of abstraction variables Mark Vi as selected Update current abstraction

Move nodes to their new buckets

Page 11: Dynamic State-Space Partitioning in External-Memory Graph Search Rong Zhou † and Eric A. Hansen ‡ † Palo Alto Research Center ‡ Mississippi State University

Example

Node X Y Z

a 1 4 6

b 1 5 6

c 2 4 6

d 2 5 6

e 3 4 7

f 3 5 7

Vars Values States

{X}

{X = 1} {a, b}

{X = 2} {c, d}

{X = 3} {e, f}

{Y}{Y = 4} {a, c, e}

{Y = 5} {b, d, f}

{Z}{Z = 6}

{a, b, c, d}

{Z = 7} {e, f}

Vars Values States

{X,Y}{X = 1, Y =

4} {a}

 {X = 1, Y =

5} {b}

 {X = 2, Y =

4} {c}

 {X = 2, Y =

5} {d}

 {X = 3, Y =

4} {e}

 {X = 3, Y =

5} {f}

{X,Z}{X = 1, Z =

6} {a,b}

 {X = 1, Z =

7}

 {X = 2, Z =

6} {c, d}

 {X = 2, Z =

7}

 {X = 3, Z =

6}

 {X = 3, Z =

7} {e, f}

Nodes 1st Iteration 2nd Iteration

Page 12: Dynamic State-Space Partitioning in External-Memory Graph Search Rong Zhou † and Eric A. Hansen ‡ † Palo Alto Research Center ‡ Mississippi State University

Computational results Planning results on 15 Puzzle

First planner to optimally solve all 100 of Korf’s 15 Puzzle instances (93 for previous best solver)

<20 MB of RAM for the hardest instance #88 (static partitioning needs >5x RAM for #88)

Uses only Manhattan-Distance heuristic STRIPS planning (6 domains from IPC)

Peak RAM reduced by up to ~19x Better time-space tradeoff Improves with accuracy of heuristic

function

Page 13: Dynamic State-Space Partitioning in External-Memory Graph Search Rong Zhou † and Eric A. Hansen ‡ † Palo Alto Research Center ‡ Mississippi State University

Bucket size histogram for instance #88

Page 14: Dynamic State-Space Partitioning in External-Memory Graph Search Rong Zhou † and Eric A. Hansen ‡ † Palo Alto Research Center ‡ Mississippi State University

Conclusion and future work

Not all abstractions are created equal – even for the ones with the same resolution! Largest bucket depends on starting state Static abstraction ineffective for heuristic

search Future work

Sampling approach Parallel search