revisiting the cardinality operator and introducing the
play

Revisiting the cardinality Operator and Introducing the - PowerPoint PPT Presentation

Revisiting the cardinality Operator and Introducing the cardinality-path Constraint Family Nicolas Beldiceanu and Mats Carlsson S I C S Lgerhyddsvgen 18 75237 Uppsala {nicolas,matsc}@sics.se ICLP 2001, Paphos, Cyprus Outline of


  1. Revisiting the cardinality Operator and Introducing the cardinality-path Constraint Family Nicolas Beldiceanu and Mats Carlsson S I C S Lägerhyddsvägen 18 75237 Uppsala {nicolas,matsc}@sics.se ICLP 2001, Paphos, Cyprus

  2. Outline of the Presentation The cardinality Operator The cardinality-path Family • Situation of the cardinality-path Family • Instances of the cardinality-path Family Filtering Algorithms for cardinality-path • Required Basic Services • Lower Bound of the Minimum Number of Constraints that Hold • Pruning According to the Bounds • Example of Pruning Conclusion and Perspectives

  3. The cardinality Operator The cardinality-path Family • Situation of the cardinality-path Family • Instances of the cardinality-path Family Filtering Algorithms for cardinality-path • Required Basic Services • Lower Bound of the Minimum Number of Constraints that Hold • Pruning According to the Bounds • Example of Pruning Conclusion and Perspectives

  4. The cardinality Operator The cardinality operator , Van Hentenryck, P., Deville, Y. (ICLP 1991) : n : C = ∑ # CTR j (V 1 ,.., V m ) • Definition j j=1 • Pruning based on: counting C ≤ 5 - 1 CTR 1 CTR 2 CTR 3 CTR 4 CTR 5 entailment If C ≥ 1+3 then CTR 1 CTR 2 CTR 3 CTR 4 CTR 5 CTR 2 , CTR 4 , CTR 5 hold

  5. The Pruning Perfect if the constraints are independant , but weak if the constraints share some variables: X<Y Y<Z Z<X C ≤ 5 - 1 - 1 CTR 1 CTR 2 CTR 3 CTR 4 CTR 5 Generalize existing deduction rules of the cardinality operator

  6. Estimate the maximum number of constraints which hold Partition the constraints in sets of the following types: ... : the conjunction of constraints does not hold ... : the conjunction of constraints allway holds ... : the conjunction of constraints may hold Number of conjunctions of constraints which do not hold C ≤ 5 - 1 CTR 1 CTR 2 CTR 3 CTR 4 CTR 5

  7. Enforcing conjunctions of constraints Enforcing constraints according to min(C): If C ≥ 5 - 1 then CTR 1 CTR 2 CTR 3 CTR 4 CTR 5 CTR 4 , CTR 5 hold

  8. Pruning Values Pruning a variable according to min(C): CTR 1 ∧ CTR 2 ⇒ CTR 4 ∧ CTR 5 ⇒ CTR 6 ∧ CTR 7 ⇒ val ∉ dom(Var ) val ∉ dom(Var ) val ∉ dom(Var ) If C > 7 - 1 - 1 - 1 CTR 1 CTR 2 CTR 3 CTR 4 CTR 5 CTR 6 CTR 7 then val ∉ dom(Var ) then

  9. The cardinality Operator The cardinality-path Family • Situation of the cardinality-path Family • Instances of the cardinality-path Family Filtering Algorithms for cardinality-path • Required Basic Services • Lower Bound of the Minimum Number of Constraints that Hold • Pruning According to the Bounds • Example of Pruning Conclusion and Perspectives

  10. The cardinality-path Family n-k+1 : C = ∑ # CTR (V i ,..,V i+k-1 ) • Definition i=1 considers interaction between constraints • Pruning : (shared variables) V 1 V 2 V 3 V 4 V 5 V 6 V 7 V 8

  11. Situation of the cardinality-path Family Inside the Classification • Constraint parameters + • Graph generator + • Elementary constraint + • Graph properties A complete description of the global constraint is explicitly provided !

  12. cyclic_change( NCHANGE , L , VARIABLES ) • A R G U M E N T : NCHANGE : dvar L : int VARIABLES : collection( var -dvar) • R E S T R I C T I O N (S) : NCHANGE ≥ 0 NCHANGE ≤ | VARIABLES | L > 0 required( VARIABLES.var ) • V E R T E X I N P U T : VARIABLES • V E R T E X G E N E R A T O R : IDENTITY • E D G E I N P U T : VARIABLES • E D G E G E N E R A T O R : PATH • E D G E A R I T Y : 2 • E D G E C O N S T R A I N T : ( VARIABLES.var [1]+1) mod L ≠ VARIABLES.var [2] • G R A P H P R O P E R T Y : NEDGE = NCHANGE cyclic_change(2,4,{ var -3, var -0, var -2, var -3, var -1})

  13. Graph Generation for cyclic_change( NCHANGE , L , VARIABLES ) : VARIABLES • V E R T E X I N P U T • V E R T E X G E N E R A T O R : IDENTITY Collections of items: VARIABLES Vertices generator: IDENTITY V 1 V 2 V 3 V 4 V 5

  14. Graph Generation for cyclic_change( NCHANGE , L , VARIABLES ) : VARIABLES • E D G E I N P U T • E D G E G E N E R A T O R : PATH • E D G E A R I T Y : 2 V 1 V 2 V 3 V 4 V 5 Edge generator: PATH V 1 V 2 V 3 V 4 V 5

  15. Elementary Constraint for cyclic_change( NCHANGE , L , VARIABLES ) • E D G E C O N S T R A I N T : ( VARIABLES.var [1]+1) mod L ≠ VARIABLES.var [2] V 1 V 2 V 4 V 5 V 3 ( V 1 +1) mod L ( V 2 +1) mod L ( V 3 +1) mod L ( V 4 +1) mod L ≠ ≠ ≠ ≠ V 2 V 3 V 4 V 5

  16. Graph Property for cyclic_change( NCHANGE , L , VARIABLES ) • G R A P H P R O P E R T Y : NEDGE = NCHANGE 3 0 3 1 2 (3+1) mod 4 (0+1) mod 4 (2+1) mod 4 (3+1) mod 4 ≠ ≠ ≠ ≠ 0 2 3 1 ( false ) ( true ) ( false ) ( true ) cyclic_change( 2 ,4,{ var -3, var -0, var -2, var -3, var -1})

  17. ”Signature” of the cardinality-path family • V E R T E X G E N E R A T O R : IDENTITY • E D G E G E N E R A T O R : PATH • E D G E A R I T Y : k > 1 • C O N S T R A I N T P R O P E R T Y : - • G R A P H P R O P E R T Y : NEDGE = var ctr ctr ctr ctr Constraint pattern

  18. The cardinality Operator The cardinality-path Family • Situation of the cardinality-path Family • Instances of the cardinality-path Family Filtering Algorithms for cardinality-path • Required Basic Services • Lower Bound of the Minimum Number of Constraints that Hold • Pruning According to the Bounds • Example of Pruning Conclusion and Perspectives

  19. Bounds for C and Member and example of Arity constraint CTR solution C : 0.. n − 1 change( C , { V 1 ,.., V n }, ≠ ) 2 V i ≠ V i +1 change( 3 ,{ 4,4, 3, 4, 1 }, ≠ ) 2 C : 0.. n − 1 cyclic_change( C , L , { V 1 ,.., V n }) ( V i +1)mod L ≠ V i +1 cyclic_change( 2 ,5, { 2,3,4,0, 2,3, 1 }) C : 0.. n − 1 2 smooth( C , T , { V 1 ,.., V n }) |V i − V i +1 | > T smooth( 1 ,2, { 1,3,4,5, 2 }) C : 0.. n − 2 3 number_of_rest( C , { V 1 ,.., V n }) V i =0 ∧ V i +1 =0 ∧ V i +2 ≠ 0 number_of_rest( 2 , { 2,0, 0,1,1,0,2,0, 0,1,2 }) k C : a .. b relaxed_sliding_sum( a,b,low,up,k ,{ V 1 ,.., V n }) i + k − 1 low ≤ Σ V i ≤ up relaxed_sliding_sum( 3 , 4 ,3,7,4, { 2,4, 2, 0, 0,3,4 }) j = i

  20. The cardinality Operator The cardinality-path Family • Situation of the cardinality-path Family • Instances of the cardinality-path Family Filtering Algorithms for cardinality-path • Required Basic Services • Lower Bound of the Minimum Number of Constraints that Hold • Pruning According to the Bounds • Example of Pruning Conclusion and Perspectives

  21. Required Services • enforce_CTR(V i ,..,V i+k − 1 ) MAIN • enforce_NOT_CTR(V i ,..,V i+k − 1 ) PRUNING ALGORITHM • create_choice_point • backtrack ASSUMPTION : For constraint CTR or its negation, failure detection should be independent from the order in which the constraints are posted

  22. Organisation of the Algorithms cardinality_path( C , {V 1 ,..,V n }, CTR ) FILTERING ALGORITHMS find BOUNDS PROPAGATE from C to {V 1 ,..,V n } for C

  23. The cardinality Operator The cardinality-path Family • Situation of the cardinality-path Family • Instances of the cardinality-path Family Filtering Algorithms for cardinality-path • Required Basic Services • Lower Bound of the Minimum Number of Constraints that Hold • Pruning According to the Bounds • Example of Pruning Conclusion and Perspectives

  24. Lower Bound of the Number of Constraints that Hold cyclic_change( C , 5, {V1,V2,V3,V4,V5,V6,V7,V8,V9}) CTR: (V i +1) mod 5 ≠ V i+1 V1: 0,3 V1: 0,3 (V1+1)mod 5=V2 V1: 3 V2: 4 V2: 2,3,4 (V2+1)mod 5=V3 V1: 3 V2: 4 V3: 0 V3: 0,4 (V3+1)mod 5=V4 V1: 3 V2: 4 V3: 0 V4: 1 (V4+1)mod 5=V5 V1: 3 V2: 4 V3: 0 V4: 1 V5: 2 V4: 0,1,2,3,4 (V5+1)mod 5=V6 contradiction V5: 0,1,2,3 V6: 0,2,4 V6: 0,2,4 (V6+1)mod 5=V7 V6: 0,4 V7: 0,1 V7: 0,1,2 (V7+1)mod 5=V8 V6: 0,4 V7: 0,1 V8: 1,2 V8: 0,1,2 (V8+1)mod 5=V9 contradiction V9: 0,4 V9: 0,4 min(C) ≥ 2

  25. The cardinality Operator The cardinality-path Family • Situation of the cardinality-path Family • Instances of the cardinality-path Family Filtering Algorithms for cardinality-path • Required Basic Services • Lower Bound of the Minimum Number of Constraints that Hold • Pruning According to the Bounds • Example of Pruning Conclusion and Perspectives

  26. Propagation from C to {V 1 ,..,V n } Set min_break to 0. before[ i ] (1 ≤ i ≤ n - k +1): Set choice to 1. Create_choice_point. min.number of constraints that hold in for i =1 to n - k +1 do { CTR(V 1 ,.., V k ) ,.., CTR(V i-1 ,.., V i+k-2 } Set before[ i ] to min_break . if choice =0 then Set choice to 1. Create_choice_point. if enforce ¬ CTR(V i ,..,V i+k-1 ) fails then Backtrack. Set choice to 0. vbefore[ i ] ( k ≤ i ≤ n ): Set min_break to min_break +1. state of dom(V i ) after stating constraint CTR(V i-k+1 ,.., V i ) Set vbefore[ i + k -1] to dom(V i+k-1 ) .

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend