Naturally, I try to be clever, and I don't generate all possible solutions and then weed out the bad ones. I generate only those solutions which don't violate my rules.
In the case of a "missing" stack, i.e. a stack which has not been constructed but which is needed by my adjacency method, I take the easy way out: I simply construct the stack. The missing stack will always be a stack over an open interval, so the time required for constructing that stack should b pretty small. Another alternative would be a modified algorithm which deals with two adjacent stacks and not three. The function which determines adjacencies in any situation is:
L <- ADJ_2D(_PARTc,c_l,c_r,P,J)It calls:
ADJ_2D_CONSTRUCT(c,P2)to construct missing stacks. To decide between multiple possible adjacency assignments it uses: