Recent Progress in the Design and Analysis of Admissible Heuristic Functions Richard E. Korf Computer Science Department University of California, Los.

Slides:



Advertisements
Similar presentations
Heuristic Functions By Peter Lane
Advertisements

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 strategies
An Introduction to Artificial Intelligence
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.
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
1 Heuristic Search Chapter 4. 2 Outline Heuristic function Greedy Best-first search Admissible heuristic and A* Properties of A* Algorithm IDA*
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.
Search in AI.
Mahgul Gulzai Moomal Umer Rabail Hafeez
Additive pattern database heuristics
CPSC 322, Lecture 9Slide 1 Search: Advanced Topics Computer Science cpsc322, Lecture 9 (Textbook Chpt 3.6) January, 23, 2009.
CPSC 322, Lecture 9Slide 1 Search: Advanced Topics Computer Science cpsc322, Lecture 9 (Textbook Chpt 3.6) January, 22, 2010.
Review: Search problem formulation
Introduction to Analysis of Algorithms
9/9. Num iterations: (d+1) Asymptotic ratio of # nodes expanded by IDDFS vs DFS (b+1)/ (b-1) (approximates to 1 when b is large)
3/3 Factoid for the day: “Most people have more than the average number of feet” & eyes & ears & noses.
Research Related to Real-Time Strategy Games Robert Holte November 8, 2002.
9/5 9/5: (today) Lisp Assmt due 9/6: 3:30pm: Lisp Recitation [Lei] 9/7:~6pm: HW/Class recitation [Will] 9/12: HW1 Due.
Informed Search Methods How can we make use of other knowledge about the problem to improve searching strategy? Map example: Heuristic: Expand those nodes.
Problem Solving and Search in AI Heuristic Search
CSC344: AI for Games Lecture 4: Informed search
Pattern Databases Robert Holte University of Alberta November 6, 2002.
9/10  Name plates for everyone!. Blog qn. on Dijkstra Algorithm.. What is the difference between Uniform Cost Search and Dijkstra algorithm? Given the.
Heuristics CSE 473 University of Washington. © Daniel S. Weld Topics Agency Problem Spaces SearchKnowledge Representation Planning PerceptionNLPMulti-agentRobotics.
Informed Search Idea: be smart about what paths to try.
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 (Heuristic) Search
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.
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
For Monday Read chapter 4, section 1 No homework..
Chapter 4 Informed/Heuristic Search
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
Heuristic Search Andrea Danyluk September 16, 2013.
For Wednesday Read chapter 6, sections 1-3 Homework: –Chapter 4, exercise 1.
Artificial Intelligence for Games Informed Search (2) Patrick Olivier
Computer Science CPSC 322 Lecture 6 Iterative Deepening and Search with Costs (Ch: 3.7.3, 3.5.3)
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.
Informed Search II CIS 391 Fall CIS Intro to AI 2 Outline PART I  Informed = use problem-specific knowledge  Best-first search and its variants.
Heuristic Functions. A Heuristic is a function that, when applied to a state, returns a number that is an estimate of the merit of the state, with respect.
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.
A* optimality proof, cycle checking CPSC 322 – Search 5 Textbook § 3.6 and January 21, 2011 Taught by Mike Chiang.
Chapter 3.5 and 3.6 Heuristic Search Continued. Review:Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
Heuristic Functions.
G5AIAI Introduction to AI Graham Kendall Heuristic Searches.
Artificial Intelligence Lecture No. 8 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
For Monday Read chapter 4 exercise 1 No homework.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Review: Tree search Initialize the frontier using the starting state
Finding Optimal Solutions to Rubik's Cube Using Pattern Databases
Heuristic Functions.
Abstraction Transformation & Heuristics
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
HW 1: Warmup Missionaries and Cannibals
Presentation transcript:

Recent Progress in the Design and Analysis of Admissible Heuristic Functions Richard E. Korf Computer Science Department University of California, Los Angeles

Thanks Victoria Cortessis Ariel Felner Rob Holte Kaoru Mulvihill Nathan Sturtevant

Heuristics come from Abstractions Admissible (lower bound) heuristic evaluation functions are often the cost of exact solutions to abstract problems. E.g. If we relax the Fifteen Puzzle to allow a tile to move to any adjacent position, the cost of an exact solution to this simplified problem is Manhattan distance.

