Using Abstraction to Speed Up Search Robert Holte University of Ottawa.

27
Using Abstraction to Speed Up Search Robert Holte University of Ottawa

Transcript of Using Abstraction to Speed Up Search Robert Holte University of Ottawa.

Page 1: Using Abstraction to Speed Up Search Robert Holte University of Ottawa.

Using Abstraction to Speed Up Search

Robert Holte

University of Ottawa

Page 2: Using Abstraction to Speed Up Search Robert Holte University of Ottawa.

Textbook Computer ScienceProblem: in a given graph find a shortest path between

two nodes (start, goal)

(explicit) Graph Representationsadjacency matrix – O(N2)adjacency list – O(N+E)

AlgorithmsDijkstra (if all edge weights are non-negative)

Bellman-Ford (all shortest paths from start)

time and space – low-order polynomials of N and E

Page 3: Using Abstraction to Speed Up Search Robert Holte University of Ottawa.

Portion of the London Underground Graph

Page 4: Using Abstraction to Speed Up Search Robert Holte University of Ottawa.

“Implicit” Graphs

Instead of an adjacency list/matrix,Define a graph by a successor function, succ,

and one or more “seed” nodes.Nodes of the graph = transitive closure of succ applied to the seed nodes

An edge exists from n1 to n2 iff n2 succ(n1)

A graph can be exponentially larger than its description.

Page 5: Using Abstraction to Speed Up Search Robert Holte University of Ottawa.

Towers of Hanoi puzzlefor D disks:

– graph has 3D nodes– description is O(D2)

Page 6: Using Abstraction to Speed Up Search Robert Holte University of Ottawa.

3-disk State Space

Page 7: Using Abstraction to Speed Up Search Robert Holte University of Ottawa.

Speed up Search by Using Extra Information

• Solution “skeleton” = chain of subgraphs leading from start to goal– Refinement: search in the first subgraph until you reach

the second, then search in the second until you reach the third, etc.

– very fast but path found not guaranteed to be optimal

• Heuristic = h(n) = estimate of the distance from node n to the goal node.– if it never overestimates, it can eliminate (prune) parts of

the graph and still guarantee finding an optimal path

Page 8: Using Abstraction to Speed Up Search Robert Holte University of Ottawa.

Transform the edge weights to account for h(n):

becomes

Use Dijkstra (if h(n1) e + h(n2)) or Bellman-Ford (all shortest paths)

Distance to n increases by h(n), so a more accurate heuristic prunes more nodes.

How to Search with a Heuristic

en1 n2

e – h(n1)+h(n2)n1 n2

Page 9: Using Abstraction to Speed Up Search Robert Holte University of Ottawa.

My Research

Aim:to generate heuristics or skeletal solutions automatically(from an explicit or implicit graph)

Method:1. Create an abstraction of the given graph2. Find a solution path in the abstract graph3. Use the abstract solution as a skeletal solution, or use

its length as a heuristic

Page 10: Using Abstraction to Speed Up Search Robert Holte University of Ottawa.

Example: Towers of Hanoistart

goal

Page 11: Using Abstraction to Speed Up Search Robert Holte University of Ottawa.

Abstraction:“Ignore the smallest

disk”start

goal

Page 12: Using Abstraction to Speed Up Search Robert Holte University of Ottawa.

Abstract Solution

start

goal

Page 13: Using Abstraction to Speed Up Search Robert Holte University of Ottawa.

My Research Contributions (1)

Methods of Abstraction– explicit graphs: STAR abstraction– implicit graphs: domain abstraction– select among abstractions using Korf & Reid’s

method for predicting search time

Search Methods– refinement: AltO– heuristic: Hierarchical A*

Page 14: Using Abstraction to Speed Up Search Robert Holte University of Ottawa.

My Research Contributions (2)

Conceptual Advances– Unified view of refinement and heuristic search,

enabling a continuous tradeoff between solution quality and search time.

– Demonstrate, and analyze, failures of abstraction techniques on implicit graphs.

– Demonstrate viability of hierarchical heuristic search.– Investigate the relation between a heuristic’s search

time and its size as a lookup table.– Transfer techniques between AI and CS.

