junction tree propagation - bndg 4-4 · 2008. 5. 19. · join tree (junction tree) let g be the set...

79
Junction tree propagation - BNDG 4-4.6 Finn V. Jensen and Thomas D. Nielsen Junction tree propagation – p. 1/25

Upload: others

Post on 20-Jan-2021

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Junction tree propagation - BNDG 4-4.6

Finn V. Jensen and Thomas D. Nielsen

Junction tree propagation – p. 1/25

Page 2: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Exact Inference

Message Passing in Join Trees

More sophisticated inference technique; used in most implemented Bayesian Networksystems (e.g. Hugin).

Overview:

Given: Bayesian network for P (V)

⇓ Preprocessing

Construct a new internal representation for P (V) called a junction tree

⇓ Inference/Updating

Retrieve P (A | E = e) for single A ∈ V

Junction tree propagation – p. 2/25

Page 3: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Calculate a marginal

P (A4)

=X

A1

X

A2

X

A3

X

A5

X

A6

φ1(A1)φ2(A2, A1)φ3(A3, A1)φ4(A4, A2)φ5(A5, A2, A3)φ6(A6, A3)

Junction tree propagation – p. 3/25

Page 4: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Calculate a marginal

P (A4)

=X

A1

X

A2

X

A3

X

A5

X

A6

φ1(A1)φ2(A2, A1)φ3(A3, A1)φ4(A4, A2)φ5(A5, A2, A3)φ6(A6, A3)

=X

A1

φ1(A1)X

A2

φ2(A2, A1)φ4(A4, A2)X

A3

φ3(A3, A1)X

A5

φ5(A5, A2, A3)X

A6

φ6(A6, A3)

Junction tree propagation – p. 3/25

Page 5: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Calculate a marginal

P (A4)=P

A1φ1(A1)

P

A2φ2(A2,A1)φ4(A4,A2)

P

A3φ3(A3,A1)

P

A5φ5(A5,A2,A3)

P

A6φ6(A6,A3)

Junction tree propagation – p. 4/25

Page 6: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Calculate a marginal

Some of the calculationscan be simplified. E.g.

X

A6

P (A6 |A3) = 1

P (A4)=P

A1φ1(A1)

P

A2φ2(A2,A1)φ4(A4,A2)

P

A3φ3(A3,A1)

P

A5φ5(A5,A2,A3)

P

A6φ6(A6,A3)

Junction tree propagation – p. 4/25

Page 7: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Calculate a marginal

Assume evidence e = (e5, e6); represented as 0/1 potentials. Then:

P (A4, e) =X

A1

φ1(A1)X

A2

φ2(A2, A1)φ4(A4, A2)

X

A3

φ3(A3, A1)X

A5

φ5(A5, A2, A3)e5

X

A6

φ6(A6, A3)e6

and

P (A4 | e) =P (A4, e)

P

A4P (A4, e)

Junction tree propagation – p. 5/25

Page 8: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Calculate a marginal

Assume evidence e = (e5, e6); represented as 0/1 potentials. Then:

P (A4, e) =X

A1

φ1(A1)X

A2

φ2(A2, A1)φ4(A4, A2)

X

A3

φ3(A3, A1)X

A5

φ5(A5, A2, A3)e5

X

A6

φ6(A6, A3)e6

and

P (A4 | e) =P (A4, e)

P

A4P (A4, e)

The process is sufficiently general to handle all evidence scenarios!

⇒ We look for a general structure in which these calculations can be performed for allvariables.

Junction tree propagation – p. 5/25

Page 9: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Domain graphs

The Bayesian network The domain graph

The link (A2, A3) is called a moral link.

Junction tree propagation – p. 6/25

Page 10: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Domain graphs

Moralization in general

◮ For all nodes X: Connect pairwise all parents of X with undirected links.

◮ Replace all original directed links by undirected ones.

1 2

3 4

765

8

The Bayesian network

Junction tree propagation – p. 7/25

Page 11: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Domain graphs

Moralization in general

