Heuristic search Weighted A Kustaa Kangas October 17, 2013 K. - - PowerPoint PPT Presentation

heuristic search
SMART_READER_LITE
LIVE PREVIEW

Heuristic search Weighted A Kustaa Kangas October 17, 2013 K. - - PowerPoint PPT Presentation

Heuristic search Weighted A Kustaa Kangas October 17, 2013 K. Kangas () Heuristic search Weighted A October 17, 2013 1 / 47 Weighted A Weighted A search unifying view and application R udiger Ebendt, Rolf Drechsler,


slide-1
SLIDE 1

Heuristic search Weighted A∗

Kustaa Kangas October 17, 2013

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 1 / 47

slide-2
SLIDE 2

Weighted A∗

Weighted A∗ search – unifying view and application

R¨ udiger Ebendt, Rolf Drechsler, 2009 Weighted A∗ Weight the heuristic to quickly direct the search. Save time, get bounded suboptimality in exchange. Outline

1 Three approaches: WA∗, DWA∗, A∗

ε

2 Unifying view 3 Monotone heuristic 4 Approximate BDD minimization 5 Experiments

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 2 / 47

slide-3
SLIDE 3

Standard A∗

Standard A∗

f (q) = g(q) + h(q) Finds an optimal path if h is admissible, i.e. h(q) ≤ h∗(q).

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 3 / 47

slide-4
SLIDE 4

Constant inflation

WA∗: constant inflation

f ↑(q) = g(q) + (1 + ε)h(q) where ε ≥ 0. If h is admissible, then WA∗ is ε-admissible, i.e. g(q) ≤ (1 + ε)C ∗ for all expanded q where C ∗ is the length of an optimal path.

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 4 / 47

slide-5
SLIDE 5

ε-admissibility

If h is admissible, then WA∗ is ε-admissible.

Proof.

Let s . . . q . . . t be an optimal path where q is the first node of the path in the open list. Assume a goal state t is expanded. This can happen only if g(t) = f (t) ≤ f (q) = g(q) + (1 + ε)h(q) ≤ g∗(q) + (1 + ε)h∗(q) ≤ (1 + ε)(g∗(q) + h∗(q)) = (1 + ε)C ∗

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 5 / 47

slide-6
SLIDE 6

Dynamic weighting

DWA∗: Dynamic weighting

f DW (q) = g(q) +

  • 1 + ε ·
  • 1 − d(q)

N

  • h(q)

where d(q) depth of q N depth of optimal solution Idea: as the search goes deeper, emphasize the heuristic less. How do we get N? Sometimes known beforehand: e.g. BDD minimization. Generally not known: use an upper bound.

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 6 / 47

slide-7
SLIDE 7

A∗

ε

Keep the original cost function f (q) = g(q) + h(q) Instead of expanding q with the smallest f (q), define FOCAL =

  • q ∈ OPEN | f (q) ≤ (1 + ε) ·

min

r∈OPEN f (r)

  • Use another heuristic hF to choose a minimum from FOCAL, i.e.

ˆ q = arg min

q∈FOCAL

hF(q)

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 7 / 47

slide-8
SLIDE 8

A∗

ε

f (q) = g(q) + h(q) ˆ q = arg min

q∈FOCAL

hF(q) Original idea: h estimates solution cost hF estimates remaining search effort Suggestions for hF: hF = h hF(q) = N − d(q)

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 8 / 47

slide-9
SLIDE 9

Unifying view

f (q) = g(q) + h(q) FOCAL =

  • q ∈ OPEN | f (q) ≤ (1 + ε) ·

min

r∈OPEN f (r)

  • WA∗ and DWA∗ are actually special cases of A∗

ε

hF(q) = f ↑(q) = g(q) + (1 + ε)h(q) WA∗ hF(q) = f DW (q) = g(q) +

  • 1 + ε ·
  • 1 − d(q)

N

  • h(q)

DWA∗

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 9 / 47

slide-10
SLIDE 10

