comparison toolboxes/FullBNT-1.0.7/graph/findroot.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 function root = findroot(bnet, cliques)
2
3 %% findroot is to find the strong root in a clique tree assume it has one
4 %% in the tree. For a clique tree constructed from a strongly triangulated
5 %% graph, an interface clique that contains all discrete parents
6 %% and at least one continuous node from a connected continuous component
7 %% is for sure to be available as a guaranteed strong root.
8 %% -By Wei Sun, George Mason University, 4/17/2010.
9
10 %% We choose the interface clique that contains the max number
11 %% of interface nodes to be the strong root.
12 n0 = 0 ;
13 for i=1:length(cliques)
14 % check hybrid cliques
15 hc = intersect(cliques{i}, bnet.cnodes) ;
16 hd = intersect(cliques{i}, bnet.dnodes) ;
17 if ~isempty(hd) & ~isempty(hc)
18 nd = length(hd) ;
19 if nd > n0
20 root = i ;
21 n0 = nd ;
22 end
23 end
24 end