Planning and Optimization D7. M&S: Generic Algorithm and - - PowerPoint PPT Presentation

planning and optimization
SMART_READER_LITE
LIVE PREVIEW

Planning and Optimization D7. M&S: Generic Algorithm and - - PowerPoint PPT Presentation

Planning and Optimization D7. M&S: Generic Algorithm and Heuristic Properties Gabriele R oger and Thomas Keller Universit at Basel November 7, 2018 Generic Algorithm Heuristic Properties Summary Content of this Course Tasks


slide-1
SLIDE 1

Planning and Optimization

  • D7. M&S: Generic Algorithm and Heuristic Properties

Gabriele R¨

  • ger and Thomas Keller

Universit¨ at Basel

November 7, 2018

slide-2
SLIDE 2

Generic Algorithm Heuristic Properties Summary

Content of this Course

Planning Classical Tasks Progression/ Regression Complexity Heuristics Probabilistic MDPs Uninformed Search Heuristic Search Monte-Carlo Methods

slide-3
SLIDE 3

Generic Algorithm Heuristic Properties Summary

Content of this Course: Heuristics

Heuristics Delete Relaxation Abstraction Abstractions in General Pattern Databases Merge & Shrink Landmarks Potential Heuristics Cost Partitioning

slide-4
SLIDE 4

Generic Algorithm Heuristic Properties Summary

Generic Algorithm

slide-5
SLIDE 5

Generic Algorithm Heuristic Properties Summary

Content of this Course: Merge & Shrink

Merge & Shrink Synchronized Product Merge & Shrink Algorithm Heuristic Properties Strategies Label Reduction

slide-6
SLIDE 6

Generic Algorithm Heuristic Properties Summary

Generic Merge-and-shrink Abstractions: Outline

Using the results from the previous chapter, we can develop the ideas of a generic abstraction computation procedure that takes all state variables into account: Initialization step: Compute all abstract transition systems for atomic projections to form the initial abstraction collection. Merge steps: Combine two abstract systems in the collection by replacing them with their synchronized product. (Stop

  • nce only one transition system is left.)

Shrink steps: If the abstractions in the collection are too large to compute their synchronized product, make them smaller by abstracting them further (applying an arbitrary abstraction to them). We explain these steps with our running example.

slide-7
SLIDE 7

Generic Algorithm Heuristic Properties Summary

Back to the Running Example

LRR LLL LLR LRL ALR ALL BLL BRL ARL ARR BRR BLR RRR RRL RLR RLL

Logistics problem with one package, two trucks, two locations: state variable package: {L, R, A, B} state variable truck A: {L, R} state variable truck B: {L, R}

slide-8
SLIDE 8

Generic Algorithm Heuristic Properties Summary

Initialization Step: Atomic Projection for Package

T π{package}:

L A B R

M⋆⋆⋆ PAL DAL M⋆⋆⋆ DAR PAR M⋆⋆⋆ PBR DBR M⋆⋆⋆ DBL PBL

slide-9
SLIDE 9

Generic Algorithm Heuristic Properties Summary

Initialization Step: Atomic Projection for Truck A

T π{truck A}:

L R

PAL,DAL,MB⋆⋆, PB⋆,DB⋆ MALR MARL PAR,DAR,MB⋆⋆, PB⋆,DB⋆

slide-10
SLIDE 10

Generic Algorithm Heuristic Properties Summary

Initialization Step: Atomic Projection for Truck B

T π{truck B}:

L R

PBL,DBL,MA⋆⋆, PA⋆,DA⋆ MBLR MBRL PBR,DBR,MA⋆⋆, PA⋆,DA⋆

current collection: {T π{package}, T π{truck A}, T π{truck B}}

slide-11
SLIDE 11

Generic Algorithm Heuristic Properties Summary

First Merge Step

T1 := T π{package} ⊗ T π{truck A}:

LL LR AL AR BL BR RL RR

MALR MARL MALR MARL MALR MARL MALR MARL PAL D A L DAR P A R PBR D B R DBL P B L P B L DBL D B R P B R MB⋆⋆ MB⋆⋆ MB⋆⋆ MB⋆⋆ MB⋆⋆ MB⋆⋆ MB⋆⋆ MB⋆⋆

current collection: {T1, T π{truck B}}

slide-12
SLIDE 12

Generic Algorithm Heuristic Properties Summary

Need to Simplify?

If we have sufficient memory available, we can now compute T1 ⊗ T π{truck B}, which would recover the complete transition system of the task. However, to illustrate the general idea, let us assume that we do not have sufficient memory for this product. More specifically, we will assume that after each product

  • peration we need to reduce the result transition system to

four states to obey memory constraints. So we need to reduce T1 to four states. We have a lot of leeway in deciding how exactly to abstract T1. In this example, we simply use an abstraction that leads to a good result in the end.

