The nine maximal cliques of this triangulation are
Every other nonempty clique is a subset of one of these. One junction tree, listing its separators after the edges, is
Each variable appears in a connected subtree, verifying the running intersection property. For example, the cliques containing are , and their connecting paths contain throughout.
Figure 1.
Maximal genotype cliques and separators for exact inference in the cousin-marriage pedigree
. Details.
The junction tree algorithm assigns every founder factor and every child-with-parents factor to one containing clique, and multiplies any observation or penetrance factors there. The junction-tree sum-product message from clique to clique sums out after multiplying the local potential and all incoming messages except 's. An inward pass sums the joint probability or pedigree likelihood; a subsequent outward pass gives each person's posterior genotype probabilities. This is the same variable-elimination principle as the Elston-Stewart algorithm, organized to handle the pedigree loop. Its largest clique has four genotype variables, much smaller than summing naively over fourteen at once.
The Elston-Stewart algorithm first sums over the child:
For each of the two parent states, the inner message requires two multiplications and one addition, totaling four multiplications and two additions. Multiplying each message by its two parent factors takes two further multiplications per parent state, totaling four. The final sum uses one addition. Therefore
Moving the sum inward saves four multiplications because the factors independent of the child genotype are evaluated only once per parent state.