# compressing pattern databases

Post on 13-Jan-2016

26 views

Embed Size (px)

DESCRIPTION

Compressing Pattern Databases. Ariel Felner Bar-Ilan University. felner@cs.biu.ac.il March 2004 Joint work with Ram Meshulam, Robert Holte and Richard E. Korf Submitted to AAAI04. Available at: http://www.cs.biu.ac.il/~felner. A* and its variants. - PowerPoint PPT PresentationTRANSCRIPT

Compressing Pattern Databases Ariel FelnerBar-Ilan University.felner@cs.biu.ac.il

March 2004Joint work with Ram Meshulam, Robert Holte and Richard E. KorfSubmitted to AAAI04.Available at: http://www.cs.biu.ac.il/~felner

A* and its variantsA* (and IDA*) is a best-first search algorithm that uses f(n)=g(n)+h(n) as its cost function. Nodes are sorted in an open-list according to their f-value. g(n) is the shortest known path between the initial node and the current node n.h(n) is an admissible (lower bound) heuristic estimation from n to the goal nodeRecently, the attention has shifted towards creating more accurate heuristic functions.

Pattern databasesMany problems can be decomposed into subproblems (patterns) that must be also solved.The pattern space is a domain abstraction of the original spaceThe cost of a solution to a subproblem is a lower-bound on the cost of the complete solution Instead of calculating the lower bounds on the fly, we expand the whole pattern-space and store the solution to each pattern configuration in a pattern databasePatternspaceSearch space Mapping function

Non-additive pattern databasesFringe database for the 15 puzzle by [Culberson and Schaeffer 1996]. Stores the number of moves including tiles not in the pattern

Rubiks Cube. [Korf 1997]The best way to combine different non-additive pattern databases is to take their maximum!

Additive pattern databasesWe can add values from different pattern databases if they are disjoint (and count their own moves)There are two ways to build additive databases: Statically-partitioned additive databases (they were also called disjoint pattern databases) Dynamically-partitioned additive databases.Applications of additive pattern databases Tile puzzles 4-peg Towers of Hanoi Puzzle (TOH4)

Statically-partitioned additive databasesThese were created for the 15 and 24 puzzles [Korf & Felner 2002]We statically partition the tiles into disjoint patterns and compute the cost of moving only these tiles into their goal states.

For the 15 puzzle: 36,710 nodes. 0.027 seconds.575 MB

For the 24 puzzle: 360,892,479,6712 days242 MB

786666

4-peg Towers of Hanoi (TOH4)There is a conjecture about the length of optimal path but it was not proven.Systematic search is the only way to solve this problem or to verify the conjecture.There are too many cycles. IDA* as a DFS will not prune these cycle. Therefore, A* (actually frontier A* [Korf & Zhang 2000]) was used.

Additive PDBS for TOH4Partition the disks into disjoint sets (patterns) . For example, 10 and 6 for the 16-disk problem.Store the cost of the complete pattern space of each set in a pattern database. (There are many enhancements)The n-disk problem contains 4^n states and 2n bits suffice to store each state.The largest databases that we stored was of size 14 which needed 4^14=256MB.

TOH4: results

How to best use the memoryThe speed of the search is directly related to the size of the pattern database.We usually omit the computation time of the PDBs but cannot ignore the memory requirements[Holte, Newton, Felner, Mushulam and Furcy 2004] showed that it is better to use many small databases and take their maximum instead of one large database.We limit the discussion to 1 Giga bytes.

Compressing pattern databasesTraditionally, each configuration of the pattern had a unique entry in the PDB.Our main cliam Nearby entries in PDBs are highly correlated !!We propose to compress nearby entries by storing their minimum in one entry.We show that most of the knowledge is preservedConsequences: Memory is saved, larger patterns cab be used speedup in search is obtained.

Cliques in the pattern spaceThe values in a PDB for a clique are d or d+1In permutation puzzles cliques exist when only one object moves to another location. Usually they have nearby entries in the PDBGddd+1

A B

C

D D

A B

C D

Storing cliquesAssume a clique of size K with values d or d+1Lossy compression Store only one entry for the clique with the minimum d. Loose at most 1. Lossless compression Store the minimum d. Also store K additional bits, one per entry.

A clique in TOH4

Compressing PDBs in TOH4If we compress the last index of smallest disk then a PDB with P disks can now be stored in only 4^(P-1) entries instead of 4^PThis can be generalized to a set of nodes with diameter D. (for cliques D=1)For TOH4, we fix the position of the largest P-2 disks and compress all the 4^2=16 entries of the smallest 2 disks. In general, compressing any block will work, not necessarily cliques.

TOH4 results: 16 disks (14+2)

Memory was reduced by a factor of 1000!!! at a cost of only a factor of 2 in the search effort.Lossless compressing is not efficient in this domain.

TOH4: larger versionsMemory was reduced by a factor of 1000!!! At a cost of only a factor of 2 in the search effort.Lossless compressing is noe efficient in this domain.For the 17 disks problem a speed up of 3 orders of magnitude is obtained!!!The 18 disks problem can be solved in 5 minutes!!

Tile Puzzles00300670010110022We can take advantage of the simple heuristics. We can store only the addition above the Manhattan distance heuristicStoring PDBs for the tile puzzle(Simple mapping) A multi dimensional array A[16][16][16][16][16] size=1.04Mb(Packed mapping) One dimensional array with A[16*15*14*13*12 ] size = 0.52Mb.The time and memory tradeoff is straightforward!!

15 puzzle results

A clique in the tile puzzle is of size 2. We compressed the last index by two A[16][16][16][16][8]

24 puzzleThe same tendencies were obtained for the 24 puzzle.The 6-6-6-6 partitioning is so good that adding another set of 6-6-6-6 did not speedup the search.We have also tried a 7-7-5-5 partitioning but it did not speedup the search.

Ongoing and future workAn item for the PDB of tiles (a,b,c,d) is in the form: =dStore the PDBs in a TrieA PDB of 5 tiles will have a level in the trie for each tile. The values will be in the leaves of the trie.This data-structure will enable flexibility and will save memory as subtrees of the trie can be pruned

Trie pruninig22222Simple (lossless) pruning: Fold leaves with exactly the same values. No data will be lost.

Trie pruninigIntelligent (lossy)pruning: Fold leaves/subtrees with are correlated to each other (many option for this!!)Some data will be lost.Admissibility is still kept.22242

Trie: Initial ResultsA 5-5-5 partitioning stored in a trie with simple folding

Neural Networks (NN)We can feed a PDB into a neural network engine. Especially, Addition above MDFor each tile we focus on its dx and dy from its goal position. (i.e. MD)Linear conflict :dx1= dx2 = 0 dy1 > dy2+1A NN can learn these rules21 dy1 =2 dy2=0

Neural networkWe train the NN by feeding the entire (or part of the) pattern space.For example for a pattern of 5 tiles we have 10 features, 2 for each tile. During the search, given the locations of the tiles we look them up in the NN.

Neural network exampledx4dy4dx5dy5dx6dy64Layout for the pattern of the tiles 4, 5 and 6

Neural Network: problemsWe face the problem of overestimating and will have to bias the results towards underestimating.We keep the overestimating values in a separate hash tableResults are encouraging!!

Selective Pattern DatabaseOnly part of the pattern space is queried for a single problem instance.If we can identify that part we can only generate that part.

Recommended