Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Refining the Basic Constraint Propagation Algorithm Christian Bessière and Jean-Charles Régin Presented by Sricharan Modali.

Similar presentations


Presentation on theme: "1 Refining the Basic Constraint Propagation Algorithm Christian Bessière and Jean-Charles Régin Presented by Sricharan Modali."— Presentation transcript:

1 1 Refining the Basic Constraint Propagation Algorithm Christian Bessière and Jean-Charles Régin Presented by Sricharan Modali

2 2 Outline AC3 Two refinements AC2000 AC2001 Experiments Analytical comparison of AC2001 & AC6 Conclusion

3 3 Introduction Importance of constraint propagation Propagation scheme of most of existing constraint solving engines Constraint oriented, or Variable oriented AC3 is a generic algorithm AC4, AC6 & AC7: value oriented propagation

4 4 Importance of AC3 When you know constraint semantics, use special propagation algorithms (e.g., all-diff, functional) When nothing is known about constraints, use a generic AC algorithm (e.g., AC1, 2, 3, 4, 6 or 7) AC3 does not require maintaining a specific data structures during search, in contrast to AC4, AC6 & AC7  Authors focus on AC3: generic and light weight

5 5 Contribution Modify AC3 into AC2000 & AC2001 More efficient with heavy propagation Light weight data structures Variable-oriented Dominate AC3 (# CC & CPU time)

6 6 AC2000, like AC3, is free of any data structure to be maintained during search (not really: authors use  (X i ) per variable) Regarding human cost of implementation AC2000 needs 5 more lines than AC3 AC2000 vs. AC3

7 7 AC2001 vs. AC3 AC2001 needs an extra data structure, an integer for each value-constraint pair: Last(X i,v i,X j ) Achieves optimal worst-case time complexity Human cost (implementation): AC2001 needs management of additional data structure (  (X i ), Last(X i,v i,X j ))

8 8 Constraint network P = (X, D, C) X is a set of n variables {X 1, …, X n } D is a set of domains {D(X 1 ), …, D(X n )} C is a set of e binary constraints between pairs of variables. Constraint check: verifying whether or not a given pair of values (v i,v j ) is allowed by C ij

9 9 Arc consistent value v i is an arc-consistent value on C ij : v i  D(X i )   v j  D(X j ) | (v i,v j )  C ij v j is called support for (X i,v i ) on C ij XiXi XjXj vivi vjvj

10 10 Viable value Viable value: v i  D(X i ) is viable  it has support in all neighboring D(X j ) Arc consistent CSP: if all the values in all the domains are viable.

11 11 AC3 A variable-oriented propagation scheme Difference with [Mackworth 77] Instead of handling a queue for the constraints to be propagated, it has a queue of the variables whose domain has been modified. This AC3 terminates whenever any domain is empty

12 12

13 13 A (bad) example for AC3

14 14 AC3 overdoes it Revise3(X j,X i ) removes v j from D(X j ) AC puts X j in Q Propagate3 calls Revise3(X i, X j ) for every constraint C ij involving X j Revise3(X i, X j ) will look for a support for every value in D(X i ) even when v j was not a support!

15 15 Enhancement in AC2000 Instead of blindly looking for a support for a value v i  D(X i ) each time D(X j ) is modified, it is done only when needed

16 16 AC2000 In addition to Q,  (X j ) is used  (X j ) contains the values removed from D(X j ) since the last propagation of X j When calling Revise2000(X i,X j,t) a check is made to see if v i has a support in  (X j )

17 17 Example

18 18 How AC2000 operates The larger  (X j ), the closer it gets in size to D(X j ) the more expensive the process is the more likely for v i to have a support in  (X j ) Hence lazymode is used only when |  (X j )| is sufficiently smaller than |D(X j )| Use of lazymode is controlled with Ratio |  (X j ) |/ |D(X j )| < Ratio, use lazymode |  (X j ) |/ |D(X j )|  Ratio, use  lazymode

19 19

20 20 Analysis of AC2000 Assumption: AC3 is correct Prove: Lazymode of AC2000 does not lead to arc-inconsistent values in the domain The only way the search for support for a value v i in D(X i ) is skipped is when v i is not supported by values in  (X j )  (X j ) contains all values last deleted from D(X j )  v i has exactly the same set of supports as before on C ij Looking again for a support for v i is useless as it remains consistent with C ij

21 21 Space complexity of AC2000 It is bounded by the sizes of Q and  Q is O(n),  is O(nd) d is the size of the largest domain Overall complexity O(nd)

22 22 Time Complexity of AC2000 The main change is in Revise2000, where both  (X j ) and D(X j ) are examined instead of only D(X j ) This leads to a worst case where d 2 checks are performed in Revise2000 Hence the overall time complexity is O(ed 3 ) since Revise2000 can be called d times per constraint.

23 23 AC2000 too overdoes it.. In AC2000 we have to look again for a support for v i on C ij If we can remember the support found for v i in D(X j ) the last time C ij is revised Next time we need to check whether or not this last support belongs to  (X j ).

24 24 AC2001 saves more.. A new data structure Last(X i,v i,X j ) is used to store the value that supports v i The function Revise2001 always runs in lazymode, except during the initialization phase. Further, when supports are checked in a given ordering “< d ” (i.e., sorted) we know that there isn’t any support for v i before Last(X i,v i,X j ) in D(X j ).

25 25 Example

26 26

27 27 Space complexity of AC2001 Is bounded above by the size of Q,  and Last Q is in O(n)  is in O(nd) But Last is in O(ed) Since each value v i has a Last pointer for each constraint involving X i. This gives the overall complexity of O(ed)

28 28 Time Complexity of AC2001 As in AC3 & AC2000, Revise2001 can be called d times per constraint. But at each call to Revise2001(X i,X j,t) for each value v i  D(X i ) There will be a test on the Last(X i,v i,X j ) And a search for support on D(X j ) greater than Last(X i,v i,X j ) The overall time complexity is then bounded above by d(d+d)2e, which is in O(ed 2 ) O(ed 2 ) is optimal AC2001 is the first optimal arc-consistency algorithm proposed in the literature that is free of any lists of supported values.

29 29 Experiments To see if AC2000 and AC2001 are effective vs. AC3, compare #CC & CPU Context: pre-processing & search (MAC) The goal is not to compete with AC6/AC7 An improvement (even small) w.r.t AC3 is significant

30 30 AC as a preprocessing The chance of having some propagations are very small on real instances Hence only one real – world instance is considered Other instances are randomly generated to fall in the phase transition region Ratio of 0.2 is taken (no justification given)

31 31 Parameters N number of variables D size of the domain C number of constraints P 1 density of constraints 2C/N.(N-1) T number of forbidden tuples P 2 tightness of the forbidden tuples T/D 2

32 32 Results Low density (p 1 =0.045) Instance 1: under-constrained (p 2 =0.5) Instance 2: over-constrained (p 2 =0.94) High tightness (p 2 =0.918, 0.875) Instance 3: sparse (p 1 =0.045) Instance 4: dense (p 1 =1.0)

33 33 Observation

34 34 Maintaining Arc consistency during search MAC-3, MAC-2000, MAC-2001 Experiments carried over all the instances contained in FullRLFAP archive for which more than 2 secs is necessary to find a solution or to prove that none exists Ratio is again 0.2 (no justification given)

35 35 Results

36 36 Observations There is a slight gain of MAC2000 over MAC3 Except for SCEN#11 On SCEN#11 it is seen that MAC2000 outperforms MAC3 for ratio 0.1 MAC2001 outperforms MAC3 with 9 times less CC and 2 times less cpu time

37 37 Restrictions Comparison is between algorithms with simple data structures Note that to solve SCEN#11 MAC-6 (MAC + AC6):14.69 sec MAC3 needs 39.50 sec MAC2000 needs 38.22 sec MAC2001 needs 22.69 sec

38 38 AC2001 vs. AC6 Time complexity and space complexity of AC2001 is equal to that of AC6 What are the differences between AC6 and AC2001? Property1: #CC same! Property2: Difference is in the effort of maintaining specific data structures Authors give condition who wins when

39 39 Conclusion Two refinements to AC3: AC2000 & AC2001 AC2000 improves slightly over AC3, w/o maintenance of any new data structure AC2001 needs an additional data structure Last AC2001 achieves optimal worst-case time complexity

40 40 Thanks


Download ppt "1 Refining the Basic Constraint Propagation Algorithm Christian Bessière and Jean-Charles Régin Presented by Sricharan Modali."

Similar presentations


Ads by Google