1 Advances in Pattern Databases Ariel Felner, Ben-Gurion University Israel

Slides:



Advertisements
Similar presentations
Chapter 5: Tree Constructions
Advertisements

Finding Optimal Solution of 15 puzzle B NTUCSIE Kai-Yung Chiang.
1 Dual lookups in Pattern Databases Ariel Felner, Ben-Gurion Univ. Israel Uzi Zahavi, Bar-Ilan Univ. Israel Jonathan Schaeffer, Univ. of Alberta, Canada.
Review: Search problem formulation
Informed search algorithms
An Introduction to Artificial Intelligence
A* Search. 2 Tree search algorithms Basic idea: Exploration of state space by generating successors of already-explored states (a.k.a.~expanding states).
Inconsistent Heuristics
Greedy best-first search Use the heuristic function to rank the nodes Search strategy –Expand node with lowest h-value Greedily trying to find the least-cost.
Finding Search Heuristics Henry Kautz. if State[node] is not in closed OR g[node] < g[LookUp(State[node],closed)] then A* Graph Search for Any Admissible.
Heuristics CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Informed Search Methods How can we improve searching strategy by using intelligence? Map example: Heuristic: Expand those nodes closest in “as the crow.
Solving Problem by Searching
Optimal Rectangle Packing: A Meta-CSP Approach Chris Reeson Advanced Constraint Processing Fall 2009 By Michael D. Moffitt and Martha E. Pollack, AAAI.
1 Heuristic Search Chapter 4. 2 Outline Heuristic function Greedy Best-first search Admissible heuristic and A* Properties of A* Algorithm IDA*
Recent Progress in the Design and Analysis of Admissible Heuristic Functions Richard E. Korf Computer Science Department University of California, Los.
CSCE 580 ANDREW SMITH JOHNNY FLOWERS IDA* and Memory-Bounded Search Algorithms.
Problem Solving Agents A problem solving agent is one which decides what actions and states to consider in completing a goal Examples: Finding the shortest.
Solving Problems by Searching Currently at Chapter 3 in the book Will finish today/Monday, Chapter 4 next.
Experiments We measured the times(s) and number of expanded nodes to previous heuristic using BFBnB. Dynamic Programming Intuition. All DAGs must have.
Search in AI.
Search by partial solutions. Where are we? Optimization methods Complete solutions Partial solutions Exhaustive search Hill climbing Random restart General.
Problem Solving and Search in AI Part I Search and Intelligence Search is one of the most powerful approaches to problem solving in AI Search is a universal.
Additive pattern database heuristics
Review: Search problem formulation
Informed Search (no corresponding text chapter). Recall: Wanted " An algorithm and associated data structure(s) that can: 1) Solve an arbitrary 8-puzzle.
1 PHA*:Performing A* in Unknown Physical Environments Ariel Felner Bar-Ilan University. Joint work with Roni Stern and Sarit Kraus.
Cooperating Intelligent Systems Informed search Chapter 4, AIMA.
2 Heuristic from Relaxed Models  A heuristic function returns the exact cost of reaching a goal in a simplified or relaxed version of the original problem.
Research Related to Real-Time Strategy Games Robert Holte November 8, 2002.
Cooperating Intelligent Systems Informed search Chapter 4, AIMA 2 nd ed Chapter 3, AIMA 3 rd ed.
Uninformed Search Reading: Chapter 3 by today, Chapter by Wednesday, 9/12 Homework #2 will be given out on Wednesday DID YOU TURN IN YOUR SURVEY?
Informed Search CSE 473 University of Washington.
Origin of Heuristic Functions
Compressing a Single PDB Presented by: Danielle Sauer CMPUT 652 Project December 1, 2004.
Pattern Databases Robert Holte University of Alberta November 6, 2002.
Dovetail Killer? Implementing Jonathan’s New Idea Tarek Sherif.
Cooperating Intelligent Systems Informed search Chapter 4, AIMA 2 nd ed Chapter 3, AIMA 3 rd ed.
Heuristics CSE 473 University of Washington. © Daniel S. Weld Topics Agency Problem Spaces SearchKnowledge Representation Planning PerceptionNLPMulti-agentRobotics.
Using Abstraction to Speed Up Search Robert Holte University of Ottawa.
Vilalta&Eick: Informed Search Informed Search and Exploration Search Strategies Heuristic Functions Local Search Algorithms Vilalta&Eick: Informed Search.
Informed State Space Search Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
P ROBLEM Write an algorithm that calculates the most efficient route between two points as quickly as possible.
Li Wang Haorui Wu University of South Carolina 04/02/2015 A* with Pattern Databases.
Informed search algorithms Chapter 4. Outline Best-first search Greedy best-first search A * search Heuristics.
CSE 473: Artificial Intelligence Spring 2012
Informed search strategies Idea: give the algorithm “hints” about the desirability of different states – Use an evaluation function to rank nodes and select.
Informed searching. Informed search Blind search algorithms do not consider any information about the states and the goals Often there is extra knowledge.
Review: Tree search Initialize the frontier using the starting state While the frontier is not empty – Choose a frontier node to expand according to search.
Lecture 3: Uninformed Search
1 Solving problems by searching 171, Class 2 Chapter 3.
Heuristic Search Andrea Danyluk September 16, 2013.
CSE 573: Artificial Intelligence Autumn2012 Heuristics & Pattern Databases for Search With many slides from Dan Klein, Richard Korf, Stuart Russell, Andrew.
Informed Search and Heuristics Chapter 3.5~7. Outline Best-first search Greedy best-first search A * search Heuristics.
A General Introduction to Artificial Intelligence.
Problem Spaces & Search Dan Weld CSE 573. © Daniel S. Weld 2 Logistics Read rest of R&N chapter 4 Also read chapter 5 PS 1 will arrive by , so be.
3.5 Informed (Heuristic) Searches This section show how an informed search strategy can find solution more efficiently than uninformed strategy. Best-first.
Chapter 3.5 and 3.6 Heuristic Search Continued. Review:Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
Heuristic Functions.
Other partial solution strategies. Partial solution algorithms greedy  branch and bound  A*  divide and conquer  dynamic programming.
Artificial Intelligence Lecture No. 8 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
Reading Material Sections 3.3 – 3.5 Sections 4.1 – 4.2 “Optimal Rectangle Packing: New Results” By R. Korf (optional) “Optimal Rectangle Packing: A Meta-CSP.
CMPT 463. What will be covered A* search Local search Game tree Constraint satisfaction problems (CSP)
Review: Tree search Initialize the frontier using the starting state
Finding Optimal Solutions to Rubik's Cube Using Pattern Databases
Limitations of Front-to-End Bidirectional Heuristic Search
Artificial Intelligence Problem solving by searching CSC 361
Finding Heuristics Using Abstraction
Heuristics Local Search
Heuristics Local Search
Presentation transcript:

