SLIDE 9 Apply AC-3 (partially)
{1, 2, 3, 4} : ('A', 'B') : {1, 2, 4} {1, 2, 3, 4} : ('A', 'D') : {1, 2, 3, 4} {1, 2, 3, 4} : ('A', 'E') : {1, 2, 3, 4} {1, 2, 4} : ('B', 'A') : {1, 2, 3, 4} {1, 2, 4} : ('B', 'C') : {1, 3, 4} {1, 2, 4} : ('B', 'D') : {1, 2, 3, 4} {1, 2, 4} : ('B', 'E') : {1, 2, 3, 4} {1, 3, 4} : ('C', 'B') : {1, 2, 4} {1, 3, 4} : ('C', 'D') : {1, 2, 3, 4} {1, 3, 4} : (‘C', 'E') : {1, 2, 3, 4} {1, 2, 3, 4} : ('D', 'A') : {1, 2, 3, 4} {1, 2, 3, 4} : ('D', 'B') : {1, 2, 4} {1, 2, 3, 4} : ('D', 'C') : {1, 3, 4} {1, 2, 3, 4} : ('D', 'E') : {1, 2, 3, 4} {1, 2, 3, 4} : ('E', 'A') : {1, 2, 3, 4} {1, 2, 3, 4} : ('E', 'B') : {1, 2, 4} {1, 2, 3, 4} : ('E', 'C') : {1, 3, 4} {1, 2, 3, 4} : ('E', 'D') : {1, 2, 3, 4} Initial Queue {2, 3, 4} : ('A', 'B') : {2, 4} { 2, 4} : ('B', 'C') : {1, 3} {2, 4} : ('B', 'D') : {2, 3, 4} { 3} : ('C', 'D') : {2, 3, 4}
Note: Domains are not part of the Arc queue.
Final Result:
{'A': {4}, 'B': {2}, 'C': {3}, 'D': {4}, 'E': {1}}
End of queue:
33
Path Consistency
Note that arc consistency does not help us out for the map coloring problem!
It only looks at pairs of variables. We require something stronger: Definition A two variable set is path consistent with respect to a 3rd variable if, for every assignment consistent with the constraints on , there is an assignment to that satisfies the constraints on and .
{Xi, Xj} Xm {Xi = a, Xj = b} {Xi, Xj} Xm {Xi, Xm} {Xm, Xj}
Xi ⟶ Xm ⟶ Xj
Triples of variables
Etc.
{r, g, b}WA ⟶ NT{r, g, b} {r, g, b}NT ⟶ WA{r, g, b} {r, g, b}WA ⟶ SA{r, g, b} {r, g, b}SA ⟶ WA{r, g, b}
34
K-Consistency
A CSP is -consistent if, for any set of variables and for any consistent assignment to those variables, a consistent value can always be found for the th variable.
k k − 1 k 1-consistency: node consistency 2-consistency: arc consistency 3-consistency: path consistency (for binary constraint graphs)
A CSP is strongly -consistent if it is -consistent and is also consistent, consistent, ...., -consistent.
k k k − 1 k − 2 1
In this case, we can find a solution in . but establishing -consistency takes time exponential in in the worst case and space exponential in
O(n2d) n n n! 35
Local Search for CSPs
constraints violated by a particular value, given the rest of the current assignment. CONFLICTS(csp, var, v, current)
36