Outline of Talk New methods for the design of more accurate heuristic evaluation functions. A new method to predict the running time of admissible heuristic search algorithms

Fifteen Puzzle

Fifteen Puzzle Invented by Sam Loyd in 1870s “...engaged the attention of nine out of ten persons of both sexes and of all ages and conditions of the community.” $1000 prize to swap positions of two tiles

Swap Two Tiles (Johnson & Storey, 1879) proved it’s impossible.

Twenty-Four Puzzle

Rubik’s Cube

Invented in 1974 by Erno Rubik of Hungary Over 100 million sold worldwide Most famous combinatorial puzzle ever

Finding Optimal Solutions Input: A random solvable initial state Output: A shortest sequence of moves that maps the initial state to the goal state Generalized sliding-tile puzzle is NP Complete (Ratner and Warmuth, 1986) People can’t find optimal solutions. Progress measured by size of problems that can be solved optimally.

Sizes of Problem Spaces 8 Puzzle: seconds 2 3 Rubik’s Cube: seconds 15 Puzzle: days 3 3 Rubik’s Cube: ,000 years 24 Puzzle: billion years Brute-Force Search Time (10 million nodes/second) ProblemNodes

A* Algorithm Hart, Nilsson, and Raphael, 1968 Best-first search with cost function f(n)=g(n)+h(n) If h(n) is admissible (a lower bound estimate of optimal cost), A* guarantees optimal solutions if they exist. A* stores all the nodes it generates, exhausting available memory in minutes.

Iterative-Deepening-A* (IDA*) IDA* (Korf, 1985) is a linear-space version of A*, using the same cost function. Each iteration searches depth-first for solutions of a given length. IDA* is simpler, and often faster than A*, due to less overhead per node. Key to performance is accurate heuristic evaluation function.

Manhattan Distance Heuristic Manhattan distance is 6+3=9 moves

Performance on 15 Puzzle Random 15 puzzle instances were first solved optimally using IDA* with Manhattan distance heuristic (Korf, 1985). Optimal solution lengths average 53 moves. 400 million nodes generated on average. Average solution time is about 50 seconds on current machines.

Limitation of Manhattan Distance To solve a 24-Puzzle instance, IDA* with Manhattan distance would take about 65,000 years on average. Assumes that each tile moves independently In fact, tiles interfere with each other. Accounting for these interactions is the key to more accurate heuristic functions.

Example: Linear Conflict 1331 Manhattan distance is 2+2=4 moves

Example: Linear Conflict 1331 Manhattan distance is 2+2=4 moves

Example: Linear Conflict Manhattan distance is 2+2=4 moves

Example: Linear Conflict Manhattan distance is 2+2=4 moves

Example: Linear Conflict Manhattan distance is 2+2=4 moves

Example: Linear Conflict 1331 Manhattan distance is 2+2=4 moves

Example: Linear Conflict 1331 Manhattan distance is 2+2=4 moves, but linear conflict adds 2 additional moves.

Linear Conflict Heuristic Hansson, Mayer, and Yung, 1991 Given two tiles in their goal row, but reversed in position, additional vertical moves can be added to Manhattan distance. Still not accurate enough to solve 24-Puzzle We can generalize this idea further.

More Complex Tile Interactions M.d. is 19 moves, but 31 moves are needed. M.d. is 20 moves, but 28 moves are needed M.d. is 17 moves, but 27 moves are needed

Pattern Database Heuristics Culberson and Schaeffer, 1996 A pattern database is a complete set of such positions, with associated number of moves. e.g. a 7-tile pattern database for the Fifteen Puzzle contains 519 million entries.

Heuristics from Pattern Databases moves is a lower bound on the total number of moves needed to solve this particular state.

Precomputing Pattern Databases Entire database is computed with one backward breadth-first search from goal. All non-pattern tiles are indistinguishable, but all tile moves are counted. The first time each state is encountered, the total number of moves made so far is stored. Once computed, the same table is used for all problems with the same goal state.

What About the Non-Pattern Tiles? Given more memory, we can compute additional pattern databases from the remaining tiles. In fact, we can compute multiple pattern databases from overlapping sets of tiles. The only limit is the amount of memory available to store the pattern databases.

Combining Multiple Databases Overall heuristic is maximum of 31 moves 31 moves needed to solve red tiles 22 moves need to solve blue tiles