Unifying view

A∗

ε is a unifying framework.

Any result for A∗

ε follows for WA∗ and DWA∗

◮ e.g. ε-admissibility

Makes the approaches comparable (same f )

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 10 / 47

slide-11
SLIDE 11

Unifying view

Concern: what if weighted A∗ expands many q with C ∗ ≤ f (q) ≤ (1 + ε)C ∗ Could overcome the advantages of directing the search. General A∗

ε makes no guarantees.

For WA∗ and DWA∗ this happens relatively rarely.

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 11 / 47

slide-12
SLIDE 12

Monotone heuristic

Monotone heuristic

If for every state q and its descendant q′ h(q) ≤ c(q, q′) + h(q′) the heuristic is monotone or consistent. A∗ with a monotone heuristic When q is expanded, g(q) = g∗(q) Expanded states are never reopened Does this hold for weighted A∗?

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 12 / 47

slide-13
SLIDE 13

Monotone heuristic

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 13 / 47

slide-14
SLIDE 14

Monotone heuristic

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 14 / 47

slide-15
SLIDE 15

Monotone heuristic

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 15 / 47

slide-16
SLIDE 16

Monotone heuristic

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 16 / 47

slide-17
SLIDE 17

Monotone heuristic

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 17 / 47

slide-18
SLIDE 18

Monotone heuristic

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 18 / 47

slide-19
SLIDE 19

Monotone heuristic

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 19 / 47

slide-20
SLIDE 20

Monotone heuristic

Turns out no. However, we do get the bound g(q) ≤ (1 + ε)g∗(q) + ε · h(q) for all expanded q. Weighted A∗ benefits less from a monotone heuristic. Reopening may increase running times significantly.

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 20 / 47

slide-21
SLIDE 21

Without reopening

What if we don’t reopen states? Simply ignore any new better path.

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 21 / 47

slide-22
SLIDE 22

Without reopening

What if we don’t reopen states? Simply ignore any new better path. Turns out the C ≤ (1 + ε)C ∗ bound no longer holds.

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 21 / 47

slide-23
SLIDE 23

Without reopening

What if we don’t reopen states? Simply ignore any new better path. Turns out the C ≤ (1 + ε)C ∗ bound no longer holds. Instead, we can show C ≤ (1 + ε)⌊N/2⌋C ∗ where N is the depth of the optimal solution.

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 21 / 47

slide-24
SLIDE 24

Without reopening

What if we don’t reopen states? Simply ignore any new better path. Turns out the C ≤ (1 + ε)C ∗ bound no longer holds. Instead, we can show C ≤ (1 + ε)⌊N/2⌋C ∗ where N is the depth of the optimal solution. Intuition: shortcutting requires always at least two states.

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 21 / 47

slide-25
SLIDE 25

Without reopening

What if we don’t reopen states? Simply ignore any new better path. Turns out the C ≤ (1 + ε)C ∗ bound no longer holds. Instead, we can show C ≤ (1 + ε)⌊N/2⌋C ∗ where N is the depth of the optimal solution. Intuition: shortcutting requires always at least two states. Each shortcut accumulates the error by a factor of (1 + ε).

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 21 / 47

slide-26
SLIDE 26

Without reopening

What if we don’t reopen states? Simply ignore any new better path. Turns out the C ≤ (1 + ε)C ∗ bound no longer holds. Instead, we can show C ≤ (1 + ε)⌊N/2⌋C ∗ where N is the depth of the optimal solution. Intuition: shortcutting requires always at least two states. Each shortcut accumulates the error by a factor of (1 + ε). WA∗ and DWA∗ are still ε-admissible without reopening.

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 21 / 47

slide-27
SLIDE 27

Experiments

All variants were evaluated on a number of problems: BDD minimization Blocksworld Sliding-tile puzzle Depots Logistics PSR Satellite Freecell Driverlog

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 22 / 47

slide-28
SLIDE 28

Experiments

