FC for Non-Binary CSPs Foundations of Constraint Processing CSCE421/821, Spring 2008: www.cse.unl.edu/~choueiry/S08-421-821/ Berthe Y. Choueiry (Shu-we-ri) Avery Hall, Room 123B [email protected] Tel: +1(402)472-5444 Foundations of Constraint Processing, Spring 2008 April 9, 2008 nFCi 1 Recommended reading • (short, preliminary version) On forward checking for non-binary constraint satisfaction, by Christian Bessière, Pedro Meseguer, Eugene C Freuder, Javier Larrosa, CP 1999 • (longer, more complete version) On forward checking for non-binary constraint satisfaction, by Christian Bessière, Pedro Meseguer, Eugene C Freuder, Javier Larrosa, AIJ 2002 Foundations of Constraint Processing, Spring 2008 April 9, 2008 nFCi 2 Non-binary FC • Definitions • Example • Properties Foundations of Constraint Processing, Spring 2008 April 9, 2008 nFCi 3 nFC0 and nFC1 Cc,1: Constraints involving the current variable and exaclty one future variable Cc,1: Set of constraint projections involving the current variable and exactly one future variable nFC0: Apply AC on each constraint in Cc,1 (one pass) nFC1: Apply AC to each constraint in Cc,1 and Cc,1 (one pass) Foundations of Constraint Processing, Spring 2008 April 9, 2008 nFCi 4 nFC2, nFC3, nFC4, nFC5 Cc,f: set of constraints involving the current variable and at least one future variable Cp,f: set of constraints involving at least one past variable and at least one future variable nFC2: Apply AC to each constraint in Cc,f nFC3: Make Cc,f arc-consistent nFC4: Apply AC to each constraint in Cp,f nFC5: Make Cp,f arc-consistent Foundations of Constraint Processing, Spring 2008 April 9, 2008 nFCi 5 Non-binary FC • Definitions • Example • Properties Foundations of Constraint Processing, Spring 2008 April 9, 2008 nFCi 6 Filtering for x a c1 a, b, c a, b, c c3 c2 a, b, c a, b, c a, b, c a, b, c Xa x y z u v w c1 c2 c3 x y z x y z x y z a a a a a a a a a a b c a b b a b c a c b c c c • nFC0 does no filtering • nFC1 applies AC on c1 {x,y}, {x.z}, and and c3 on {x,y} and {x,w}. It removes c from D(y), b from D(w) • nFC2 applies AC on c1, then on c3. Same pruning as nFC1. A different ordering of constraints yields different filtering Foundations of Constraint Processing, Spring 2008 nFCi 7 Filtering for x a c1 a, b, c a, b, c c3 c2 a, b, c a, b, c a, b, c a, b, c Xa x y z u v w c1 c2 c3 x y z x y z x y z a a a a a a a a a a b c a b b a b c a c b c c c • nFC3 applies AC on {c1,c3}. Same filtering as nfC2, but also, removes b from D(z). • nFC4 applied AC on c1 then c3 (like nFC2). Same filtering as nFC2 because x is the first variable. • nfC5 yields the same filtering as nFC3 because x is the first variable. Foundations of Constraint Processing, Spring 2008 nFCi 8 Filtering for u a c1 a, b, c a, b, c c3 c2 a, b, c a, b, c a, b, c a, b, c Xa x y z u v w c1 c2 c3 x y z x y z x y z a a a a a a a a a a b c a b b a b c a c b c c c • nFC0 does no filtering • nFC1 applies AC on c1 on {u,v}, {u,w}. It removes c from D(v), c from D(w) • nFC2 applies AC on c2. It removes b and c from D(v) and c from D(w) Foundations of Constraint Processing, Spring 2008 nFCi 9 Filtering for u a c1 a, b, c a, b, c c3 c2 a, b, c a, b, c a, b, c a, b, c ua x y z u v w c1 c2 c3 x y z x y z x y z a a a a a a a a a a b c a b b a b c a c b c c c • nFC3 applies AC on {c2}. Same filtering as nFC2 • nFC4 applies AC on c1, c2, then c3. It removes b from D(y) and D(z), b and c from D(v) and c from D(w). • nfC5 does AC on {c1, c2, c3}. It removes b from D(y), c from D(z), b and c from D(v), and c from D(w) Foundations of Constraint Processing, Spring 2008 nFCi 10 Non-binary FC • Definitions • Example • Properties Foundations of Constraint Processing, Spring 2008 April 9, 2008 nFCi 11 Filtering effectiveness Let (nFCi, k) be the set of (x,a) where a is removed from D(x) • (nFC0,k) (nFC1,k) (nFC2,k) • (nFC2,k) (nFC3,k) (nFC5,k) • (nFC2,k) (nFC4,k) (nFC5,k) Foundations of Constraint Processing, Spring 2008 April 9, 2008 nFCi 12 Nodes visited by nFCi • • • • nodes(nFC2,k) nodes(nFC1,k) nodes(nFC0,k) nodes(nFC5k) nodes(nFC3,k) nodes(nFC2,k) nodes(nFC5,k) nodes(nFC4,k) nodes(nFC2,k) nFC1 visits exactly the same nodes as FC+ on the hidden variable representation Foundations of Constraint Processing, Spring 2008 April 9, 2008 nFCi 13
© Copyright 2025 Paperzz