1 Advances in Pattern Databases Ariel Felner, Ben-Gurion University Israel

2 Overview Heuristic search and pattern databases Disjoint pattern databases Compressed pattern databases Dual lookups in pattern databases Current and future work

3 optimal path search algorithms For small graphs: provided explicitly, algorithm such as Dijkstra’s shortest path, Bellman-Ford or Floyd-Warshal. Complexity O(n^2). For very large graphs, which are implicitly defined, the A* algorithm which is a best-first search algorithm.

4 Best-first search schema sorts all generated nodes in an OPEN-LIST and chooses the node with the best cost value for expansion. generate(x): insert x into OPEN_LIST. expand(x): delete x from OPEN_LIST and generate its children. BFS depends on its cost (heuristic) function. Different functions cause BFS to expand different nodes Open-List

5 Best-first search: Cost functions g(x): Real distance from the initial state to x h(x): The estimated remained distance from x to the goal state. Examples:Air distance Manhattan Dinstance Different cost combinations of g and h f(x)=level(x) Breadth-First Search. f(x)=g(x) Dijkstra’s algorithms. f(x)=h’(x) Pure Heuristic Search (PHS). f(x)=g(x)+h’(x) The A* algorithm (1968).

6 A* (and IDA*) A* is a best-first search algorithm that uses f(n)=g(n)+h(n) as its cost function. f(x) in A* is an estimation of the shortest path to the goal via x. A* is admissible, complete and optimally effective. [Pearl 84] Result: any other optimal search algorithm will expand at least all the nodes expanded by A* Breadth First Search A*

7 Domains 15 puzzle 10^13 states First solved by [Korf 85] with IDA* and Manhattan distance Takes 53 seconds 24 puzzle 10^24 states First solved by [Korf 96] Takes 2 days

8 Rubik’s cube 10^19 states First solved by [Korf 97] Takes 2 days to solve Domains

9 (n,k) Top Spin Puzzle n tokens arranged in a ring States: any possible permutation of the tokens Operators: Any k consecutive tokens can be reversed The (17,4) version has 10^13 states The (20,4) version has 10^18 states

10 4-peg Towers of Hanoi (TOH4) There is a conjecture about the length of optimal path but it was not proven. Size 4^k

11 How to improve search? Enhanced algorithms: Perimeter-search [Delinberg and Nilson 95] RBFS [Korf 93] Frontier-search [Korf and Zang 2003] Breadth-first heuristic search [Zhou and Hansen 04]  They all try to better explore the search tree. Better heuristics: more parts of the search tree will be pruned.