Applications of Pattern Databases On 15 puzzle, IDA* with pattern database heuristics is about 10 times faster than with Manhattan distance (Culberson and Schaeffer, 1996). Pattern databases can also be applied to Rubik’s Cube.

Corner Cubie Pattern Database This database contains 88 million entries

6-Edge Cubie Pattern Database This database contains 43 million values

Remaining 6-Edge Cubie Database This database also contains 43 million values

Rubik’s Cube Heuristic All three databases are precomputed in less than an hour, and use less than 100 Mbytes. During problem solving, for each state, the different sets of cubies are used to compute indices into their pattern databases. The overall heuristic value is the maximum of the three different database values.

Performance on Rubik’s Cube IDA* with this heuristic found the first optimal solutions to randomly scrambled Rubik’s Cubes (Korf, 1997). Median optimal solution length is 18 moves Most problems can be solved in about a day now, using larger pattern databases.

Related Work Culberson and Schaeffer’s 1996 work on pattern databases in the Fifteen Puzzle. Armand Prieditis’ ABSOLVER program discovered a “center-corner” heuristic for Rubik’s Cube in Herbert Kociemba independently developed a powerful Rubik’s Cube program in 1990s. Mike Reid has built faster Cube programs.

Memory Adds Speed More memory can hold larger databases. Larger databases provide more accurate heuristic values. More accurate heuristics speed up search. E.g. Doubling the memory almost doubles the search speed. See (Holte and Hernadvolgyi, 1999, 2000) for more details.

Limitation of General Databases The only way to admissibly combine values from multiple general pattern databases is to take the maximum of their values. For more accuracy, we would like to add heuristic values from different databases. We can do this on the tile puzzles because each move only moves one tile at a time. Joint work with Ariel Felner

Additive Pattern Databases Culberson and Schaeffer counted all moves needed to correctly position the pattern tiles. In contrast, we count only moves of the pattern tiles, ignoring non-pattern moves. If no tile belongs to more than one pattern, then we can add their heuristic values. Manhattan distance is a special case of this, where each pattern contains a single tile.

Example Additive Databases The 7-tile database contains 58 million entries. The 8-tile database contains 519 million entries.

Computing the Heuristic Overall heuristic is sum, or 20+25=45 moves 20 moves needed to solve red tiles 25 moves needed to solve blue tiles

Performance on 15 Puzzle IDA* with a heuristic based on these additive pattern databases can optimally solve random 15 puzzle instances in less than 29 milliseconds on average. This is about 1700 times faster than with Manhattan distance on the same machine.

24 Puzzle Additive Databases

Performance on 24 Puzzle Each database contains 128 million entries. IDA* using these databases can optimally solve random 24-puzzle problems. Optimal solutions average 100 moves. Billions to trillions of nodes generated. Over 2 million nodes per second. Running times from 18 seconds to 10 days. Average is a day and a half.

Optimal Solution Length Nodes Generated

Moral of the Story (so far) Our implementation of disjoint additive pattern databases is tailored to tile puzzles. In general, most heuristics assume that subproblems are independent. Capturing some of the interactions between subproblems yields more accurate heuristics We’ve also applied this to graph partioning.

Time Complexity of Admissible Heuristic Search Algorithms Joint work with Michael Reid (Brown University)

Previous Work on This Problem Pohl 1977, Gaschnig 1979, Pearl 1984 Assumes an abstract analytic model of the problem space Characterizes heuristic by its accuracy as an estimate of optimal solution cost Produces asymptotic results. Doesn’t predict runtime on real problems.

How Long does a Heuristic Search Algorithm take to Run? Branching factor of problem space Solution depth of problem instance Heuristic evaluation function Depends on:

Branching Factor: average number of children of a node In tile puzzles, a cell has 2,3,or 4 neighbors. Eliminating inverse of last move gives a node branching factor of 1, 2, or 3. Exact asymptotic branching factor depends on relative frequency of each type of node, in limit of large depth. Joint work with Stefan Edelkamp

One Wrong Way to do it 15 puzzle has 4 center cells (b=3), 4 corner cells (b=1), and 8 side cells (b=2). Therefore, b= (4*3+4*1+8*2)/16=2. Assumes all blank positions equally likely

The Correct Answer The asymptotic branching factor of the Fifteen Puzzle is The derivation is left as an exercise.

Derivation of Time Complexity First, consider brute-force search. Then, consider heuristic search complexity. Illustrate result with example search tree.