Page 15: Using Abstraction to Speed Up Search Robert Holte University of Ottawa.

STAR abstraction

Abstract state = connected subgraph

(all nodes within distance R of a given node)

• Fully automatic (but need to amortize cost)

• Fine control over granularity (R)

• Can be applied recursively (abstraction hierarchy)

• Guarantees refinement will succeed• Produces a consistent heuristic

Page 16: Using Abstraction to Speed Up Search Robert Holte University of Ottawa.

AltO Refinement Technique

Conduct abstract search in the opposite direction to the base-level search;

Use the whole abstract search graph for refinement.

• 12% faster than standard refinement and produces better solutions (20% shorter)

• Robust – not sensitive to the abstract solution found, and not very sensitive to the radius of abstraction

• 10-40 times faster than A* (same abstraction) and solutions usually within 30% of optimal

Page 17: Using Abstraction to Speed Up Search Robert Holte University of Ottawa.

Hierarchical A*Heuristic search: h(n) is needed for every node reached

during search.

Hierarchical A*: Compute h(n) on demand.If h(n) is not already known compute it by searching at the

abstract level.The search at an abstract level can be informed by a

heuristic defined by a higher abstract level.

many abstract searches for one base-level search naïve implementation is 10 times slower than blind base-

level search.

Page 18: Using Abstraction to Speed Up Search Robert Holte University of Ottawa.

Making Hierarchical A* Efficient

Key Observation:For one base-level search all the abstract searches have the

same goal so distance-to-goal information from one abstract search can used to speedup subsequent abstract searches.

Example: “P-g caching”Suppose an abstract search finds an optimal path of length P, and

during search it reaches node n at distance g(n) from the abstract start node.

Then P-g(n) is a consistent heuristic (at the abstract level) and is often more accurate than the h(n) value used during this search.

Page 19: Using Abstraction to Speed Up Search Robert Holte University of Ottawa.

Pattern Databases

Instead of computing h(n) on demand, precompute distance-to-goal for all abstract states, and store them in a lookup table.

Joe Culberson & Jonathan Schaeffer (1994)1000-times speedup over best hand-crafted

heuristics for the 15-puzzle (1013 states).

Rich Korf (1997): first optimal solutions of random instances of Rubik’s cube (1019 states).

Page 20: Using Abstraction to Speed Up Search Robert Holte University of Ottawa.

My Pattern Database Research

• Pattern databases generated semi-automatically, not hand-crafted

• Identify obstacles to fully automatic generation

• Large-scale studies involving thousands of pattern databases• Study pattern databases in isolation, not in conjunction with

a hand-crafted heuristic• Evaluate Korf & Reid’s method for predicting search time

Page 21: Using Abstraction to Speed Up Search Robert Holte University of Ottawa.

Domain Abstraction

1 2

3 4 5

6 7 8

8-puzzle181,440 nodes

Page 22: Using Abstraction to Speed Up Search Robert Holte University of Ottawa.

Domain Abstraction

1 2

3 4 5

6 7 8

8-puzzle181,440 nodes

6 7 8

<5> abstraction3024 nodes

Page 23: Using Abstraction to Speed Up Search Robert Holte University of Ottawa.

Domain Abstraction

1 2

3 4 5

6 7 8

8-puzzle181,440 nodes

<3,3,2> abstraction5040 nodes

Page 24: Using Abstraction to Speed Up Search Robert Holte University of Ottawa.

Performance versus Size

pattern database size (# abstract states)

# no

des

expa

nded

Page 25: Using Abstraction to Speed Up Search Robert Holte University of Ottawa.

Performance of Pattern Databases

# no

des

expa

nded

pattern database size (# of abstract states)

Page 26: Using Abstraction to Speed Up Search Robert Holte University of Ottawa.

Prediction of Search Time

actual # nodes expanded

Kor

f &

Rei

d’s

pred

icti

on

Page 27: Using Abstraction to Speed Up Search Robert Holte University of Ottawa.

Future Research

• weighted, directed graphs

• multiple abstractions, blended abstractions

• compression of pattern databases

• understand & avoid failure modes

• alternative methods of abstraction

• how best to use limited memory