wolffd@0: function check_jtree_property(cliques_containing_node, jtree) wolffd@0: % CHECK_JTREE_PROPERTY Raise an error if the graph does not satisfy the join tree property. wolffd@0: % check_jtree_property(cliques_containing_node, jtree_adj_mat) wolffd@0: % wolffd@0: % The join tree property says: wolffd@0: % For each node n in the dag, compute the node-induced subgraph G by looking at all the cliques wolffd@0: % that contain n, and make sure G forms a connected graph. wolffd@0: % This ensures that local propagation leads to global consistency. wolffd@0: wolffd@0: num_bn_nodes = length(cliques_containing_node); wolffd@0: directed = 0; wolffd@0: for i=1:num_bn_nodes wolffd@0: cs = cliques_containing_node{i}; wolffd@0: G = jtree(cs,cs); wolffd@0: if ~connected_graph(G, directed) wolffd@0: error(['node ' num2str(i) ' violates jtree property']); wolffd@0: end wolffd@0: end