using abstraction to speed up search robert holte university of ottawa
TRANSCRIPT
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
Portion of the London Underground Graph
“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.
Towers of Hanoi puzzlefor D disks:
– graph has 3D nodes– description is O(D2)
3-disk State Space
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
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
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
Example: Towers of Hanoistart
goal
Abstraction:“Ignore the smallest
disk”start
goal
Abstract Solution
start
goal
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*
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.
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
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
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.
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.
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).
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
Domain Abstraction
1 2
3 4 5
6 7 8
8-puzzle181,440 nodes
Domain Abstraction
1 2
3 4 5
6 7 8
8-puzzle181,440 nodes
6 7 8
<5> abstraction3024 nodes
Domain Abstraction
1 2
3 4 5
6 7 8
8-puzzle181,440 nodes
<3,3,2> abstraction5040 nodes
Performance versus Size
pattern database size (# abstract states)
# no
des
expa
nded
Performance of Pattern Databases
# no
des
expa
nded
pattern database size (# of abstract states)
Prediction of Search Time
actual # nodes expanded
Kor
f &
Rei
d’s
pred
icti
on
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