Unions to bound the cost of a tree. Use of unions to bound the cost during a local search. Shade areas enclose disjoint sets of vertices in the tree. Suppose that we merge all the RAG’s of each vertex set using Algorithm 3 to produce the unions X, Y, and Z. Then we can heuristically bound d(A,B) as d(X,Y)≤ minA∈C,B∈D d(A,B), where d is the distance as calculated using the Affine-DO alignment algorithm.