◮ For all nodes X: Connect pairwise all parents of X with undirected links.

◮ Replace all original directed links by undirected ones.

1 2

3 4

765

8

The Bayesian network

1 2

3 4

765

8

Step 1

Junction tree propagation – p. 7/25

Page 12: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Domain graphs

Moralization in general

◮ For all nodes X: Connect pairwise all parents of X with undirected links.

◮ Replace all original directed links by undirected ones.

1 2

3 4

765

8

The Bayesian network

1 2

3 4

765

8

Step 1

1 2

3 4

765

8

Step 2

Junction tree propagation – p. 7/25

Page 13: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Eliminating a variable

Suppose that when calculating P (A4) we start off by eliminating A3:

φ′(A1, A2, A5, A6) =X

A3

φ3(A3, A1)φ4(A4, A2)φ5(A5, A2, A3).

Graphically:

The Bayesian network The domain graph The new domain graph

Junction tree propagation – p. 8/25

Page 14: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Eliminating a variable

Suppose that when calculating P (A4) we start off by eliminating A3:

φ′(A1, A2, A5, A6) =X

A3

φ3(A3, A1)φ4(A4, A2)φ5(A5, A2, A3).

Graphically:

The Bayesian network The domain graph The new domain graph

Perfect elimination sequences

If all variables can be eliminated without introducing fill-in edges, then the eliminationsequence is called perfect. An example could be A5, A6, A3, A1, A2, A4.

Junction tree propagation – p. 8/25

Page 15: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Perfect elimination sequences

Perfect elimination sequences

All perfect elimination sequences produce the same domain set, namely the set of cliques ofthe domain graph.

Clique

A set of nodes is complete if all nodes are pairwise linked. A complete set is a clique if it isnot a subset of another complete set.

1 2

3 4

765

8

Property

Any perfect elimination sequence ending with A is optimal w.r.t. calculating P (A).

Junction tree propagation – p. 9/25

Page 16: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Triangulated graphs

Definition

An undirected graph with a perfect elimination sequence is called a triangulated graph.

Example

not triangulated

triangulated

Junction tree propagation – p. 10/25

Page 17: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Triangulated graphs

Definition

An undirected graph with a perfect elimination sequence is called a triangulated graph.

Example

not triangulated

triangulated

Corollary

A graph is triangulated iff all nodes can successively be eliminated without introducing fill-inedges.

Junction tree propagation – p. 10/25

Page 18: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Triangulated graphs

Definition

An undirected graph with a perfect elimination sequence is called a triangulated graph.

Example

not triangulated

triangulated

Corollary

A graph is triangulated iff there does not exist a cycle of length ≥ 4 that is not cut by a cord.

Junction tree propagation – p. 10/25

Page 19: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Triangulated graphs

Definition

An undirected graph with a perfect elimination sequence is called a triangulated graph.

Example

not triangulated

triangulated

Corollary

In a triangulated graph, each variable A has a perfect elimination sequence ending with A.

Junction tree propagation – p. 10/25

Page 20: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Triangulated graphs

Definition

An undirected graph with a perfect elimination sequence is called a triangulated graph.

Example

not triangulated

triangulated

Assumption

For now we shall assume that the domain graph is triangulated!

Junction tree propagation – p. 10/25

Page 21: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Exact Inference

Join Tree (Junction Tree)

Let G be the set of cliques from an undirected graph, and let the cliques of G be organized ina tree T . Then T is a join tree if

◮ a variable V that is contained in two nodes C,C′ also is contained in every node onthe (unique) path connecting C and C′.

Example:

Junction tree propagation – p. 11/25

Page 22: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Exact Inference

Join Tree (Junction Tree)

Let G be the set of cliques from an undirected graph, and let the cliques of G be organized ina tree T . Then T is a join tree if

◮ a variable V that is contained in two nodes C,C′ also is contained in every node onthe (unique) path connecting C and C′.

Example:

(a) A join tree

(b) Not a join tree

Junction tree propagation – p. 11/25

