A new Approach to Dynamic Programming

Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
A new Approach to Dynamic Programming
M. Pouly
Department of Informatics
University of Fribourg, Switzerland
January 2007
M. Pouly
Dynamic Programming
1/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Semirings & Properties
Semiring Examples
Semiring induced Valuation Algebras
Outline
1
Semirings, Properties & Valuation Algebras
2
Optimization Problems
3
Dynamic Programming
M. Pouly
Dynamic Programming
2/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Semirings & Properties
Semiring Examples
Semiring induced Valuation Algebras
Semirings & Zero Elements
Algebraic structure with two operations + and × over a set A.
+ and × are associative & commutative
× distributes over +: a × (b + c) = (a × b) + (a × c)
An element 0 ∈ A is called zero element if ∀a ∈ A
a + 0 = a and a × 0 = 0.
NB: We can adjoin artificially a zero element to any semiring.
Therefore, we can assume that all semirings provide a zero
element.
M. Pouly
Dynamic Programming
3/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Semirings & Properties
Semiring Examples
Semiring induced Valuation Algebras
Semirings & Zero Elements
Algebraic structure with two operations + and × over a set A.
+ and × are associative & commutative
× distributes over +: a × (b + c) = (a × b) + (a × c)
An element 0 ∈ A is called zero element if ∀a ∈ A
a + 0 = a and a × 0 = 0.
NB: We can adjoin artificially a zero element to any semiring.
Therefore, we can assume that all semirings provide a zero
element.
M. Pouly
Dynamic Programming
3/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Semirings & Properties
Semiring Examples
Semiring induced Valuation Algebras
Idempotent Semirings & Unit Elements
The operation + is idempotent if ∀a ∈ A
a + a = a.
An element 1 ∈ A is called unit element if ∀a ∈ A
a × 1 = a.
NB: We can adjoin artificially a unit element to any idempotent
semiring. Therefore, we can assume that all idempotent
semirings provide a unit element.
M. Pouly
Dynamic Programming
4/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Semirings & Properties
Semiring Examples
Semiring induced Valuation Algebras
Idempotent Semirings & Unit Elements
The operation + is idempotent if ∀a ∈ A
a + a = a.
An element 1 ∈ A is called unit element if ∀a ∈ A
a × 1 = a.
NB: We can adjoin artificially a unit element to any idempotent
semiring. Therefore, we can assume that all idempotent
semirings provide a unit element.
M. Pouly
Dynamic Programming
4/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Semirings & Properties
Semiring Examples
Semiring induced Valuation Algebras
Semiring Examples
1
2
3
4
5
6
A
,
∪ {0}
≥0
∪ {−∞, ∞}
= {0, 1}
P(S)
∪ {0, ∞}
∪ {−∞}
[0, 1]
+
+
max
∨
∪
min
max
max
×
·
min
∧
∩
+
+
t-norm
zero
0
−∞
0
∅
∞
−∞
0
unit
1
∞
1
S
0
0
1
a+a=a
no
yes
yes
yes
yes
yes
yes
1
Arithmetic Semiring
4
Lattice of Subsets
2
Bottleneck Semiring
5
Tropical Semiring
3
Boolean Semiring
6
T-Norm Semiring
M. Pouly
Dynamic Programming
5/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Semirings & Properties
Semiring Examples
Semiring induced Valuation Algebras
Notation & Conventions
We consider only binary variables X with ΩX = {x, x}.
For a set of variables s:
Ωs =
!
ΩX .
X ∈s
The elements x ∈ Ωs are called configurations.
By convention: Ω∅ = {+}.
x↓t denotes the projection of x to t ⊆ s.
In particular: x↓∅ = +.
x = (x↓t , x↓s−t )
M. Pouly
Dynamic Programming
6/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Semirings & Properties
Semiring Examples
Semiring induced Valuation Algebras
Notation & Conventions
We consider only binary variables X with ΩX = {x, x}.
For a set of variables s:
Ωs =
!
ΩX .
X ∈s
The elements x ∈ Ωs are called configurations.
By convention: Ω∅ = {+}.
x↓t denotes the projection of x to t ⊆ s.
In particular: x↓∅ = +.
x = (x↓t , x↓s−t )
M. Pouly
Dynamic Programming
6/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Semirings & Properties
Semiring Examples
Semiring induced Valuation Algebras
Notation & Conventions
We consider only binary variables X with ΩX = {x, x}.
For a set of variables s:
Ωs =
!
ΩX .
X ∈s
The elements x ∈ Ωs are called configurations.
By convention: Ω∅ = {+}.
x↓t denotes the projection of x to t ⊆ s.
In particular: x↓∅ = +.
x = (x↓t , x↓s−t )
M. Pouly
Dynamic Programming
6/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Semirings & Properties
Semiring Examples
Semiring induced Valuation Algebras
A-Valuations
An A-valuation φ with domain s is a function that associates a
value from a semiring A with each configuration x ∈ Ωs ,
φ : Ωs → A.
Example: Tropical Semiring with max for addition and + for
multiplication over ∪ {−∞}.
Ω{A,B}
a
b
φ= a
b
a
b
a
b
M. Pouly
φ(x)
4
3
8
5
Dynamic Programming
7/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Semirings & Properties
Semiring Examples
Semiring induced Valuation Algebras
A-Valuations
An A-valuation φ with domain s is a function that associates a
value from a semiring A with each configuration x ∈ Ωs ,
φ : Ωs → A.
Example: Tropical Semiring with max for addition and + for
multiplication over ∪ {−∞}.
Ω{A,B}
a
b
φ= a
b
a
b
a
b
M. Pouly
φ(x)
4
3
8
5
Dynamic Programming
7/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Semirings & Properties
Semiring Examples
Semiring induced Valuation Algebras
Operations for A-Valuations I
1
Labeling: d(φ) = s if φ ∈ Φs .
2
Combination: for φ, ψ ∈ Φ, x ∈ Ωd(φ)∪d(ψ)
φ ⊗ ψ(x) = φ(x↓d(φ) ) × ψ(x↓d(ψ) ).
Ω{A,B}
a
b
a
b
a
b
a
b
φ(x)
4
3
8
5
⊗
Ω{B,C}
b
c
b
c
b
c
b
c
M. Pouly
ψ(x)
1
6
2
0
=
Ω{A,B,C}
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
Dynamic Programming
φ ⊗ ψ(x)
5
10
5
3
9
14
7
5
8/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Semirings & Properties
Semiring Examples
Semiring induced Valuation Algebras
Operations for A-Valuations II
3
Variable Elimination: for φ ∈ Φ, Y ∈ d(φ), x ∈ Ωt−{Y }
φ−Y (x) = φ(x, y ) + φ(x, y ).
Ω{A,B,C}
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
c
a
b
a
b
c
a
b
c
φ ⊗ ψ(x)
5
10
5
3
9
14
7
5
−C
M. Pouly
=
Ω{A,B}
a
b
a
b
a
b
a
b
(φ ⊗ ψ)−C (x)
10
5
14
7
Dynamic Programming
9/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Semirings & Order
Projection Problem = Optimization Problem
Solution Configurations
Outline
1
Semirings, Properties & Valuation Algebras
2
Optimization Problems
3
Dynamic Programming
M. Pouly
Dynamic Programming
10/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Semirings & Order
Projection Problem = Optimization Problem
Solution Configurations
Ordered Semirings
We can introduce a relation ≤A for semirings with idempotent +:
a ≤A b if and only if a + b = b.
Theorem
≤A is a monotonic partial order.
0 ≤A a ≤A a + b = sup{a, b}
If ≤A is total:
0 ≤A a ≤A a + b = max{a, b}
M. Pouly
Dynamic Programming
11/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Semirings & Order
Projection Problem = Optimization Problem
Solution Configurations
Projection Problem = Optimization Problem
The Projection Problem: φ↓t = (φ1 ⊗ φ2 ⊗ · · · ⊗ φn )↓t
In a totally ordered semiring with idempotent +:
φ−Y (x) = φ(x, y ) + φ(x, y ) = max{φ(x, y ), φ(x, y )}
φ↓t (x) =
"
y∈Ωs−t
φ(x, y) = max{φ(x, y), y ∈ Ωs−t }
and in particular for t = ∅:
φ↓∅ (+) = max{φ(x), x ∈ Ωs }
M. Pouly
Dynamic Programming
12/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Semirings & Order
Projection Problem = Optimization Problem
Solution Configurations
Projection Problem = Optimization Problem
The Projection Problem: φ↓t = (φ1 ⊗ φ2 ⊗ · · · ⊗ φn )↓t
In a totally ordered semiring with idempotent +:
φ−Y (x) = φ(x, y ) + φ(x, y ) = max{φ(x, y ), φ(x, y )}
φ↓t (x) =
"
y∈Ωs−t
φ(x, y) = max{φ(x, y), y ∈ Ωs−t }
and in particular for t = ∅:
φ↓∅ (+) = max{φ(x), x ∈ Ωs }
M. Pouly
Dynamic Programming
12/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Semirings & Order
Projection Problem = Optimization Problem
Solution Configurations
Projection Problem = Optimization Problem
The Projection Problem: φ↓t = (φ1 ⊗ φ2 ⊗ · · · ⊗ φn )↓t
In a totally ordered semiring with idempotent +:
φ−Y (x) = φ(x, y ) + φ(x, y ) = max{φ(x, y ), φ(x, y )}
φ↓t (x) =
"
y∈Ωs−t
φ(x, y) = max{φ(x, y), y ∈ Ωs−t }
and in particular for t = ∅:
φ↓∅ (+) = max{φ(x), x ∈ Ωs }
M. Pouly
Dynamic Programming
12/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Semirings & Order
Projection Problem = Optimization Problem
Solution Configurations
Solution Configurations
Ω{A,B,C}
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
φ
5
10
10
3
9
5
7
3
!
Ω{A,B}
a
b
a
b
a
b
a
b
φ−C
10
10
9
7
!
Ω{A}
a
a
φ−B,C
10
9
!
Ω{A}
#
φ−A,B,C
10
For φ ∈ Φs , we call x ∈ Ωs a solution configuration if φ(x) = φ↓∅ (+).
cφ = {x ∈ Ωs : φ(x) = φ↓∅ (+)}
cφ is called solution configuration set, here
cφ = {(a, b, c), (a, b, c)}
M. Pouly
Dynamic Programming
13/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Semirings & Order
Projection Problem = Optimization Problem
Solution Configurations
Solution Configurations
Ω{A,B,C}
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
φ
5
10
10
3
9
5
7
3
!
Ω{A,B}
a
b
a
b
a
b
a
b
φ−C
10
10
9
7
!
Ω{A}
a
a
φ−B,C
10
9
!
Ω{A}
#
φ−A,B,C
10
For φ ∈ Φs , we call x ∈ Ωs a solution configuration if φ(x) = φ↓∅ (+).
cφ = {x ∈ Ωs : φ(x) = φ↓∅ (+)}
cφ is called solution configuration set, here
cφ = {(a, b, c), (a, b, c)}
M. Pouly
Dynamic Programming
13/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
Outline
1
Semirings, Properties & Valuation Algebras
2
Optimization Problems
3
Dynamic Programming
M. Pouly
Dynamic Programming
14/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
Computing Solution Configurations ! Rigi 2006
How to compute solution configurations of φ = φ1 ⊗ · · · ⊗ φn ?
I presented a local computation method that computes a partial
solution configuration set
↓λ(i)
ci = cφ
= {x↓λ(i) : x ∈ cφ }
in every join tree node i. cφ can be build by table lookups in ci .
M. Pouly
Dynamic Programming
15/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
Rigi 2006
Isn't there a better way to represent
solution configurations sets?
By use of the knowledge
compilation map for example ...
M. Pouly
Dynamic Programming
16/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
Rigi 2006
?
M. Pouly
Dynamic Programming
16/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
Rigi 2006
Some beers later ...
M. Pouly
Dynamic Programming
16/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
Representation with Boolean Functions
Ω{A,B,C}
a
b
c
c
a
b
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
φ(x)
5
10
10
3
9
5
7
3
cφ = {(a, b, c), (a, b, c)}
f = (A ∧ B ∧ ¬C) ∨ (A ∧ ¬B ∧ C)
The models of f correspond to the solution configurations of φ.
What we need to know about Boolean functions:
f : {0, 1}r → {0, 1}
Conjunction: min{f1 , f2 }, Disjunction: max{f1 , f2 }
Fr is the set of all Boolean functions over the variable set r .
M. Pouly
Dynamic Programming
17/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
Representation with Boolean Functions
Ω{A,B,C}
a
b
c
c
a
b
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
φ(x)
5
10
10
3
9
5
7
3
cφ = {(a, b, c), (a, b, c)}
f = (A ∧ B ∧ ¬C) ∨ (A ∧ ¬B ∧ C)
The models of f correspond to the solution configurations of φ.
What we need to know about Boolean functions:
f : {0, 1}r → {0, 1}
Conjunction: min{f1 , f2 }, Disjunction: max{f1 , f2 }
Fr is the set of all Boolean functions over the variable set r .
M. Pouly
Dynamic Programming
17/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
AF-Valuations
Let A be a semiring with idempotent + and ≤A total. We define
φ : Ωs → A × Fr
x 0→ (φA (x), φF (x))
φA (x) is the usual semiring value for configuration x.
φF (x) is the Boolean function for configuration x.
φ is called an AF-Valuation.
M. Pouly
Dynamic Programming
18/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
Variable Elimination: Definition
3
Variable Elimination: for φ ∈ Φ, Y ∈ d(φ), x ∈ Ωd(φ)−{Y }
−Y
φ−Y (x) = (φ−Y
A (x), φF (x))
where
φ−Y
A (x) = φA (x, y ) + φA (x, y )
and
φ−Y
F (x) = min{Y , φF (x, y )} if φA (x, y ) >A φA (x, y )
φ−Y
F (x) = min{Y , φF (x, y )} if φA (x, y ) <A φA (x, y )
φ−Y
F (x) = max{min{Y , φF (x, y )}, min{Y , φF (x, y )}}
M. Pouly
Dynamic Programming
19/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
Variable Elimination: Definition
3
Variable Elimination: for φ ∈ Φ, Y ∈ d(φ), x ∈ Ωd(φ)−{Y }
−Y
φ−Y (x) = (φ−Y
A (x), φF (x))
where
φ−Y
A (x) = φA (x, y ) + φA (x, y )
and
φ−Y
F (x) = min{Y , φF (x, y )} if φA (x, y ) >A φA (x, y )
φ−Y
F (x) = min{Y , φF (x, y )} if φA (x, y ) <A φA (x, y )
φ−Y
F (x) = max{min{Y , φF (x, y )}, min{Y , φF (x, y )}}
M. Pouly
Dynamic Programming
19/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
Variable Elimination: Definition
3
Variable Elimination: for φ ∈ Φ, Y ∈ d(φ), x ∈ Ωd(φ)−{Y }
−Y
φ−Y (x) = (φ−Y
A (x), φF (x))
where
φ−Y
A (x) = φA (x, y ) + φA (x, y )
and
φ−Y
F (x) = min{Y , φF (x, y )} if φA (x, y ) >A φA (x, y )
φ−Y
F (x) = min{Y , φF (x, y )} if φA (x, y ) <A φA (x, y )
φ−Y
F (x) = max{min{Y , φF (x, y )}, min{Y , φF (x, y )}}
M. Pouly
Dynamic Programming
19/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
Variable Elimination: Example
Ω{A,B,C}
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
!
!
describes cφ .
φA
5
10
10
3
9
5
7
3
φF
$
$
$
$
$
$
$
$
−B,C
Ω{A}
a
a
Ω{A}
#
φA
10
9
−A,B,C
φA
10
!
Ω{A,B}
a
b
a
b
a
b
a
b
φ−C
A
10
10
9
7
φ−C
A
¬C
C
C
C
−B,C
φF
(B ∧ ¬C) ∨ (¬B ∧ C)
B∧C
−A,B,C
φF
A ∧ ((B ∧ ¬C) ∨ (¬B ∧ C))
≡ (A ∧ B ∧ ¬C) ∨ (A ∧ ¬B ∧ C)
M. Pouly
Dynamic Programming
20/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
Variable Elimination: Example
Ω{A,B,C}
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
!
!
describes cφ .
φA
5
10
10
3
9
5
7
3
φF
$
$
$
$
$
$
$
$
−B,C
Ω{A}
a
a
Ω{A}
#
φA
10
9
−A,B,C
φA
10
!
Ω{A,B}
a
b
a
b
a
b
a
b
φ−C
A
10
10
9
7
φ−C
A
¬C
C
C
C
−B,C
φF
(B ∧ ¬C) ∨ (¬B ∧ C)
B∧C
−A,B,C
φF
A ∧ ((B ∧ ¬C) ∨ (¬B ∧ C))
≡ (A ∧ B ∧ ¬C) ∨ (A ∧ ¬B ∧ C)
M. Pouly
Dynamic Programming
20/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
Variable Elimination: Example
Ω{A,B,C}
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
!
!
describes cφ .
φA
5
10
10
3
9
5
7
3
φF
$
$
$
$
$
$
$
$
−B,C
Ω{A}
a
a
Ω{A}
#
φA
10
9
−A,B,C
φA
10
!
Ω{A,B}
a
b
a
b
a
b
a
b
φ−C
A
10
10
9
7
φ−C
A
¬C
C
C
C
−B,C
φF
(B ∧ ¬C) ∨ (¬B ∧ C)
B∧C
−A,B,C
φF
A ∧ ((B ∧ ¬C) ∨ (¬B ∧ C))
≡ (A ∧ B ∧ ¬C) ∨ (A ∧ ¬B ∧ C)
M. Pouly
Dynamic Programming
20/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
Variable Elimination: Example
Ω{A,B,C}
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
!
!
describes cφ .
φA
5
10
10
3
9
5
7
3
φF
$
$
$
$
$
$
$
$
−B,C
Ω{A}
a
a
Ω{A}
#
φA
10
9
−A,B,C
φA
10
!
Ω{A,B}
a
b
a
b
a
b
a
b
φ−C
A
10
10
9
7
φ−C
A
¬C
C
C
C
−B,C
φF
(B ∧ ¬C) ∨ (¬B ∧ C)
B∧C
−A,B,C
φF
A ∧ ((B ∧ ¬C) ∨ (¬B ∧ C))
≡ (A ∧ B ∧ ¬C) ∨ (A ∧ ¬B ∧ C)
M. Pouly
Dynamic Programming
20/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
Variable Elimination: Example
Ω{A,B,C}
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
!
!
describes cφ .
φA
5
10
10
3
9
5
7
3
φF
$
$
$
$
$
$
$
$
−B,C
Ω{A}
a
a
Ω{A}
#
φA
10
9
−A,B,C
φA
10
!
Ω{A,B}
a
b
a
b
a
b
a
b
φ−C
A
10
10
9
7
φ−C
A
¬C
C
C
C
−B,C
φF
(B ∧ ¬C) ∨ (¬B ∧ C)
B∧C
−A,B,C
φF
A ∧ ((B ∧ ¬C) ∨ (¬B ∧ C))
≡ (A ∧ B ∧ ¬C) ∨ (A ∧ ¬B ∧ C)
M. Pouly
Dynamic Programming
20/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
Combination: Definition & Example
2
Combination: for φ ∈ Φs , ψ ∈ Φt and x ∈ Ωs∪t
(φ ⊗ ψ)(x) = (φA (x↓s ) × ψA (x↓t ), min{φF (x↓s ), ψF (x↓t )}).
Ω{A,B}
a
b
a
b
a
b
a
b
φA
4
3
8
5
φF
X
X ∨ ¬X
¬X
X
Ω{A,B,C}
a
b
c
a
b
c
a
b
c
c
a
b
a
b
c
a
b
c
a
b
c
a
b
c
⊗
(φ ⊗ ψ)A
5
10
5
3
9
14
7
5
M. Pouly
Ω{B,C}
b
c
b
c
b
c
c
b
ψA
1
6
2
0
ψF
¬Y
Y
¬Y
Y
=
(φ ⊗ ψ)F
X ∧ ¬Y
X ∧Y
(X ∨ ¬X ) ∧ ¬Y
(X ∨ ¬X ) ∧ Y
¬X ∧ ¬Y
¬X ∧ Y
X ∧ ¬Y
X ∧Y
Dynamic Programming
21/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
Combination: Definition & Example
2
Combination: for φ ∈ Φs , ψ ∈ Φt and x ∈ Ωs∪t
(φ ⊗ ψ)(x) = (φA (x↓s ) × ψA (x↓t ), min{φF (x↓s ), ψF (x↓t )}).
Ω{A,B}
a
b
a
b
a
b
a
b
φA
4
3
8
5
φF
X
X ∨ ¬X
¬X
X
Ω{A,B,C}
a
b
c
a
b
c
a
b
c
c
a
b
a
b
c
a
b
c
a
b
c
a
b
c
⊗
(φ ⊗ ψ)A
5
10
5
3
9
14
7
5
M. Pouly
Ω{B,C}
b
c
b
c
b
c
c
b
ψA
1
6
2
0
ψF
¬Y
Y
¬Y
Y
=
(φ ⊗ ψ)F
X ∧ ¬Y
X ∧Y
(X ∨ ¬X ) ∧ ¬Y
(X ∨ ¬X ) ∧ Y
¬X ∧ ¬Y
¬X ∧ Y
X ∧ ¬Y
X ∧Y
Dynamic Programming
21/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
Combination: Definition & Example
2
Combination: for φ ∈ Φs , ψ ∈ Φt and x ∈ Ωs∪t
(φ ⊗ ψ)(x) = (φA (x↓s ) × ψA (x↓t ), min{φF (x↓s ), ψF (x↓t )}).
Ω{A,B}
a
b
a
b
a
b
a
b
φA
4
3
8
5
φF
X
X ∨ ¬X
¬X
X
Ω{A,B,C}
a
b
c
a
b
c
a
b
c
c
a
b
a
b
c
a
b
c
a
b
c
a
b
c
⊗
(φ ⊗ ψ)A
5
10
5
3
9
14
7
5
M. Pouly
Ω{B,C}
b
c
b
c
b
c
c
b
ψA
1
6
2
0
ψF
¬Y
Y
¬Y
Y
=
(φ ⊗ ψ)F
X ∧ ¬Y
X ∧Y
(X ∨ ¬X ) ∧ ¬Y
(X ∨ ¬X ) ∧ Y
¬X ∧ ¬Y
¬X ∧ Y
X ∧ ¬Y
X ∧Y
Dynamic Programming
21/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
Identifying Solution Configurations
Task: Find solution configurations of φ = φ1 ⊗ . . . ⊗ φn .
Algorithm:
Embed every φi into φ#i : x ∈ Ωd(φi ) 0→ (φi (x), 2).
$1 ⊗ . . . ⊗ φ
$n )↓∅ by use of collect.
Compute φ#↓∅ = (φ
$A ↓∅ (+) is the maximum value over all configurations of φ.
φ
$F ↓∅ (+) is a Boolean function whose model set
φ
corresponds to the solution configuration set of φ.
M. Pouly
Dynamic Programming
22/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
Identifying Solution Configurations
Task: Find solution configurations of φ = φ1 ⊗ . . . ⊗ φn .
Algorithm:
Embed every φi into φ#i : x ∈ Ωd(φi ) 0→ (φi (x), 2).
$1 ⊗ . . . ⊗ φ
$n )↓∅ by use of collect.
Compute φ#↓∅ = (φ
$A ↓∅ (+) is the maximum value over all configurations of φ.
φ
$F ↓∅ (+) is a Boolean function whose model set
φ
corresponds to the solution configuration set of φ.
M. Pouly
Dynamic Programming
23/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
Querying Boolean Functions
This is worth nothing if we cannot extract the models efficiently.
Every Boolean Function can be represented as a PDAG
(Propositional Directed Acyclic Graph):
1
Leaves are labeled with 2, ⊥, or X ∈ r .
2
Non-leaf nodes are represented by 4 (logical conjunction),
5 (logical disjunction) or ◦ (logical negation).
3
4- and 5-nodes have at least one child and ◦-nodes have
exactly one child.
M. Pouly
Dynamic Programming
24/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
PDAG Example
A ∧ ((B ∧ ¬C) ∨ (¬B ∧ ¬C))
A
B
C
M. Pouly
B
C
Dynamic Programming
25/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
PDAG Properties
Variable Elimination creates the following sub-PDAGs:
Y
Existing
PDAG
Existing
PDAG
Y
Y
Existing
PDAG
Existing
PDAG
Y
M. Pouly
Dynamic Programming
26/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
PDAG Properties
Variable Elimination creates the following sub-PDAGs:
Y
Existing
PDAG
Existing
PDAG
Y
Y
Existing
PDAG
Existing
PDAG
Y
Each child of a ◦-node is a leaf (simple negation property).
M. Pouly
Dynamic Programming
26/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
PDAG Properties
Variable Elimination creates the following sub-PDAGs:
Y
Existing
PDAG
Existing
PDAG
Y
Y
Existing
PDAG
Existing
PDAG
Y
The sets of variables that occur in the subtrees of every
4-node are disjoint (decomposability property).
M. Pouly
Dynamic Programming
26/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
PDAG Properties
Variable Elimination creates the following sub-PDAGs:
Y
Existing
PDAG
Existing
PDAG
Y
Y
Existing
PDAG
Existing
PDAG
Y
The children of every 5-node are pairwise logically
contradictory., i.e. if αi and αj are two children of the same
5-node, we have αi ∧ αj ≡ ⊥ (determinism property).
M. Pouly
Dynamic Programming
26/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
PDAG Properties: Conclusion
We have a cdn-PDAG.
M. Pouly
Dynamic Programming
27/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
PDAG Properties: Conclusion
We have a cdn-PDAG.
PDAG
cd-PDAG
dn-PDAG
cn-PDAG
cdn-PDAG
DNF
CNF
CO/CE/ME
◦
√
VA/IM/MEc
◦
√
CT/PR/PEQ
◦
√
◦
√
√
√
◦
◦
√
◦
◦
√
◦
√
◦
◦
◦
M. Pouly
Dynamic Programming
EQ
◦
?
◦
◦
?
◦
◦
SE
◦
◦
◦
◦
◦
◦
◦
27/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
PDAG Properties: Conclusion
PDAG
cd-PDAG
dn-PDAG
cn-PDAG
cdn-PDAG
DNF
CNF
CO/CE/ME
◦
√
VA/IM/MEc
◦
√
CT/PR/PEQ
◦
√
◦
√
√
√
◦
◦
√
◦
◦
√
◦
√
◦
◦
◦
EQ
◦
?
◦
◦
?
◦
◦
SE
◦
◦
◦
◦
◦
◦
◦
Theorem (A. Darwiche)
cdn-PDAGs allow Model Enumeration in polytime.
M. Pouly
Dynamic Programming
27/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
And what is new ?
So far, this (implicit) method offers the same possibilities as the
(explicit) procedure presented (in/on/at) Rigi.
Drawback: Only Boolean variables.
Advantage: More compact representation of cφ .
But cdn-PDAGs allow further possibilities ....
M. Pouly
Dynamic Programming
28/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
In Search of new LC Applications I
..
.
cdn-PDAG
..
.
CO/CE/ME
..
.
√
VA/IM/MEc
..
.
√
CT/PR/PEQ
..
.
√
..
.
..
.
..
.
EQ
..
.
?
..
.
SE
..
.
◦
..
.
Counter-Model Enumeration: We can also enumerate all
configurations of φ that are not solution configurations,
i.e. the set c φ = Ωs − cφ .
M. Pouly
Dynamic Programming
29/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
In Search of new LC Applications II
..
.
cdn-PDAG
..
.
CO/CE/ME
..
.
√
VA/IM/MEc
..
.
√
CT/PR/PEQ
..
.
√
..
.
..
.
..
.
EQ
..
.
?
..
.
SE
..
.
◦
..
.
Validity: This answers the query if φ#↓∅
F (+) ≡ 2, i.e. if cφ = Ωs .
Clearly, this is the case if and only if all configurations of φ
adopt the same value.
M. Pouly
Dynamic Programming
30/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
In Search of new LC Applications III
..
.
cdn-PDAG
..
.
CO/CE/ME
..
.
√
VA/IM/MEc
..
.
√
CT/PR/PEQ
..
.
√
..
.
..
.
..
.
EQ
..
.
?
..
.
SE
..
.
◦
..
.
Probability Computation: If we assume independent marginal
probabilities p(X ) for all variables X ∈ s, we can efficiently
compute the probability of the Boolean function p(φ#↓∅
F (+)).
M. Pouly
Dynamic Programming
31/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
In Search of new LC Applications IV
..
.
cdn-PDAG
..
.
CO/CE/ME
..
.
√
VA/IM/MEc
..
.
√
CT/PR/PEQ
..
.
√
..
.
..
.
..
.
EQ
..
.
?
..
.
SE
..
.
◦
..
.
Probabilistic Equivalence Test: Assume two different
factorizations over the same set of variables, cdn-PDAGs allow
to perform a probabilistic equivalence check that answers the
question if φ1 and φ2 adopt the same solution configurations.
M. Pouly
Dynamic Programming
32/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
Another Idea ...
Ω{A,B,C}
a b c
a b c
a b c
a b c
a b c
a b c
a b c
a b c
φ(x)
5
10
10
2
10
5
2
2
Observation: Many configurations share the same value:
Context Specific Independence.
M. Pouly
Dynamic Programming
33/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
Another Idea ...
Ω{A,B,C}
a b c
a b c
a b c
a b c
a b c
a b c
a b c
a b c
φ(x)
5
10
10
2
10
5
2
2
!
Ω{A,B,C}
¬B ∧ (¬A ∨ ¬C)
...
...
φ(x)
2
5
10
Observation: Many configurations share the same value:
Context Specific Independence.
M. Pouly
Dynamic Programming
33/ 34
Semirings, Properties & Valuation Algebras
Optimization Problems
Dynamic Programming
Computing Solution Configurations
Boolean Functions
AF -Valuations
Thanks
M. Pouly
Dynamic Programming
34/ 34