slide-13
SLIDE 13

Generic Algorithm Heuristic Properties Summary

First Shrink Step

T2 := some abstraction of T1

LL LR AL AR BL BR RL RR

MALR MARL MALR MARL MALR MARL MALR MARL PAL D A L DAR P A R PBR D B R DBL P B L P B L DBL D B R P B R MB⋆⋆ MB⋆⋆ MB⋆⋆ MB⋆⋆ MB⋆⋆ MB⋆⋆ MB⋆⋆ MB⋆⋆

slide-14
SLIDE 14

Generic Algorithm Heuristic Properties Summary

First Shrink Step

T2 := some abstraction of T1

LL LR AL AR BL BR RL RR

MALR MARL MALR MARL MALR MARL MALR MARL PAL D A L DAR P A R PBR D B R DBL P B L P B L DBL D B R P B R MB⋆⋆ MB⋆⋆ MB⋆⋆ MB⋆⋆ MB⋆⋆ MB⋆⋆ MB⋆⋆ MB⋆⋆

slide-15
SLIDE 15

Generic Algorithm Heuristic Properties Summary

First Shrink Step

T2 := some abstraction of T1

LL LR AL AR BL BR R

MALR MARL MALR MARL MALR MARL PAL D A L D A R P A R P B R D B R DBL P B L P B L DBL DBR P B R MB⋆⋆ MB⋆⋆ MB⋆⋆ MB⋆⋆ MB⋆⋆ M⋆⋆⋆ MB⋆⋆

slide-16
SLIDE 16

Generic Algorithm Heuristic Properties Summary

First Shrink Step

T2 := some abstraction of T1

LL LR AL AR AL AR BL BR R

MALR MARL MALR MARL MALR MARL PAL D A L D A R P A R P B R D B R DBL P B L P B L DBL DBR P B R MB⋆⋆ MB⋆⋆ MB⋆⋆ MB⋆⋆ MB⋆⋆ M⋆⋆⋆ MB⋆⋆

slide-17
SLIDE 17

Generic Algorithm Heuristic Properties Summary

First Shrink Step

T2 := some abstraction of T1

LL LR A BL BR R

MALR MARL MALR MARL PAL DAL DAR P A R P B R D B R DBL P B L P B L DBL DBR P B R MB⋆⋆ M⋆⋆⋆ MB⋆⋆ MB⋆⋆ M⋆⋆⋆ MB⋆⋆

slide-18
SLIDE 18

Generic Algorithm Heuristic Properties Summary

First Shrink Step

T2 := some abstraction of T1

LL LR A BL BR BL BR R

MALR MARL MALR MARL PAL DAL DAR P A R P B R D B R DBL P B L P B L DBL DBR P B R MB⋆⋆ M⋆⋆⋆ MB⋆⋆ MB⋆⋆ M⋆⋆⋆ MB⋆⋆

slide-19
SLIDE 19

Generic Algorithm Heuristic Properties Summary

First Shrink Step

T2 := some abstraction of T1

LL LR A B R

MALR MARL PAL DAL DAR P A R PBR D B R DBL PBL PBL DBL MB⋆⋆ M⋆⋆⋆ MB⋆⋆ M⋆⋆⋆ M⋆⋆⋆

slide-20
SLIDE 20

Generic Algorithm Heuristic Properties Summary

First Shrink Step

T2 := some abstraction of T1

LL LR A B R

MALR MARL PAL DAL DAR P A R PBR D B R DBL PBL PBL DBL MB⋆⋆ M⋆⋆⋆ MB⋆⋆ M⋆⋆⋆ M⋆⋆⋆

slide-21
SLIDE 21

Generic Algorithm Heuristic Properties Summary

First Shrink Step

T2 := some abstraction of T1

LL LR I R

MALR MARL MB⋆⋆ MB⋆⋆ M⋆⋆⋆ D⋆R P⋆R M⋆⋆⋆ PBL DBL P⋆L D⋆L

slide-22
SLIDE 22

Generic Algorithm Heuristic Properties Summary

First Shrink Step

T2 := some abstraction of T1

LL LR I R

MALR MARL MB⋆⋆ MB⋆⋆ M⋆⋆⋆ D⋆R P⋆R M⋆⋆⋆ PBL DBL P⋆L D⋆L

current collection: {T2, T π{truck B}}

slide-23
SLIDE 23

Generic Algorithm Heuristic Properties Summary

Second Merge Step

T3 := T2 ⊗ T π{truck B}:

LRL LRR LLL LLR IL IR RL RR

M B L R M B R L M B L R M B R L M B L R M B R L M B L R M B R L DAR PAR D⋆R P⋆R P⋆L D ⋆ L PAL DAL MALR MARL M A L R M A R L P B L DBL MA⋆⋆ MA⋆⋆ MA⋆⋆ MA⋆⋆

