It has been proved that AC in the HVE is equivalent to GAC in the nonbinary problem [Stergiou WalshStergiou Walsh1999]. Since the HVE is a binary CSP, one obvious way to apply AC is by using a generic AC algorithm. However, this results in redundant processing and an asymptotic time complexity worse than . To be precise, in the HVE of a problem with ary constraints we have binary constraints between dual and original variables. On such a constraint, AC can be enforced with worstcase time complexity. For the whole problem the complexity is .
Instead, we will now describe a simple AC algorithm that operates in the HVE and achieves the same worstcase time complexity as an optimal GAC algorithm applied in the nonbinary representation. We can achieve this by slightly modifying the GAC algorithm of Bessiére and Régin br01 (GAC2001). In Figure 3 we sketch the AC algorithm for the HVE, which we call HAC (Hidden AC).

The HAC algorithm uses a stack (or queue) of dual variables to propagate value deletions, and works as follows. In an initialization phase it iterates over each dual variable (line 2). For every original variable constrained with the algorithm revises the constraint between and . This is done by calling function (line 4). During each revision, for each value of we look for a tuple in the domain of that supports it. As in AC2001, we store : the most recent tuple we have found in that supports value of variable ^{2}. If this tuple has not been deleted from then we know that is supported. Otherwise, we look for a new supporting tuple starting from the tuple immediately after . If no such tuple is found then is removed from (line 21). In that case, all tuples that include that value are removed from the domains of the dual variables that are constrained with (lines 2223). If these dual variables are not already in the stack they are added to it^{3}. Then, dual variables are removed from the stack sequentially. For each dual variable that is removed from the stack, the algorithm revises the constraint between and each original variable constrained with . The algorithm terminates if all the values in a domain are deleted, in which case the problem is not arc consistent, or if the stack becomes empty, in which case the problem is arc consistent.
The main difference between HAC and GAC2001 is that GAC2001 does not include lines 2224. That is, even if the nonbinary constraints are given in extension, GAC2001 does not remove tuples that become invalid from the lists of allowed tuples. As a result, the two algorithms check for the validity of a tuple (in lines 17 and 18) in different ways. Later on in this section we will explain this in detail. Apart from this difference, which is important because it affects their run times, the two algorithms are essentially the same. We can move from HAC to GAC2001 by removing lines 2224 and substituting any references to dual variables by references to the corresponding constraints. For example, corresponds to in GAC2001, i.e. the last tuple in constraint that supports value of variable . Note that in such an implementation of GAC2001, propagation is constraintbased. That is, the algorithm utilizes a stack of constraints to perform the propagation of value deletions.