Here is the algorithm I am trying to implement in Java... (Didn't fully format correctly, so it may be easier to view it at this link, just scroll up half a page from where it brings you http://artint.info/html/ArtInt_79.html#AC-3-fig )
1: procedure GAC(V,dom,C)
2: Inputs
3: V: a set of variables
4: dom: a function such that dom ( X ) is the domain of variable X
5: C: set of constraints to be satisfied
6: Output
7: arc-consistent domains for each variable
8: Local
9: D X is a set of values for each variable X
10: TDA is a set of arcs
11: for each variable X do
12: D X ← dom ( X )
13: TDA ← {? X,c ?| c ∈ C and X ∈ scope ( c )}
14: while TDA ?= {} do
15: select ? X,c ? ∈ TDA;
16: TDA ← TDA \ {(X,c)} ;
17: ND X ← { x | x ∈ D X and some { X = x,Y 1 = y 1 ,...,Y k = y k } ∈ c where y i ∈ D Y i for all i }
18: if ND X ?= D X then
19: TDA ← TDA ∪ {? Z,c ? ?| X ∈ scope ( c ? ) , c ? is not c, Z ∈ scope ( c ? ) \ { X }}
20: D X ← ND X
21: return { D X | X is a variable }
I'm not understanding what line 16 & 17 are doing exactly. By "TDA ← TDA \ {(X,c)} ;" in line 16, does the backslash mean that we remove that arc from TDA?
Then, in line 17, it seems we are saying that the new domain of X is whatever was already in the old domain, ANDed with everything that does/doesn't fulfill the constraint. Is that basically correct?