Brute-Force Search Tree depth nodes b0b0 b1b h(n) g(n)

Brute-Force Search Tree depth nodes b0b0 b1b1 b2b h(n) g(n)

Brute-Force Search Tree depth nodes b0b0 b1b1 b2b2 b3b h(n) g(n)

Brute-Force Search Tree depth nodes b0b0 b1b1 b2b2 b3b3 b4b h(n) g(n)

Brute-Force Search Tree depth nodes b0b0 b1b1 b2b2 b3b3 b4b4 b5b h(n) g(n)

Brute-Force Search Tree depth nodes b0b0 b1b1 b2b2 b3b3 b4b4 b5b5 b6b h(n) g(n)

Heuristic Distribution Function The distribution of heuristic values converges, independent of initial state. Let P(x) be the proportion of states with heuristic value <= x, in limit of large depth. For pattern database heuristics, P(x) can be computed exactly from the databases. For general heuristics, P(x) can be approximated by random sampling.

Nodes Expanded by A* or IDA* Running time is proportional to number of node expansions. If C* is the cost of an optimal solution, A* or IDA* will expand all nodes n for which f(n)=g(n)+h(n)<=C*, in the worst case.

Brute-Force Search Tree depth nodes b0b0 b1b1 b2b2 b3b3 b4b4 b5b5 b6b h(n) g(n)

depth nodes b0b0 b1b1 b2b2 b3b3 b4b4 b5b5 b6b h(n) g(n) IDA* Iteration with Depth Limit 6

depth nodes b0b0 b1b1 b2b2 b3b3 b4b4 b5b5 b6b h(n) g(n)

IDA* Iteration with Depth Limit 6 depth nodes b0b0 b1b1 b2b2 b3b3 b4b4 b5b5 b6b h(n) g(n)

IDA* Iteration with Depth Limit 6 depth nodes expanded h(n) g(n) b0b0 b1b1 b2b2 b 3 P(3) b 4 P(2) b 5 P(1) b 6 P(0)

The Main Result b is the branching factor, d is the optimal solution depth, P(x) is the heuristic distribution function The number of nodes expanded by the last iteration of IDA* in the worst case is:  i=0 d b i P(d-i)b 0 P(d)+b 1 P(d-1)+...b d P(0)=

Assumptions of the Analysis h is consistent, meaning that in any move, h never decreases more than g increases. The graph is searched as a tree (e.g. IDA*). Goal nodes are ignored. The distribution of heuristic values at a given depth approximates the equilibirum heuristic distribution at large depth. We don’t assume that costs are uniform.

Experiments on Rubik’s Cube Heuristic function is based on corner cubie and two edge cubie pattern databases. Heuristic distribution is computed exactly from databases, assuming database values are independent of each other. Theory predicts average node expansions by IDA* to within 1%.

Experiments on Fifteen Puzzle Heuristic is Manhattan distance. Heuristic distribution is approximated by10 billion random samples of problem space. Theory predicts average node expansions within 2.5% at typical solution depths. Accuracy of theory increases with depth.

Experiments on Eight Puzzle Heuristic is Manhattan distance. Heuristic distribution is computed exactly by exhaustive search of entire space. Average node expansions by IDA* is computed exactly by running every solvable initial state as deep as we need to. Theory predicts experimental results exactly

Practical Importance Ability to predict performance of heuristic search from heuristic distribution allows us to choose among alternative heuristics. More efficient than running large numbers of searches in the problem domain Can predict performance even if we can’t run any problem instances (e.g. Twenty- Four puzzle with Manhattan distance).

Complexity of Heuristic Search Complexity of brute-force search is O(b d ). Previous results predicted O((b-K) d ) for complexity of heuristic search, reducing the effective branching factor. Our theory predicts O(b d-k ), reducing the effective depth of search by a constant. This is confirmed by our experiments. k is roughly the expected value of heuristic.

Summary More powerful admissible heuristics can be automatically computed by capturing some of the interactions between subproblems. The time complexity of heuristic search algorithms can be accurately predicted from the branching factor, search depth, and heuristic distribution function.

Conclusions Recent progress in this area has come from more accurate heuristic functions. Admissible heuristics can also be used to speed up searches for sub-optimal solutions. New methods have emerged for constructing such heuristic functions. Applying these methods to new problems still requires work.