All variants were evaluated on a number of problems: BDD minimization Blocksworld Sliding-tile puzzle Depots Logistics PSR Satellite Freecell Driverlog

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 23 / 47

slide-29
SLIDE 29

Boolean functions

A Boolean function is a function f : {0, 1}n → {0, 1} Can be represented as a table, e.g. n = 3: X1 X2 X3 Y → 1 1 → 1 → 1 1 → 1 → 1 1 1 → 1 1 → 1 1 1 1 → 1

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 24 / 47

slide-30
SLIDE 30

Boolean decision diagrams

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 25 / 47

slide-31
SLIDE 31

Boolean decision diagrams

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 26 / 47

slide-32
SLIDE 32

Boolean decision diagrams

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 27 / 47

slide-33
SLIDE 33

Boolean decision diagrams

Several applications Model checking Sparse-memory applications Planning Symbolic heuristic search Enchancing heuristic search (e.g. A∗) In general we want BDDs to be as small as possible. Easier to read Take less memory Faster to evaluate

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 28 / 47

slide-34
SLIDE 34

Boolean decision diagrams

BDDs are not unique and can often be simplified.

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 29 / 47

slide-35
SLIDE 35

Boolean decision diagrams

BDDs are not unique and can often be simplified.

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 30 / 47

slide-36
SLIDE 36

Boolean decision diagrams

BDDs are not unique and can often be simplified.

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 31 / 47

slide-37
SLIDE 37

Boolean decision diagrams

For a fixed permutation of variables, applying merge and deletion iteratively yields a minimal BDD. However, the permutation determines how small BDDs we can achieve.

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 32 / 47

slide-38
SLIDE 38

Boolean decision diagrams

Optimal BDD for permutation X1, X2, X3.

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 33 / 47

slide-39
SLIDE 39

Boolean decision diagrams

Optimal BDD for permutation X2, X1, X3 (and X2, X3, X1)

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 34 / 47

slide-40
SLIDE 40

Boolean decision diagrams

BDD minimization problem: find an ordering of variables that yields a minimal BDD (least nodes) NP-hard (decision version is NP-complete) Can be solved exactly in O(3nn). Can often be solved fast with heuristic search.

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 35 / 47

slide-41
SLIDE 41

Boolean decision diagrams

In particular, we can formulate it as a path search problem. A state is a set of variables whose position in the order has been fixed. Each transition fixes the position of a variable. A path of length k defines the first k variables in the ordering.

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 36 / 47

slide-42
SLIDE 42

Variable orderings

A permutation corresponds to a path in the subset lattice.

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 37 / 47

slide-43
SLIDE 43

Variable orderings

A permutation corresponds to a path in the subset lattice.

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 38 / 47

slide-44
SLIDE 44

Variable orderings

A permutation corresponds to a path in the subset lattice.

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 39 / 47

slide-45
SLIDE 45

Variable orderings

A permutation corresponds to a path in the subset lattice.

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 40 / 47

slide-46
SLIDE 46

Variable orderings

A permutation corresponds to a path in the subset lattice.

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 41 / 47

slide-47
SLIDE 47

Variable orderings

A permutation corresponds to a path in the subset lattice.

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 42 / 47

slide-48
SLIDE 48

Variable orderings

A permutation corresponds to a path in the subset lattice.

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 43 / 47

slide-49
SLIDE 49

Variable orderings

A permutation corresponds to a path in the subset lattice: 4,1,3,2

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 44 / 47

slide-50
SLIDE 50

Variable orderings

Finding an optimal path is equivalent to finding an optimal BDD. g: For a path of length k, the size of the first k levels of the BDD. h: The number of cofactors: a lower bound on the size of the BDD. Weighted A∗ used for approximate BDD mimimization.

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 45 / 47

slide-51
SLIDE 51

Experiments

Experimental results.

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 46 / 47

slide-52
SLIDE 52

Questions?

  • K. Kangas ()

Heuristic search Weighted A∗ October 17, 2013 47 / 47