Pattern Databases Robert Holte University of Alberta November 6, 2002.
-
date post
21-Dec-2015 -
Category
Documents
-
view
217 -
download
0
Transcript of Pattern Databases Robert Holte University of Alberta November 6, 2002.
![Page 1: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/1.jpg)
Pattern Databases
Robert Holte
University of Alberta
November 6, 2002
![Page 2: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/2.jpg)
Pattern Database Successes (1)Joe Culberson & Jonathan Schaeffer (1994).
– 15-puzzle (1013 states).
– 2 hand-crafted patterns (“fringe” (FR) and “corner” (CO))
– Each PDB contains over 500 million entries (< 109 abstract states).
– Used symmetries to compress and enhance the use of PDBs– Used in conjunction with Manhattan Distance (MD)
Reduction in size of search tree:– MD = 346 * max(MD,FR)– MD = 437 * max(MD,CO)– MD = 1038 * max(MD, interleave(FR,CO))
![Page 3: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/3.jpg)
Pattern Database Successes (2)
Rich Korf (1997)– Rubik’s Cube (1019 states).
– 3 hand-crafted patterns, all used together (max)
– Each PDB contains over 42 million entries
– took 1 hour to build all the PDBs
Results:– First time random instances had been solved optimally
– Hardest (solution length 18) took 17 days
– Best known MD-like heuristic would have taken a century
![Page 4: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/4.jpg)
Pattern Database Successes (3)
Stefan Edelkamp (2001)– Planning benchmarks: e.g. logistics, Blocks world– Automatically generated PDBs (not domain abstraction)
– Additive pattern databases (in some cases)
Results:– PDB competitive with the best planners– logistics domain (weighted A*), PDB run-time 100
times smaller than FF heuristic
![Page 5: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/5.jpg)
Pattern Database Successes (4) Istvan Hernadvolgyi (2001)
– Macro-operators are concatenated to very quickly construct suboptimal solutions
– For Rubik’s Cube hundreds of macro-operators are needed– Each macro is found by searching in the Rubik’s Cube state
space with a macro-specific “subgoal” and start state– For every one of these searches, a PDB was generated
automatically (domain abstraction) so that an optimal-length macro could be found quickly
Results:– Optimal-length macros for all subgoals found for the first time– So quick that it permitted subgoals to be merged– This shortened solutions from 90 moves to 50 (optimal is ~18)
![Page 6: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/6.jpg)
Fundamental Questions
How to invent effective heuristics ?
How to use memory to speed up search ?
Create a simplified version of your problem.Use the exact distances in the simplified version as heuristic estimates in the original.
Precompute all distances-to-goal in the simplifiedversion of the problem and store them in alookup table (pattern database).
![Page 7: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/7.jpg)
Example: 8-puzzle
1 2
3 4 5
6 7 8
Domain = blank 1 2 3 4 5 6 7 8
181,440 states
![Page 8: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/8.jpg)
“Patterns”created by domain mapping
1 2
3 4 5
6 7 8
This mapping produces9 patterns
Domain = blank 1 2 3 4 5 6 7 8Abstract = blank
corresponding patternoriginal state
![Page 9: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/9.jpg)
Pattern Database
Pattern
Distance to goal 0 1 1 2 2 2
Pattern
Distance to goal 3 3 4
![Page 10: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/10.jpg)
Calculating h(s)
Given a state in the original problem
Compute the corresponding pattern
and look up the abstract distance-to-goal
8 1 4
3 5
6 7 2
2
Heuristics defined by PDBs are consistent, not just admissible.
![Page 11: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/11.jpg)
Abstract Space
![Page 12: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/12.jpg)
Efficiency
Time for the preprocessing to create a PDB is usually negligible compared to the time to solve one problem-instance with no heuristic.
Memory is the limiting factor.
![Page 13: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/13.jpg)
“Pattern” = leave some tiles unique
1 2
3 4 5
6 7 8 6 7 8
3024 patternsDomain = blank 1 2 3 4 5 6 7 8Abstract = blank 6 7 8
![Page 14: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/14.jpg)
Domain Abstraction
1 2
3 4 5
6 7 8 6 7 8
30,240 patternsDomain = blank 1 2 3 4 5 6 7 8Abstract = blank 6 7 8
![Page 15: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/15.jpg)
8-puzzle PDB sizes(with the blank left unique)
9 72 252 504 630 1512 2520 3024 3780 5040 75601008015120
15120 22680 30240 45360 60480 90720181440
![Page 16: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/16.jpg)
Automatic Creation of Domain Abstractions
• Easy to enumerate all possible domain abstractions
• They form a lattice, e.g.
is “more abstract” than the domain abstraction above
Domain = blank 1 2 3 4 5 6 7 8Abstract = blank
Domain = blank 1 2 3 4 5 6 7 8Abstract = blank
![Page 17: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/17.jpg)
Problem: Non-surjectivity
1 2
1 2
1 2
![Page 18: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/18.jpg)
Problem: Non-surjectivity
1 2
1 2
1 2
Domain = blank 1 2 Abstract = blank 1 blank
![Page 19: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/19.jpg)
Problem: Non-surjectivity
1 2
1 2
1 2
1
Domain = blank 1 2 Abstract = blank 1 blank
![Page 20: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/20.jpg)
Problem: Non-surjectivity
1 2
1 2
1 2
1
1
Domain = blank 1 2 Abstract = blank 1 blank
![Page 21: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/21.jpg)
Problem: Non-surjectivity
??
1 2
1 2
1 2
1
1
1
Domain = blank 1 2 Abstract = blank 1 blank
![Page 22: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/22.jpg)
Pattern Database ExperimentsAim:
To understand how search performance using PDBs is related to easily measurable characteristics of the PDBs
e.g. size, average value
Basic Method:• Choose a variety of state spaces.• For each state space generate thousands of PDBs.• For each PDB, measure its characteristics and the
performance of A* (IDA* etc.) using it.
![Page 23: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/23.jpg)
8-puzzle: A* vs. PDB size#
node
s ex
pand
ed (
A*)
pattern database size (# of abstract states)
![Page 24: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/24.jpg)
Korf & Reid (1998)
• When the depth bound is d, node n at level j will be expanded by IDA* iff [a] parent(n) was expanded
[b] g(n)+h(n) d, in other words h(n) d-j
• [b] [a] if the heuristic is consistent
• Total nodes expanded = N(j)*P(j,d-j)– N(j) = # nodes at level j in the brute-force tree– P(j,x) = percentage of nodes at level j with h() x
![Page 25: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/25.jpg)
Korf & Reid – experiment
In their 8-puzzle experiment: – Use exact N(j)– Approximate P(j,x) by EQ(x) = limit (j) P(j,x)– IDA*, but complete enumeration of last level– Run all 181,400 start states to all depths
![Page 26: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/26.jpg)
Korf & Reid – results
Seems the ideal tool for choosing which of two PDBs is better…
d prediction avg. error
(all states)
20 376.9 -0.3
21 631.3 -1.4
22 1146.1 -0.4
23 1918.8 -2.7
![Page 27: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/27.jpg)
Korf & Reid – stopping at goald prediction avg. error
(all states)
avg. error
(states d )
20 376.9 -0.3 406
21 631.3 -1.4 500
22 1146.1 -0.4 664
23 1918.8 -2.7 758
For choosing which of two PDBs is better in a practical setting, adaptations are needed.
![Page 28: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/28.jpg)
Using Multiple Abstractions
• Given 2 consistent heuristics, max(h1(s),h2(s)) is also consistent.
• In some circumstances, can add them.
• How good is max ?– hope it is at least 2x because it takes 2x the space
![Page 29: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/29.jpg)
Max of 2 random PDBs
max(h1,h2) worse than h1
![Page 30: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/30.jpg)
Instead of max - interleaveuse
PDB1
usePDB
1
usePDB
1
usePDB
1
usePDB
1
usePDB
1
usePDB
1
usePDB
1
usePDB
1
usePDB
1
usePDB
2
usePDB
2
usePDB
2
usePDB
2
usePDB
2
usePDB
2
usePDB
2
usePDB
2
![Page 31: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/31.jpg)
Interleaved Pattern Databases
• The hope: almost as good as max, but only half the memory.
• Intuitively, strict alternation between PDBs expected to be almost as good as max.
• How to generalize this to any abstraction of any space ?
![Page 32: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/32.jpg)
2 random PDBs interleaved
• 93 random pairs (with non-trivial LCA)
• 4 had Max(h1,h2) > h1
• 17 others had Interleave(h1,h2) > h1
• The remaining 72 were “normal”
Max Interleave h1
![Page 33: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/33.jpg)
Relative Performance
Max Interleave h1
![Page 34: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/34.jpg)
Current Research
• Istvan Hernadvolgyi (Ph.D. student, U. Ottawa)– automatic creation of good pattern databases– adaptation to weighted graphs
Project Students (U of A)• Jack Newton
– max of two pattern databases– interleaved pattern databases
• Daniel Neilson - additive abstractions• Ajit Singh – predicting IDA* performance
![Page 35: Pattern Databases Robert Holte University of Alberta November 6, 2002.](https://reader030.fdocuments.in/reader030/viewer/2022033105/56649d625503460f94a4476e/html5/thumbnails/35.jpg)
Future Research
• compression of pattern databases
• understand & avoid non-surjectivity
• alternative methods of abstraction• projection