Page 23: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Exact Inference

Join Tree (Junction Tree)

Let G be the set of cliques from an undirected graph, and let the cliques of G be organized ina tree T . Then T is a join tree if

◮ a variable V that is contained in two nodes C,C′ also is contained in every node onthe (unique) path connecting C and C′.

Example:

(a) A join tree

(b) Not a join tree

Theorem: An undirected graph G is triangulated if and only if the cliques of G can beorganized in a join tree.

Junction tree propagation – p. 11/25

Page 24: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Join tree construction

From undirected graph to join graph

Define undirected graph (C, E∗):

C : Set of cliques in triangulated moral graphE∗ : {(C1,C2) | C1 ∩ C2 6= ∅}

Junction tree propagation – p. 12/25

Page 25: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Join tree construction

From undirected graph to join graph

Define undirected graph (C, E∗):

C : Set of cliques in triangulated moral graphE∗ : {(C1,C2) | C1 ∩ C2 6= ∅}

1 2

3 4

765

8

Junction tree propagation – p. 12/25

Page 26: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Join tree construction

From undirected graph to join graph

Define undirected graph (C, E∗):

C : Set of cliques in triangulated moral graphE∗ : {(C1,C2) | C1 ∩ C2 6= ∅}

1 2

3 4

765

8

Junction tree propagation – p. 12/25

Page 27: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Join tree construction

From undirected graph to join graph

Define undirected graph (C, E∗):

C : Set of cliques in triangulated moral graphE∗ : {(C1,C2) | C1 ∩ C2 6= ∅}

1 2

3 4

765

8

Junction tree propagation – p. 12/25

Page 28: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Join tree construction

From undirected graph to join graph

Define undirected graph (C, E∗):

C : Set of cliques in triangulated moral graphE∗ : {(C1,C2) | C1 ∩ C2 6= ∅}

1 2

3 4

765

8

1,2,3 2,4,7

3,6,72,3,7

5,6,7,8

Junction tree propagation – p. 12/25

Page 29: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Join tree construction

From join graph to join tree

Find maximal spanning tree: for edge e = (C1,C2) define weight w(e) := |C1 ∩ C2|. Let(C, E) be a maximal spanning tree of (C, E∗) with respect to edge weights.

Junction tree propagation – p. 13/25

Page 30: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Join tree construction

From join graph to join tree

Find maximal spanning tree: for edge e = (C1,C2) define weight w(e) := |C1 ∩ C2|. Let(C, E) be a maximal spanning tree of (C, E∗) with respect to edge weights.

1,2,3 2,4,7

3,6,72,3,7

5,6,7,8

Junction tree propagation – p. 13/25

Page 31: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Join tree construction

From join graph to join tree

Find maximal spanning tree: for edge e = (C1,C2) define weight w(e) := |C1 ∩ C2|. Let(C, E) be a maximal spanning tree of (C, E∗) with respect to edge weights.

1,2,3 2,4,7

3,6,72,3,7

5,6,7,8

1

1

1

2 2

2

2

Junction tree propagation – p. 13/25

Page 32: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Join tree construction

From join graph to join tree

Find maximal spanning tree: for edge e = (C1,C2) define weight w(e) := |C1 ∩ C2|. Let(C, E) be a maximal spanning tree of (C, E∗) with respect to edge weights.

1,2,3 2,4,7

3,6,72,3,7

5,6,7,8

1

1

1

2 2

2

2

Junction tree propagation – p. 13/25

Page 33: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Join tree construction

From join graph to join tree

Find maximal spanning tree: for edge e = (C1,C2) define weight w(e) := |C1 ∩ C2|. Let(C, E) be a maximal spanning tree of (C, E∗) with respect to edge weights.

1,2,3 2,4,7

3,6,72,3,7

5,6,7,8

Junction tree propagation – p. 13/25

Page 34: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Join tree construction

Another example

Junction tree propagation – p. 14/25

Page 35: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Join tree construction

Another example

A1

A2 A3

A4 A5 A6

