40 likes | 279 Vues
Maintaining Arc Consistency. We have a constraint graph G of variables X 1 ,...X n, and constraint relations {X i  X j}, and each Xi has a value set V (X i ). An arc from Xi to Xj is consistent if v  V (X i ) w  V (X j )  v,w is consistent
                
                E N D
Maintaining Arc Consistency We have a constraint graph G of variables X1,...Xn, and constraint relations {XiXj}, and each Xi has a value set V(Xi ). An arc from Xi to Xj is consistent if v  V(Xi ) w  V(Xj)  v,w is consistent Conversely, an arc is inconsistent if  v  V(Xi )  w  V(Xj)  v,w is inconsistent. The arc can be made consistent by removing v. Q1 Q2 Q3 Q4
Arc Consistency (4 queens problem) Example 1 Remove a value v of Qx if there is a variable Qy such that v is inconsistent with all remaining values of Qy 4 3 2 1 Numbers indicate sequence of values that are deleted. Q1 Q2 Q3 Q4 Starting with Q1=1, arc consistency check proves this inconsistent without trying any more assignments.
Arc Consistency (4 queens problem)Example 2 Remove a value v of Qx if there is a variable Qy such that v is inconsistent with all remaining values of Qy 4 3 2 1 Numbers indicate sequence of values that are deleted. Q1 Q2 Q3 Q4 Starting with Q1=2, arc consistency check finds a solution without trying any more assignments.