annotate toolboxes/FullBNT-1.0.7/graph/check_jtree_property.m @ 0:cc4b1211e677
tip
initial commit to HG from
Changeset:
646 (e263d8a21543) added further path and more save "camirversion.m"
author |
Daniel Wolff |
date |
Fri, 19 Aug 2016 13:07:06 +0200 |
parents |
|
children |
|
rev |
line source |
Daniel@0
|
1 function check_jtree_property(cliques_containing_node, jtree)
|
Daniel@0
|
2 % CHECK_JTREE_PROPERTY Raise an error if the graph does not satisfy the join tree property.
|
Daniel@0
|
3 % check_jtree_property(cliques_containing_node, jtree_adj_mat)
|
Daniel@0
|
4 %
|
Daniel@0
|
5 % The join tree property says:
|
Daniel@0
|
6 % For each node n in the dag, compute the node-induced subgraph G by looking at all the cliques
|
Daniel@0
|
7 % that contain n, and make sure G forms a connected graph.
|
Daniel@0
|
8 % This ensures that local propagation leads to global consistency.
|
Daniel@0
|
9
|
Daniel@0
|
10 num_bn_nodes = length(cliques_containing_node);
|
Daniel@0
|
11 directed = 0;
|
Daniel@0
|
12 for i=1:num_bn_nodes
|
Daniel@0
|
13 cs = cliques_containing_node{i};
|
Daniel@0
|
14 G = jtree(cs,cs);
|
Daniel@0
|
15 if ~connected_graph(G, directed)
|
Daniel@0
|
16 error(['node ' num2str(i) ' violates jtree property']);
|
Daniel@0
|
17 end
|
Daniel@0
|
18 end
|