Junction tree propagation – p. 14/25

Page 36: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Join tree construction

Another example

A1

A2 A3

A4 A5 A6

11

1 1

2A2, A4

A1, A2, A3

A2, A3, A5

A2, A3, A5

Junction tree propagation – p. 14/25

Page 37: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Join tree construction

Another example

A1

A2 A3

A4 A5 A6

11

1 1

2A2, A4

A1, A2, A3

A2, A3, A5

A2, A3, A5

A2, A4

A1, A2, A3

A2, A3, A5

A2, A3, A5

Junction tree propagation – p. 14/25

Page 38: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Junction tree construction

Correctness

Let (V,→) be a triangulated graph, (C, E∗). Every maximal spanning tree (C, E) of (C, E∗) isa join tree for V (Jensen,Jensen 1994).

If (V,→) is the triangulated moral graph of a Bayesian network, then there exists for everyV ∈ V a clique C ∈ C with {V } ∪ pa(V ) ⊆ C.

Junction tree propagation – p. 15/25

Page 39: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Propagation in junction trees

Initialization

Let T be a join tree for the domain graph G with potentials Φ. A junction tree for G consistsof T with the additions:

◮ each potential φ from Φ is assigned to a clique containing dom (φ).

◮ each link has a separator attached.

◮ each separator contains two mailboxes, one for each direction.

Example

Junction tree propagation – p. 16/25

Page 40: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Propagation in junction trees

Propagation

To calculate P (A4) we find a clique (V6) containing A4 and send messages to that clique.Example

V4 : A1, A2, A3

↓ ↓

S4 : A2 S2 : A2, A3 S1 : A3

V6 : A2, A4 V2 : A2, A3, A5 V1 : A3, A6

φ1, φ2, φ3

φ4 φ5 φ6

↑ ↑ ↑ψ4

ψ2 = φ↓S2

5 ψ1 = φ↓S1

6

Junction tree propagation – p. 17/25

Page 41: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Propagation in junction trees

Propagation

To calculate P (A4) we find a clique (V6) containing A4 and send messages to that clique.Example

1 : ψ1 = φ↓S1

6

↑1 : ψ2 = φ↓S2

5

V4 : A1, A2, A3

↓ ↓

S4 : A2 S2 : A2, A3 S1 : A3

V6 : A2, A4 V2 : A2, A3, A5 V1 : A3, A6

φ1, φ2, φ3

φ4 φ5 φ6

↑ ↑

Junction tree propagation – p. 17/25

Page 42: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Propagation in junction trees

Propagation

To calculate P (A4) we find a clique (V6) containing A4 and send messages to that clique.Example

↑ ↑ ↑1 : ψ1 = φ↓S1

61 : ψ2 = φ↓S2

5

V4 : A1, A2, A3

↓ ↓

S4 : A2 S2 : A2, A3 S1 : A3

V6 : A2, A4 V2 : A2, A3, A5 V1 : A3, A6

φ1, φ2, φ3

φ4 φ5 φ6

2 : ψ4 = . . .

ψ4 =P

A1φ1φ2

P

A3φ3ψ1ψ2

Now evidence has been collected to V4 and we get P (A4) =P

A2φ4ψ4.

Junction tree propagation – p. 17/25

Page 43: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Propagation in junction trees

Propagation

To calculate P (Ai) for any Ai we send messages away from V6.

Example continued

↑ ↑ ↑1 : ψ1 = φ↓S1

61 : ψ2 = φ↓S2

5

V4 : A1, A2, A3

↓ ↓

S4 : A2 S2 : A2, A3 S1 : A3

V6 : A2, A4 V2 : A2, A3, A5 V1 : A3, A6

φ1, φ2, φ3

φ4 φ5 φ6

2 : ψ4 = . . .

ψ4 =P

A1φ1φ2

P

A3φ3ψ1ψ2

Junction tree propagation – p. 18/25

Page 44: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Propagation in junction trees

Propagation

To calculate P (Ai) for any Ai we send messages away from V6.