current collection: {T3}

slide-24
SLIDE 24

Generic Algorithm Heuristic Properties Summary

Another Shrink Step?

Normally we could stop now and use the distances in the final abstract transition system as our heuristic function. However, if there were further state variables to integrate, we would simplify further, e.g. leading to the following abstraction (again with four states):

LRR

LLL LRL LLR

I R

M⋆⋆⋆ M⋆⋆⋆ M⋆⋆⋆ M⋆RL M⋆LR P⋆L D⋆L D⋆R P⋆R

We get a heuristic value of 3 for the initial state, better than any PDB heuristic that is a proper abstraction. The example generalizes to more locations and trucks, even if we stick to the size limit of 4 (after merging).

slide-25
SLIDE 25

Generic Algorithm Heuristic Properties Summary

Generic Algorithm Template

Generic Merge & Shrink Algorithm abs := {T π{v} | v ∈ V } while abs contains more than one abstract transition system: select A1, A2 from abs shrink A1 and/or A2 until size(A1) · size(A2) ≤ N abs := abs \ {A1, A2} ∪ {A1 ⊗ A2} return the remaining abstract transition system in abs N: parameter bounding number of abstract states Questions for practical implementation: Which abstractions to select? merging strategy How to shrink an abstraction? shrinking strategy How to choose N? usually: as high as memory allows

slide-26
SLIDE 26

Generic Algorithm Heuristic Properties Summary

Heuristic Properties

slide-27
SLIDE 27

Generic Algorithm Heuristic Properties Summary

Content of this Course: Merge & Shrink

Merge & Shrink Synchronized Product Merge & Shrink Algorithm Heuristic Properties Strategies Label Reduction

slide-28
SLIDE 28

Generic Algorithm Heuristic Properties Summary

Heuristic Properties

Each iteration of the algorithm corresponds to a transformation of the collection abs of transition systems. The exact transformation depends on the specific instantiation of the generic algorithm (e.g. of the merging and the shrinking strategy). For analyzing the properties of the resulting heuristic, we analyze properties of the individual transformations.

slide-29
SLIDE 29

Generic Algorithm Heuristic Properties Summary

Collections of Transition Systems

Definition (Collection of Transition Systems) A set X of transition systems is a collection of transition systems if all T ∈ X have the same set of labels and the same cost function. The combined system is TX :=

T ∈X T .

Remark: Strictly speaking, the combined system is not well-defined as the Cartesian product is neither commutative nor associative. For our purpose it is sufficient that the results of all possible combination orders are isomorphic.

slide-30
SLIDE 30

Generic Algorithm Heuristic Properties Summary

Safe Transformations

Definition (Safe Transformation) Let X and X ′ be collections of transition systems with label sets L and L′ and cost functions c and c′, respectively. The transformation from X to X ′ is safe if there exist functions σ and λ mapping the states and labels of TX to the states and labels

  • f TX ′ such that

c′(λ(ℓ)) ≤ c(ℓ) for all ℓ ∈ L, if s, ℓ, t is a transition of TX then σ(s), λ(ℓ), σ(t) is a transition of TX ′, and if s is a goal state of TX then σ(s) is a goal state of TX ′.

slide-31
SLIDE 31

Generic Algorithm Heuristic Properties Summary

Examples

X: Collection of transition systems Replacement with Synchronized Product is Safe Let T1, T2 ∈ X with T1 = T2. The transformation from X to X ′ := (X \ {T1, T2}) ∪ {T1 ⊗ T2} is safe with σ = id and λ = id. Abstraction is Safe Let α be an abstraction for Ti ∈ X. The transformation from X to X ′ := (X \ {Ti}) ∪ {T α

i } is safe with λ = id and

σ(s1, . . . , sn) = s1, . . . , si−1, α(si), si+1, . . . , sn. (Proofs omitted.)

slide-32
SLIDE 32

Generic Algorithm Heuristic Properties Summary

Heuristic Properties (1)

Theorem Let X and X ′ be collections of transition systems. If the transformation from X to X ′ is safe with functions σ and λ then h(s) = h∗

TX′(σ(s)) is a safe, goal-aware, admissible, and consistent

heuristic for TX. Proof. We prove goal-awareness and consistency, the other properties follow from these two. Goal-awareness: For all goal states s⋆ of TX, state σ(s⋆) is a goal state of TX ′ and therefore h(s⋆) = h∗

TX′(σ(s⋆)) = 0.

. . .

slide-33
SLIDE 33

Generic Algorithm Heuristic Properties Summary

Heuristic Properties (2)

Proof (continued). Consistency: Let c and c′ be the label cost functions of X and X ′,

  • respectively. Consider state s of TX and transition s, ℓ, t.

As TX ′ has a transition σ(s), λ(ℓ), σ(t), it holds that h(s) = h∗