12 Better heuristics In the 3 rd Millennium we have very large memories. We can build large tables. For enhanced algorithms: large open-lists or transposition tables. They store nodes explicitly. A more intelligent way is to store general knowledge. We can do this with heuristics

13 Subproblems-Abstractions Many problems can be abstracted into subproblems that must be also solved. A solution to the subproblem is a lower bound on the entire problem. Example: Rubik’s cube [Korf 97] Problem:  3x3x3 Rubik’s cube Subproblem:  2x2x2 Corner cubies.

14 Pattern Databases heuristics A pattern database [Culbreson & Schaeffer 96] is a lookup table that stores solutions to all configurations of the subproblem / abstraction / pattern. This table is used as a heuristic during the search. Example: Rubik’s cube. Has 10^19 States. The corner cubies subproblem has 88 Million states A table with 88 Million entries fits in memory [Korf 97]. Pattern space Search space Mapping/Projection

15 Non-additive pattern databases Fringe pattern database [Culberson & Schaeffer 1996]. Has only 259 Million states. Improvement of a factor of 100 over Manhattan Distance

16 Example - 15 puzzle How many moves do we need to move tiles 2,3,6,7 from locations 8,12,13,14 to their goal locations The solution to this is located in PDB[8][12][13][14]=18

17 Disjoint Additive PDBs (DADB) Values of disjoint databases can be added and are still admissible [Korf & Felner: AIJ-02, Felner, Korf & Hanan: JAIR-04] Additivity can be applied if the cost of a subproblem is composed from costs of objects from corresponding pattern only 7-8 If you have many PDBS, take their maximum

18 DADB:Tile puzzles MemoryTimeNodesValueHeuristicPuzzle 3-tera-bytes28 days10^13Breadth-FS ,189, Manhattan15 3, ,090, , , , , ,0002 days360,892,479, [Korf, AAAI 2005]

19 Heuristics for the TOH Infinite peg heuristic (INP): Each disk moves to its own temporary peg. Additive pattern databases [Felner, Korf & Hanan, JAIR-04]

20 Additive PDBS for TOH4 Partition the disks into disjoint sets Store the cost of the complete pattern space of each set in a pattern database. Add values from these PDBs for the heuristic value. The n-disk problem contains 4^n states The largest database that we stored was of 14 disks which needed 4^14=256MB. 6 10

21 TOH4: results 16 disks secondsNodesAvg hh(s)solutionHeuristic memory fullInfinite peg 48134,653, Static ,479, Static ,872, Dynamic disks 2,501238,561, Dynamic 14-3 The difference between static and dynamic is covered in [Felner, Korf & Hanan: JAIR-04]

22 Best Usage of Memory Given 1 giga byte of memory, how do we best use it with pattern databases? [Holte, Newton, Felner, Meshulam and Furcy, ICAPS-2004] showed that it is better to use many small databases and take their maximum instead of one large database. We will present a different (orthogonal) method [Felner, Mushlam & Holte: AAAI-04].

23 Compressing pattern database Felner et al AAAI-04]] Traditionally, each configuration of the pattern had a unique entry in the PDB. Our main claim  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 preserved Consequences: Memory is saved, larger patterns can be used  speedup in search is obtained.

24 Cliques in the pattern space The values in a PDB for a clique are d or d+1 In permutation puzzles cliques exist when only one object moves to another location. G d d d+1 Usually they have nearby entries in the PDB A[4][4][4][4][4] A clique in TOH4

25 Compressing cliques Assume a clique of size K with values d or d+1 Store only one entry (instead of K) for the clique with the minimum d. Lose at most 1. A[4][4][4][4][4] A[4][4][4][4][1] Instead of 4^p we need only 4^(p-1) entries. This can be generalized to a set of nodes with diameter D. (for cliques D=1) A[4][4][4][4][4] A[4][4][4][1][1] In general: compressing by k disks reduces memory requirements from 4^p to 4^(p-k)

26 TOH4 results: 16 disks (14+2) Mem MBTimeNodesDAvg HH(s)PDB ,479, / ,964, / ,055, / ,996, / ,808, / ,132, /5 + 2 Memory was reduced by a factor of 1000!!! at a cost of only a factor of 2 in the search effort.

27 TOH4: larger versions MemTimeNodesAvg HTypePDBsize 256>421>393,887, static14/ ,501238,561, dynamic14/ ,737, static15/ ,293, static16/ ,117, static16/ Memory 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!!

28 Tile Puzzles Storing 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  A[16*15*14*13*12 ] size = 0.52Mb. Time versus memory tradeoff !! Goal State Clique

29 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] Avg HMemTimeNodescompressTypePDB , ,288Nopacked , ,710Nopacked , ,977Nopacked , ,977Nosimple , ,881Yessimple , ,336Yessimple , ,692Yessimple

