Decomposition
Battery Age Alternator Fan Belt
BatteryCharge Delivered
Battery Power
Starter
Radio Lights Engine Turn Over
Gas Gauge
Gas
Leak
Fuel Line
Distributor
Spark Plugs
Engine Start
Decomposition
Battery Age Alternator Fan Belt
BatteryCharge Delivered
Battery Power
Starter
Radio Lights Engine Turn Over
Gas Gauge
Gas
Leak
Fuel Line
Distributor
Spark Plugs
Engine Start
Decomposition
Battery Age Alternator Fan Belt
BatteryCharge Delivered
Battery Power
Starter
Radio Lights Engine Turn Over
Gas Gauge
Gas
Leak
Fuel Line
Distributor
Spark Plugs
Engine Start
DecompositionBattery Age Alternator Fan Belt
BatteryCharge Delivered
Battery Power
Starter
Radio Lights Engine Turn Over
Gas Gauge
Gas
Leak
Fuel Line
Distributor
Spark Plugs
Engine Start
LP RP*
DecompositionBattery Age Alternator Fan Belt
BatteryCharge Delivered
Battery Power
Starter
Radio Lights Engine Turn Over
Gas Gauge
Gas
Leak
Fuel Line
Distributor
Spark Plugs
Engine Start
LP RP*
Causal Network
Battery Age Alternator Fan Belt
BatteryCharge Delivered
Battery Power
Starter
Radio Lights Engine Turn Over
Gas Gauge
Gas
Leak
Fuel Line
Distributor
Spark Plugs
Engine Start
Causal Network
Battery Age Alternator Fan Belt
BatteryCharge Delivered
Battery Power
Starter
Radio Lights Engine Turn Over
Gas Gauge
Gas
Leak
Fuel Line
Distributor
Spark Plugs
Engine Start
Case AnalysisBattery Age Alternator Fan Belt
Battery
Charge Delivered
Battery Power
Starter
Radio Lights Engine Turn Over
Gas Gauge
Gas
Leak
Fuel Line
Distributor
Spark Plugs
Engine Start
Case I
Battery Age Alternator Fan Belt
Battery
Charge Delivered
Battery Power
Starter
Radio Lights Engine Turn Over
Gas Gauge
Gas
Leak
Fuel Line
Distributor
Spark Plugs
Engine Start
Case II
Case AnalysisBattery Age Alternator Fan Belt
Battery
Charge Delivered
Battery Power
Starter
Radio Lights Engine Turn Over
Gas Gauge
Gas
Leak
Fuel Line
Distributor
Spark Plugs
Engine Start
Battery Age Alternator Fan Belt
Battery
Charge Delivered
Battery Power
Starter
Radio Lights Engine Turn Over
Gas Gauge
Gas
Leak
Fuel Line
Distributor
Spark Plugs
Engine Start
Case I Case II
LP * RP
Case AnalysisBattery Age Alternator Fan Belt
Battery
Charge Delivered
Battery Power
Starter
Radio Lights Engine Turn Over
Gas Gauge
Gas
Leak
Fuel Line
Distributor
Spark Plugs
Engine Start
Battery Age Alternator Fan Belt
Battery
Charge Delivered
Battery Power
Starter
Radio Lights Engine Turn Over
Gas Gauge
Gas
Leak
Fuel Line
Distributor
Spark Plugs
Engine Start
Case I Case II
LP * RP LP * RP+
Case AnalysisBattery Age Alternator Fan Belt
BatteryCharge Delivered
Battery Power
Starter
Radio Lights Engine Turn Over
Gas Gauge
Gas
Leak
Fuel Line
Distributor
Spark Plugs
Engine Start
LP * RP LP * RP+
Battery Age Alternator Fan Belt
Battery
Charge Delivered
Battery Power
Starter
Radio Lights Engine Turn Over
Gas Gauge
Gas
Leak
Fuel Line
Distributor
Spark Plugs
Engine Start
Battery Age Alternator Fan Belt
Battery
Charge Delivered
Battery Power
Starter
Radio Lights Engine Turn Over
Gas Gauge
Gas
Leak
Fuel Line
Distributor
Spark Plugs
Engine Start
• Decomposition and Case Analysis can answer any query
• Non-Deterministic!
Dtrees
Generation from– Elimination orders– Jointree– hMeTiS hypergraph
partitioning program
a a’
.60 .40
b b’
a .90 .10
a’ .20 .80
d d’
c .50 .50
c’ .40 .60
e e’
bd .25 .75
bd’ .25 .75
b’d .90 .10
b’d’ .05 .95
c c’
b .70 .30
b’ .15 .85
A B C D
E
A C
B
D
• Cutset
B B
BC
• Context• Cluster
• Vars
A AB
AB BCDE
BC
CD BDE
BCDE
RC1
RC1(T,e)if T is a leaf node
return Lookup(T,e)
else p := 0
for each instantiation c of cutset(T)-E dop := p + RC1(Tl,ec) RC1(Tr,ec)
return p
Lookup(T,e)X|U : CPT associated with leaf T
If X is instantiated in e, thenx: value of X in e
u: value of U in e
Return x|u
Else return 1 = xx|u
Computational Complexity• Given
– DAG with n nodes– elimination order of width w
• Can construct a dtree in O(n log n) time:– Height O(log n)– cutset width <= w+1– a-cutset width O(w log n)
• Time complexity: O(n cw log n)
• Cutset Conditioning: O(n cs)
Network Effective Network
Size
Elimination-Order Width
Loop-Cutset Width
A-Cutset Width
1 Water 59.0 21.3 29.5 32.32 Midlew 108.4 19.7 39.3 45.93 Barley 138.0 21.8 57.3 51.14 Diabetes 1349.1 19.2 557.2 77.95 Link 922.7 28.0 347.0 70.76 Pigs 699.0 16.4 144.2 38.07 Munin1 410.3 26.4 122.6 51.78 Munin2 2202.7 20.0 495.9 54.69 Munin3 2293.4 16.3 454.2 51.1
10 Munin4 2313.4 19.7 521.5 51.9
Decomposition Tree
A B C D E F
A
A B
B C
C D
D E E F
AB
C CC
.27
.39
ABCABCABCABC
ABC
ABCABC
ABC
A B C
Context(N)= A-Cutset(N)&Vars(N)
RC2
RC2(T,e)if T is a leaf node, return Lookup(T,e)
y := instantiation of context(T)
If cacheT[y] <> nil, return cacheT[y]
p := 0
for each instantiation c of cutset(T)-E dop := p + RC2(Tl,ec) RC2(Tr,ec)
cacheT[y] := p
return p
Constructing dtreesA
D
B
E
C
F
F E A B C D
A AB AC ABE BCD DF
DBC
A
W=2
DBC
AB ABC
Context <= w+1
Space: O(n cw
)
Constructing dtreesA
D
B
E
C
F
F E A B C D
A AB AC ABE BCD DF
D
BCDABC
W=2
AB ABC
Cluster<= w+1
Space: O(n cw
)Time: O(n c
w)
Hypergraph partitioningHypergraph partitioning
The problem of hypergraphpartitioning is well-studied
in VLSI design.….and is alive!
A hypergraph is a generalization of a graph, such that an edge is permitted to connect an arbitrary number of vertices, rather than exactly two.
The task of hypergraph partitioning is to find a way to split the vertices of a hypergraph into k approximately equal parts, such that the number of hyperedges connecting vertices in different parts is minimized.
An algorithm using hypergraph An algorithm using hypergraph partitioning to construct dtreespartitioning to construct dtrees
Given a DAG G, we first generate a hypergraph H that corresponds to G:
For each family F in G, we add a node NF to H. For each variable V in G, we add a hyperedge to H which connects all nodes NF such that V is a member of F.
Then we recursively invoke hypergraph partitioning to build a dtree:
The algorithm partitions the hypergraph into two sets of vertices, then recursively generates dtrees for each set, and finally combines the resulting dtrees into a new dtree (whose left child is the dtree for the first set, and whose right child is the dtree for the second set).
A AB
CDBC
A AB CDBC
A AB CDBC
For DAG:
A
CB
ED
F
HG
DFDF
AC ACE
EFH A AF
AB ABD
DFG
CC
EEHH
AAGG
BB
From dtrees to elimination ordersFrom dtrees to elimination orders
32
8 16
8
64 128
1024 512
1728 cache entries 64 cache entries
Time-Space TradeoffsTime-Space Tradeoffs
RC
RC(T,e)if T is a leaf node, return Lookup(T,e)
y := instantiation of context(T)
If cacheT[y] <> nil, return cacheT[y]
p := 0
for each instantiation c of cutset(T)-E dop := p + RC(Tl,ec) RC(Tr,ec)
If cacheT[y]? then cacheT[y] := p
return p
calls(T)=cutset#(Tp) [cf(Tp) context#(Tp) + (1-cf(Tp)) calls(Tp)]
When cf(T)=0 for every node T:
calls(T) = cutset#(Tp) calls(Tp)
When cf(T)=1 for every node T:
calls(T) = cutset#(Tp) context#(Tp) = cluster#(Tp)
exact count for discrete cache factors
Discrete Cache Factor Search
• Problem– Given X MB of cache memory for RC– Find a discrete caching scheme which has a
minimal running time where the amount of memory used by all the dtree node caches is no larger than X
Number of RC Calls
• Can estimate running time of RC
• Function of: – dtree– cache factors
pt
ppppp tcallstcftcontexttcftcutsettcalls *1**)(##
Different Cache Factors
1
2 3
4 5 6 7
cf=0
cf=1cf=01
2 3
4 5 6 7
cf=0
cf=0cf=0
1
2 3
4 5 6 7
cf=1
cf=0cf=01
2 3
4 5 6 7
cf=0
cf=1cf=1
1
2 3
4 5 6 7
cf=0
cf=0cf=1
1
2 3
4 5 6 7
cf=1
cf=1cf=0
1
2 3
4 5 6 7
cf=1
cf=0cf=11
2 3
4 5 6 7
cf=1
cf=1cf=1
20 sec65 sec35 sec
75 sec80 sec90 sec
30 sec 10 sec
Search Tree
1
2 3
4 5 6 7
cf=?
cf=?cf=?
1
2 3
4 5 6 7
cf=0
cf=?cf=?
No Caching
……
1
2 3
4 5 6 7
cf=1
cf=?cf=?
Full Caching
……
Cost Function
1
2 3
4 5 6 7
cf=?
cf=?cf=?
1
2 3
4 5 6 7
cf=0
cf=?cf=?1
2 3
4 5 6 7
cf=1
cf=?cf=?
… …… …
Cost Function
1
2 3
4 5 6 7
cf=?
cf=?cf=?
1
2 3
4 5 6 7
cf=0
cf=?cf=?1
2 3
4 5 6 7
cf=1
cf=1cf=1
… …… …
Admissible
Search Tree Pruning
• Memory-based pruning– Prune any branch which assigns more than the
total memory assigned to the algorithm
• Cost-based pruning– Prune any node whose cost function f(n) is
already larger than the current best goal node