Example continued

φ6

↑ ↑ ↑1 : ψ1 = φ↓S1

61 : ψ2 = φ↓S2

5

V4 : A1, A2, A3

↓ ↓

S4 : A2 S2 : A2, A3 S1 : A3

V6 : A2, A4 V2 : A2, A3, A5 V1 : A3, A6

φ1, φ2, φ3

φ4 φ5

2 : ψ4 = . . .

3 : ψ4 = φ↓A2

4

Junction tree propagation – p. 18/25

Page 45: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Propagation in junction trees

Propagation

To calculate P (Ai) for any Ai we send messages away from V6.

Example continued

φ5

V6 : A2, A4 V2 : A2, A3, A5 V1 : A3, A6

φ1, φ2, φ3

φ4 φ6

↑ ↑ ↑1 : ψ1 = φ↓S1

61 : ψ2 = φ↓S2

5

V4 : A1, A2, A3

↓ ↓

S4 : A2 S2 : A2, A3 S1 : A3

4 : ψ2 = . . . 4 : ψ1 = . . .

ψ2 =P

A1ψ1φ1φ2φ3ψ4 ∼ {ψ4,

P

A1φ1φ2φ3, ψ1}

ψ1 =P

A2ψ2ψ4

P

A1φ1φ2φ3

2 : ψ4 = . . .

3 : ψ4 = φ↓A2

4

Junction tree propagation – p. 18/25

Page 46: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Propagation in junction trees

In general: Sending a message from Ci to Cj

CiCj

Cl

Cm

mij

mli

mmi

mij :=X

Cj\Ci

Y

φ∈ΦCi

φY

Ck∈nd(Ci)

mki

Junction tree propagation – p. 19/25

Page 47: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Exact Inference

Messages passing in general

R

Collect and distribute messages

i) Collect messages to a preselected root R

Junction tree propagation – p. 20/25

Page 48: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Exact Inference

Messages passing in general

R

1

11

Collect and distribute messages

i) Collect messages to a preselected root R

Junction tree propagation – p. 20/25

Page 49: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Exact Inference

Messages passing in general

R2

1

1

2

1

Collect and distribute messages

i) Collect messages to a preselected root R

Junction tree propagation – p. 20/25

Page 50: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Exact Inference

Messages passing in general

R2

1

1

2

1

3

3

Collect and distribute messages

i) Collect messages to a preselected root R

ii) Distribute messages away from the root R

Junction tree propagation – p. 20/25

Page 51: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Exact Inference

Messages passing in general

42

1

1

2

1

R

3

4

3

4

Collect and distribute messages

i) Collect messages to a preselected root R

ii) Distribute messages away from the root R

Junction tree propagation – p. 20/25

Page 52: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Propagation in junction trees

Theorem

Let the junction tree T represent the Bayesian network BN over the universe U and withevidence e. Assume that T is full.

1. Let V be a clique with set of potentials ΦV , and let S1, . . . , Sk be V ’s neighboringseparators and with V -directed messages Ψ1, . . . ,Ψk. Then

P (V, e) =Y

ΦV

Y

Ψ1 · . . . ·Y

Ψk.

2. Let S be a separator with the sets ΨS and ΨS in the mailboxes. Then

P (S, e) =Y

ΨS

Y

ΨS .

Junction tree propagation – p. 21/25

Page 53: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Propagation in junction trees

Theorem

Let the junction tree T represent the Bayesian network BN over the universe U and withevidence e. Assume that T is full.

1. Let V be a clique with set of potentials ΦV , and let S1, . . . , Sk be V ’s neighboringseparators and with V -directed messages Ψ1, . . . ,Ψk. Then

P (V, e) =Y

ΦV

Y

Ψ1 · . . . ·Y

Ψk.

2. Let S be a separator with the sets ΨS and ΨS in the mailboxes. Then

P (S, e) =Y

ΨS

Y

ΨS .

Evidence

Evidence is inserted by adding corresponding 0/1-potentials to the appropriate cliques.

