3. The MUSE CSP Arc Consistency Algorithm

3.1. CSP Arc Consistency: AC-4

AC-4 builds and maintains several data structures, described in Figure 16, to allow it to efficiently achieve arc consistency in a CSP. Note that we have modified the notation slightly to eliminate subscripts (which become quite cumbersome for the path consistency algorithm). Figure 17 shows the code for initializing the data structures, and Figure 18 contains the algorithm for eliminating inconsistent labels from the domains. This algorithm requires tex2html_wrap_inline19291 ) time, where e is the number of constraint arcs, and l is the domain size [Mohr & Henderson, 1986].

   figure15632
Figure 16: Data structures and notation for the arc consistency algorithm, AC-4.

In AC-4, if the label tex2html_wrap_inline18711 is compatible with tex2html_wrap_inline19359 , then a supports b (and vice versa). To keep track of how much support each label a has, the number of labels in tex2html_wrap_inline18909 which are compatible with a in tex2html_wrap_inline19371 are counted and the total stored in Counter[(i,j), a] by the algorithm in Figure 17. If any Counter[(i,j), a] is zero, then a is removed from tex2html_wrap_inline19371 (because it cannot appear in any solution), the ordered pair (i,a) is placed on the List, and M[i,a] is set to 1 (to avoid removing the element a from tex2html_wrap_inline19371 more than once). The algorithm must also keep track of which labels that label a supports by using S[i, a], a set of arc and label pairs. For example, S tex2html_wrap_inline19395 means that a in tex2html_wrap_inline19371 supports b and c in tex2html_wrap_inline18909 . If a is ever removed from tex2html_wrap_inline19371 , then b and c will loose some of their support.

After the preprocessing step in Figure 17, the algorithm in Figure 18 loops until List becomes empty, at which point the CSP is arc consistent. When (i,a) is popped off List by this procedure, for each element (j,b) in S[i,a], Counter[(j,i), b] is decremented. If Counter[(j,i), b] becomes zero, b would be removed from tex2html_wrap_inline18909 , (j,b) placed on List, and M[j,b] set to 1.

   figure15725
Figure 17: Initialization of the data structures for AC-4.

   figure15769
Figure 18: Eliminating inconsistent labels from the domains in AC-4.

Next, we describe the MUSE arc consistency algorithm for a MUSE CSP, called MUSE AC-1. We purposely keep our notation and presentation of MUSE AC-1 as close as possible to that of AC-4 so that the reader can benefit from the similarity of the two algorithms.



3.2. MUSE AC-1