In the dual graph, some constraints may be unnecessary. Indeed, dual constraints enforces equality of original variables, and some constraints may be redundant because of transitivity of equality. For example, if C_2 and C_1 are joined by an edge whose label contains y, and so are C_1 and C_3, equality of y in all three dual variables is guaranteed. As a result, a dual constraint between C_2 and C_3 enforcing equality of y is not necessary, and could be removed if present. A graph obtained from the dual graph by removing some redundant edges is called a
join graph. If it is a tree, it is called a
join tree. The dual problem can be solved from a join graph since all removed edges are redundant. In turn, the problem can be solved efficiently if that join graph is a tree, using algorithms tailored for acyclic constraint satisfaction problems. Finding a join tree, if any, can be done exploiting the following property: if a dual graph has a join tree, then the maximal-weight
spanning trees of the graph are all join trees, if edges are weighted by the number of variables the corresponding constraints enforce to be equal. An algorithm for finding a join tree, if any, proceeds as follows. In the first step, edges are assigned weights: if two nodes represent constraints that share n variables, the edge joining them is assigned weight n. In the second step, a maximal-weight spanning tree is searched for. Once one is found, it is checked whether it enforces the required equality of variables. If this is the case, this spanning tree is a join tree. Another method for finding out whether a constraint satisfaction problem has a join tree uses the primal graph of the problem, rather than the dual graph. The
primal graph of a constraint satisfaction problem is a graph whose nodes are problem variables and whose edges represent the presence of two variables in the same constraint. A join tree for the problem exists if: • the primal graph is
chordal; • the variables of every
maximal clique of the primal graph are the scope of a constraint and vice versa; this property is called
conformality. In turn, chordality can be checked using a
max-cardinality ordering of the variables. Such an ordering can also be used, if the two conditions above are met, for finding a join tree of the problem. Ordering constraints by their highest variable according to the ordering, an algorithm for producing a join tree proceeds from the last to the first constraint; at each step, a constraint is connected to the constraint that shares a maximal number of variables with it among the constraints that precede it in the ordering. ==Extensions==