Junction tree propagation – p. 21/25

Page 54: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Triangulation of graphs

So far we have assumed that the domain graph is triangulated. If this is not the case, thenwe embed it in a triangulated graph.

Example

Junction tree propagation – p. 22/25

Page 55: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Triangulation of graphs

So far we have assumed that the domain graph is triangulated. If this is not the case, thenwe embed it in a triangulated graph.

Example

A triangulated graph extending (b)

Junction tree propagation – p. 22/25

Page 56: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Triangulation of graphs

1 2

3 4

765

8

Junction tree propagation – p. 23/25

Page 57: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Triangulation of graphs

1 2

3 4

765

8

A heuristic

Repeatedly eliminate a simplicial node, and if this is not possible eliminate a node minimizing(fa(X) are noneliminated neighbors of X):

◮ |fa(X)| (fill-in-size ).

Junction tree propagation – p. 23/25

Page 58: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Triangulation of graphs

1 2

3 4

765

8

1,2,3 2,4,7

3,6,72,3,7

5,6,7,8

1

1

1

2 2

2

2

A heuristic

Repeatedly eliminate a simplicial node, and if this is not possible eliminate a node minimizing(fa(X) are noneliminated neighbors of X):

◮ |fa(X)| (fill-in-size ).

Junction tree propagation – p. 23/25

Page 59: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Triangulation of graphs

1 2

3 4

765

8

1,2,3 2,4,7

3,6,72,3,7

5,6,7,8

1

1

1

2 2

2

2

A heuristic

Repeatedly eliminate a simplicial node, and if this is not possible eliminate a node minimizing(fa(X) are noneliminated neighbors of X):

◮ |fa(X)| (fill-in-size ).

Junction tree propagation – p. 23/25

Page 60: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Triangulation of graphs

1 2

3 4

765

8

1,2,3 2,4,7

3,6,72,3,7

5,6,7,8

A heuristic

Repeatedly eliminate a simplicial node, and if this is not possible eliminate a node minimizing(fa(X) are noneliminated neighbors of X):

◮ |fa(X)| (fill-in-size ).

Junction tree propagation – p. 23/25

Page 61: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Triangulation of graphs

1 2

3 4

765

8

1 2

3 4

765

8

A heuristic

Repeatedly eliminate a simplicial node, and if this is not possible eliminate a node minimizing(fa(X) are noneliminated neighbors of X):

◮ |fa(X)| (fill-in-size ).

Junction tree propagation – p. 23/25

Page 62: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Triangulation of graphs

1 2

3 4

765

8

1 2

3 4

765

8

A heuristic

Repeatedly eliminate a simplicial node, and if this is not possible eliminate a node minimizing(fa(X) are noneliminated neighbors of X):

◮ |fa(X)| (fill-in-size ).

Junction tree propagation – p. 23/25

Page 63: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Triangulation of graphs

1 2

3 4

765

8

1 2

3 4

765

8

A heuristic

Repeatedly eliminate a simplicial node, and if this is not possible eliminate a node minimizing(fa(X) are noneliminated neighbors of X):

◮ |fa(X)| (fill-in-size ).

Junction tree propagation – p. 23/25

Page 64: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Triangulation of graphs

1 2

3 4

765

8

1 2

3 4

765

8

A heuristic

Repeatedly eliminate a simplicial node, and if this is not possible eliminate a node minimizing(fa(X) are noneliminated neighbors of X):

◮ |fa(X)| (fill-in-size ).

Junction tree propagation – p. 23/25

Page 65: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Triangulation of graphs

1 2

3 4

765

8

1 2

3 4

765

8

A heuristic

Repeatedly eliminate a simplicial node, and if this is not possible eliminate a node minimizing(fa(X) are noneliminated neighbors of X):

◮ |fa(X)| (fill-in-size ).

Junction tree propagation – p. 23/25

Page 66: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Triangulation of graphs

1 2

3 4

765

8

1 2

3 4

765

8

A heuristic