30 Dual lookups in pattern databases [Felner et al, IJCAI-04]

31 Symmetries in PDBs Symmetric lookups were already performed by the first PDB paper of [Culberson & Schaeffer 96] examples –Tile puzzles: reflect the tiles about the main diagonal. – Rubik’s cube: rotate the cube We can take the maximum among the different lookups These are all geometrical symmetries We suggest a new type of symmetry!!

32 Regular and dual representation Regular representation of a problem: Variables – objects (tiles, cubies etc,) Values – locations Dual representation: Variables – locations Values – objects

33 Regular vs. Dual lookups in PDBs Regular question: Where are tiles {2,3,6,7} and how many moves are needed to gather them to their goal locations? Dual question: Who are the tiles in locations {2,3,6,7} and how many moves are needed to distribute them to their goal locations?

34 Regular and dual lookups Regular lookup: PDB[8,12,13,14] Dual lookup: PDB[9,5,12,15]

35 Regular and dual in TopSpin Regular lookup for C : PDB[1,2,3,7,6] Dual lookup for C: PDB[1,2,3,8,9]

36 Dual lookups Dual lookups are possible when there is a symmetry between locations and objects: –Each object is in only one location and each location occupies only one object. Good examples: TopSpin, Rubik’s cube Bad example: Towers of Hanoi Problematic example: Tile Puzzles

37 Inconsistency of Dual lookups Example: Top-Spin c(b,c)=1 Consistency of heuristics: |h(a)-h(b)| <= c(a,b) RegularDual b00 c12 Both lookups for B PDB[1,2,3,4,5]=0 Regular lookup for C PDB[1,2,3,7,6]=1 Dual lookup for C PDB[1,2,3,8,9]=2

38 Traditional Pathmax children inherit f-value from their parents if it makes them larger g=1 h=4 f=5 g=2 h=2 f=4 g=2 h=3 f=5 Inconsistency Pathmax

39 Bidirectional pathmax (BPMX) Bidirectional pathmax: h-values are propagated in both directions decreasing by 1 in each edge. –If the IDA* threshold is 2 then with BPMX the right child will not even be generated!! h-values BPMX

40 Results: (17,4) TopSpin puzzle regulardualBPMXnodestime ,019, no7,618, yes1,397, yes82, yes27, Nodes improvement (17r+17d) : 1451 Time improvement (4r+4d) : 72 We also solved the (20,4) TopSpin version.

41 Results: Rubik’s cube regulardualBPMXnodestime ,930, no19,653, yes8,315, yes615, yes362, Nodes improvement (24r+24d) : 250 Time improvement (4r+4d) : 55 Data on 1000 states with 14 random moves PDB of 7-edges cubies

42 Results: Rubik’s cube With duals we improved Korf’s results on random instances by a factor of 1.5 using exactly the same PDBs.

43 Results: tile puzzles HeuristicBPMXValuenodestime Manhattan ,189, R , R+R* , R+R*+D+D*yes , With duals, the time for the 24 puzzle drops from 2 days to 1 day.

44 Discussion Results for the TopSpin and Rubik’s cube are better than those of the tile puzzles Dual PDB lookups and BPMX cutoffs are more effective if each operators changes larger part of the states. This is because the identity of the objects being queried in consecutive states are dramatically changed

45 Summary Dual PDB lookups BPMX cutoffs for inconsistent heuristics State of the art solvers.

46 Future work More compression Duality in search spaces Which and how many symmetries to use Other sources of inconsistencies Better ways for propagating inconsistencies

47 Ongoing and future work compressing PDBs An item for the PDB of tiles (a,b,c,d) is in the form: =d Store the PDBs in a Trie A 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

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

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

50 Trie: Initial Results MemNodes/secTimeNodesH(s)MDPDB 3,145,7285,150, ,090, Simple 1,572,480988, ,090, Packed 765,7781,191, ,090, Trie A partitioning stored in a trie with simple folding

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

52 Neural network We 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.

53 Neural network example dx 4 dy 4 dx 5 dy 5 dx 6 dy 6 4 Layout for the pattern of the tiles 4, 5 and 6

54 Neural Network: problems We face the problem of overestimating and will have to bias the results towards underestimating. We keep the overestimating values in a separate hash table Results are encouraging!! MemTimeNodesH(s)PDB 1,572, , Regular 33,611d+472w , Neural Network

55 Ongoing and Future Work Duality Definition 1: of a dual state For a state S we flip the roles of variables and objects A vector Regular state S: [3, 1, 4, 2] Dual state S^d: [2, 4, 1, 4]

56 Future of Duality S  O  G G  O  S^d S^d  O^-1  G

57 Workshop You are all welcome to the workshop on: ”Heuristic Search, Memory-based Heuristics and Their application” To be held in AAAI-06 See: