{NEW}
H := incorporate order(H, O);
if H contains all the edges in S then return false for each leaf N of T do if not all vertices of N are connected in H then N label := m :
for each connected component I of N .symbols in H do construct node M as a new child of N in T ;
M symbols:= the vertices of I ;
endfor endif for each constraint α < b ∈ O
if a is in M symbols and b is in P symbols where M and P are different children of N
then add an ordering arc from M to P ;
endif endfor endfor
{NEW}
{NEW}
{NEW}
{NEW}
{NEW}
S := the subset of constraints in S whose long is in H ;
m := m = 1; until S is empty; for each leaf N of T
N label := 0; if N symbols has more than one symbol then create a leaf of N for each symbol in N symbols; label each such leaf 0; endif end for end solve constraints2.

{NEW}
function incorporate order(in H : undirected graph; O : a system of constraints of the form a < b )
return undirected graph; variables: G : directed graph; a, b : vertices in H :
A, B : connected components of H ;
V[A] : array of vertices of G indexed on connected components of H ;
I : subset of vertices of G ;
for each connected component A of H create a vertex V [ A ] in G ; for each constraint α < b ∈ O
let A and B be the connected components of H containing a and b respectively; if A ̸= B then add an arc in G from V [ A ] to V [ B ] endif endfor; for each strongly connected component I of G do for each pair of distinct vertices V [ A ], V [ B ] ∈ I do for each a ∈ A and b ∈ B add the edge ab to H endfor endfor endfor