TX′(σ(s))

≤ c′(λ(ℓ)) + h∗

TX′(σ(t))

= c′(λ(ℓ)) + h(t) ≤ c(ℓ) + h(t) The second inequality holds due to the requirement on the label costs.

slide-34
SLIDE 34

Generic Algorithm Heuristic Properties Summary

Exact Transformations

Definition (Exact Transformation) Let X and X ′ be collections of transition systems with label sets L and L′ and cost functions c and c′, respectively. The transformation from X to X ′ is exact if there exist functions σ and λ mapping the states and labels of TX to the states and labels

  • f TX ′ such that

1 σ and λ satisfy the requirements of safe transformations, 2 if s′, ℓ′, t′ is a transition of TX ′ then s, ℓ, t is a transition of

TX for all s ∈ σ−1(s′), t ∈ σ−1(t′) and some ℓ ∈ λ−1(ℓ′),

3 if s′ is a goal state of TX ′ then all states s ∈ σ−1(s′) are goal

states of TX, and

4 c(ℓ) = c′(λ(ℓ)) for all ℓ ∈ L.

no “new” transitions and goal states, no cheaper labels

slide-35
SLIDE 35

Generic Algorithm Heuristic Properties Summary

Examples

Replacement with Synchronized Product is Exact Let T1, T2 ∈ X with T1 = T2. The transformation from X to X ′ := (X \ {T1, T2}) ∪ {T1 ⊗ T2} is exact with σ = id and λ = id. (Proof omitted.) More examples will follow.

slide-36
SLIDE 36

Generic Algorithm Heuristic Properties Summary

Heuristic Properties with Exact Transformations (1)

Theorem Let X and X ′ be collections of transition systems. If the transformation from X to X ′ is exact with functions σ and λ then h∗

TX (s) = h∗ TX′(σ(s)).

Proof. As the transformation is safe, h∗

TX′(σ(s)) is admissible for TX and

therefore h∗

TX (s) ≥ h∗ TX′(σ(s)).

For the other direction, we show that for every state s′ of TX ′ and goal path π′ for s′, there is for each s ∈ σ−1(s′) a goal path in TX that has the same cost. . . .

slide-37
SLIDE 37

Generic Algorithm Heuristic Properties Summary

Heuristic Properties with Exact Transformations (2)

Proof (continued). Proof via induction over the length of π′. |π′| = 0: If s′ is a goal state of TX ′ then each s ∈ σ−1(s′) is a goal state of TX and the empty path is a goal path for s in TX. |π′| = i + 1: Let π′ = s′, ℓ′, t′π′

t′, where π′ t′ is a goal path of

length i from t′. Then there is for each t ∈ σ−1(t′) a goal path πt

  • f the same cost in TX. Furthermore, for all s ∈ σ−1(s′) there is a

label ℓ ∈ λ−1(ℓ′) such that TX has a transition s, ℓ, t with t ∈ σ−1(t′). The path π = s, ℓ, tπt is a solution for s in T . As ℓ and ℓ′ must have the same cost and πt and π′

t′ have the same

cost, π has the same cost as π′.

slide-38
SLIDE 38

Generic Algorithm Heuristic Properties Summary

Sequences of Transformations

Theorem (Sequences of Transformations) Let X1, . . . , Xn be collections of transition systems. If for i ∈ {1, . . . , n − 1} the transformation from Xi to Xi+1 is safe (exact) then the transformation from X1 to Xn is safe (exact). Proof idea: The composition of the σ and λ functions of each step satisfy the required conditions.

slide-39
SLIDE 39

Generic Algorithm Heuristic Properties Summary

Consequences

Generic Merge & Shrink Algorithm abs := {T π{v} | v ∈ V } =: X0 while abs contains more than one abstract transition system: select A1, A2 from abs shrink A1 and/or A2 until size(A1) · size(A2) ≤ N abs := abs \ {A1, A2} ∪ {A1 ⊗ A2} return the remaining abstract transition system in abs Initially Tabs is the concrete transition system. Each iteration performs a safe transformation of abs. → the corresponding abstraction heuristic is safe, goal-aware, → consistent, and admissible. If shrinking is exact, the corresponding heuristic is perfect.

slide-40
SLIDE 40

Generic Algorithm Heuristic Properties Summary

Summary

slide-41
SLIDE 41

Generic Algorithm Heuristic Properties Summary

Summary

Projections perfectly reflect a few state variables. Merge-and-shrink abstractions are a generalization that can reflect all state variables, but in a potentially lossy way. The merge steps combine two abstract transition systems by replacing them with their synchronized product. The shrink steps make an abstract system smaller by abstracting it further. As we only use safe transformations, the resulting heuristic is always admissible. If we use only exact transformations, the resulting heuristic is perfect.