Repeatedly eliminate a simplicial node, and if this is not possible eliminate a node minimizing(fa(X) are noneliminated neighbors of X):

◮ |fa(X)| (fill-in-size ).

◮ | sp(fa(X)) | (clique-size).

◮P

{Y,Z}:{Y,Z}∈nb(X)∧Z 6∈nb(Y ) | sp({Y, Z}) | (fill-in-weight)

Junction tree propagation – p. 23/25

Page 67: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Triangulation of graphs

1 2

3 4

765

8

1 2

3 4

765

8

Usually there are many possible triangulations and finding the best one is NP-hard!

Junction tree propagation – p. 23/25

Page 68: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Summary

1 2

3 4

765

8

Bayesian network

Junction tree propagation – p. 24/25

Page 69: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Summary

1 2

3 4

765

8

1 2

3 4

765

8

Bayesian network Moral graph

Junction tree propagation – p. 24/25

Page 70: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Summary

1 2

3 4

765

8

1 2

3 4

765

8

1 2

3 4

765

8

Bayesian network Moral graph Triangulated graph

Junction tree propagation – p. 24/25

Page 71: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Summary

1 2

3 4

765

8

1 2

3 4

765

8

1 2

3 4

765

8

Bayesian network Moral graph Triangulated graph

1,2,3 2,4,7

3,6,72,3,7

5,6,7,8

Join graph

Junction tree propagation – p. 24/25

Page 72: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Summary

1 2

3 4

765

8

1 2

3 4

765

8

1 2

3 4

765

8

Bayesian network Moral graph Triangulated graph

1,2,3 2,4,7

3,6,72,3,7

5,6,7,8

1,2,3 2,4,7

3,6,72,3,7

5,6,7,8

Join graph Join tree

Junction tree propagation – p. 24/25

Page 73: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Summary

1 2

3 4

765

8

1 2

3 4

765

8

1 2

3 4

765

8

Bayesian network Moral graph Triangulated graph

1,2,3 2,4,7

3,6,72,3,7

5,6,7,8

1,2,3 2,4,7

3,6,72,3,7

5,6,7,8

6,7

1,2,3 2,4,7

3,6,72,3,7

5,6,7,8

2,3 2,7

3,7

Join graph Join tree Junction tree

Junction tree propagation – p. 24/25

Page 74: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Exact Inference

Summary

Given: Bayesian network BN for P (V)

Junction tree propagation – p. 25/25

Page 75: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Exact Inference

Summary

Given: Bayesian network BN for P (V)

⇓ Moralize

Domain graph G for BN (also called the moral graph)

Junction tree propagation – p. 25/25

Page 76: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Exact Inference

Summary

Given: Bayesian network BN for P (V)

⇓ Moralize

Domain graph G for BN (also called the moral graph)

⇓ Triangulate

Triangulated graph for G

Junction tree propagation – p. 25/25

Page 77: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Exact Inference

Summary

Given: Bayesian network BN for P (V)

⇓ Moralize

Domain graph G for BN (also called the moral graph)

⇓ Triangulate

Triangulated graph for G

⇓ Find cliques

Join graph

Junction tree propagation – p. 25/25

Page 78: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Exact Inference

Summary

Given: Bayesian network BN for P (V)

⇓ Moralize

Domain graph G for BN (also called the moral graph)

⇓ Triangulate

Triangulated graph for G

⇓ Find cliques

Join graph

⇓ Find maximal spanning tree

Join tree

Junction tree propagation – p. 25/25

Page 79: Junction tree propagation - BNDG 4-4 · 2008. 5. 19. · Join Tree (Junction Tree) Let G be the set of cliques from an undirected graph, and let the cliques of G be organized in a

Exact Inference

Summary

Given: Bayesian network BN for P (V)

⇓ Moralize

Domain graph G for BN (also called the moral graph)

⇓ Triangulate

Triangulated graph for G

⇓ Find cliques

Join graph

⇓ Find maximal spanning tree

Join tree

Perform belief updating by message passing.

Junction tree propagation – p. 25/25