1 / 36

SweConsNet, May 24 2002

Activities of the Combinatorial Problem Solving Group Nicolas Beldiceanu SICS Lägerhyddsvägen 18 75237 Uppsala email: nicolas@sics.se. SweConsNet, May 24 2002. Outline.  O VERVIEW  C LASSIFICATION OF G LOBAL C ONSTRAINTS  G ENERIC F ILTERING A LGORITHMS

nishan
Download Presentation

SweConsNet, May 24 2002

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Activities of the Combinatorial Problem Solving GroupNicolas BeldiceanuSICSLägerhyddsvägen 1875237 Uppsalaemail: nicolas@sics.se SweConsNet, May 24 2002

  2. Outline  OVERVIEW  CLASSIFICATION OF GLOBAL CONSTRAINTS  GENERIC FILTERING ALGORITHMS  SWEEP BASED FILTERING ALGORITHMS  RESOURCES CONSTRAINT  COST FILTERING ALGORITHMS  ENGINEERING OF FILTERING ALGORITHMS  CONSTRAINT DEBUGGING  IMPLIED CONSTRAINTS  SUMMARY AND CONCLUSION

  3.  OVERVIEW  CLASSIFICATION OF GLOBAL CONSTRAINTS  GENERIC FILTERING ALGORITHMS  SWEEP BASED FILTERING ALGORITHMS  RESOURCES CONSTRAINT  COST FILTERING ALGORITHMS  ENGINEERING OF FILTERING ALGORITHMS  CONSTRAINT DEBUGGING  IMPLIED CONSTRAINTS  SUMMARY AND CONCLUSION

  4. Overview • Short Term Focus Explicit description of constraints Efficient and generic filtering algorithms • Long Term Perspective Synthetize filtering algorithms from the description of constraints • How to Proceed Interdisciplinary interactions (Applied Math, Algorithmic, Constraint) Implementation (make it available in SICStus Prolog) Feedback from applications (configuration, scheduling, biology, electronic market)

  5. Overview • People N.Beldiceanu, M.Carlsson, P.Mildner, T.Szeredi, M.Ågren • Collaborations SICS Kista (M.Aronsson, E.Aurell, P.Kreuger) MPII Saarbrücken (S.Thiel) Uppsala University (Q.Guo)

  6.  OVERVIEW  CLASSIFICATION OF GLOBAL CONSTRAINTS  GENERIC FILTERING ALGORITHMS  SWEEP BASED FILTERING ALGORITHMS  RESOURCES CONSTRAINT  COST FILTERING ALGORITHMS  ENGINEERING OF FILTERING ALGORITHMS  CONSTRAINT DEBUGGING  IMPLIED CONSTRAINTS  SUMMARY AND CONCLUSION

  7. Motivations for a Classification of Global Constraints • Find out the basic constituents of the global constraint, • Classify the properties of each basic constituent, • Understand how properties interact.

  8. Main Idea of the Classification Global Constraints as: Graph Properties onStructuredNetwork ofElementary Constraints of theSame Type

  9. nvalue(NVAL, VARIABLES ) : NVAL : dvar VARIABLES: collection(var-dvar) : NVAL 0 NVAL |VARIABLES| required(VARIABLES.var) : VARIABLES : IDENTITY : VARIABLES : CLIQUE : 2 : VARIABLES.var[1] =VARIABLES.var[2] : NSCC = NVAL • ARGUMENT • RESTRICTION(S) • VERTEXINPUT • VERTEXGENERATOR • EDGEINPUT • EDGEGENERATOR • EDGE ARITY • EDGE CONSTRAINT • GRAPH PROPERTY nvalue(4,{var-3,var-1,var-7,var-1,var-6})

  10. V2 V1 V3 V5 V4 Collections of items: VARIABLES Vertices generator: IDENTITY V1 V2 V3 V4 V5 Edge generator: CLIQUE

  11. Edge constraint: = = = = = = = = = = = = = = = = = 1 Graph property: V2 V2 = 3 7 = NSCC=NVAL V1 V1 V3 V3 = = = 6 1 V5 V5 V4 V4 nvalue(4,{var-3,var-1,var-7,var-1,var-6})

  12. A Catalog of Global Constraints Alldifferent Alldifferent_except_0 Alldifferent_interval Alldifferent_modulo Alldifferent_partition Alldifferent_same_value Among Among_interval Among_modulo Among_seq Assign_and_count Assign_and_nvalue Balance Balance_modulo Balance_partition Bin_packing Binary_tree Cardinality_atleast Cardinality_atmost Change Change_continuity Change_pair Change_partition Circuit Circuit_cluster Circular_change Coloured_cumulative Coloured_cumulatives Common Common_interval Common_modulo Common_partition Connect_points Connected Count Crossing Cumulative Cumulative_2d Cumulative_product Cumulatives Cycle Cycle_card_on_path Cycle_cover Cycle_or_accessibility Cycle_resource Cyclic_change Cyclic_change_joker Cyclic_cumulative Derangement Diffn Diff_2 Diff_2_cyclic Diff_2_min_dist Disjoint Disjoint_tasks Distance_change Distance_less Distribute Domain_constraint Element Element_greatereq Element_lesseq Element_sparse Elements Elements_alldifferent Global_cardinality Golomb Graph_crossing Group Group_skip_isolated_item Inflexion Interval_and_count Interval_and_sum Inverse Longest_change Map Max_index Max_n Max_nvalue Maximum Maximum_modulo Maximum_pair Min_index Min_n Min_nvalue Minimum Minimum_except_0 Minimum_modulo Minimum_pair Nclass Nequivalence Ninterval Notallequal Npair Number_of_rest Nvalue Orchad Place_in_pyramid Polyomino Relaxed_sliding_sum Same Same_interval Same_modulo Same_partition Sliding_card_skip0 Sliding_sum Sliding_time_window Smooth Soft_alldifferent_ctr Soft_alldifferent_var

  13. A Catalog of Global Constraints Stretch Stretch_circuit Stretch_path Symmetric_alldiff Temporal_path Tree Tree_resource Used_by Used_by_interval Used_by_modulo Used_by_partition • Old constraints which were not inside: element, ... • Invented constraints: disjoint, ... • Catalog updated as new constraints are presented • domain_constraint [REFALO, CP2000] • stretch [PESANT, CP2001] • soft alldifferent [PETIT, RÉGIN, CP2001] • Modifications in the way of describing constraints • possibility to have constraint (like global cardinality, stretch) where • different limits are associated to different values • avoid properties which can’t be evaluated in polynomial time when all • parameters of the constraint are fixed (e.g maximum clique)

  14.  OVERVIEW  CLASSIFICATION OF GLOBAL CONSTRAINTS  GENERIC FILTERING ALGORITHMS  SWEEP BASED FILTERING ALGORITHMS  RESOURCES CONSTRAINT  COST FILTERING ALGORITHMS  ENGINEERING OF FILTERING ALGORITHMS  CONSTRAINT DEBUGGING  IMPLIED CONSTRAINTS  SUMMARY AND CONCLUSION

  15. Filtering Algorithms for Families of Constraints Alldifferent Alldifferent_except_0 Alldifferent_interval Alldifferent_modulo Alldifferent_partition Alldifferent_same_value Among Among_interval Among_modulo Among_seq Assign_and_count Assign_and_nvalue Balance Balance_modulo Balance_partition Bin_packing Binary_tree Cardinality_atleast Cardinality_atmost Change Change_continuity Change_pair Change_partition Circuit Circuit_cluster Circular_change Coloured_cumulative Coloured_cumulatives Common Common_interval Common_modulo Common_partition Connect_points Connected Count Crossing Cumulative Cumulative_2d Cumulative_product Cumulatives Cycle Cycle_card_on_path Cycle_cover Cycle_or_accessibility Cycle_resource Cyclic_change Cyclic_change_joker Cyclic_cumulative Derangement Diffn Diff_2 Diff_2_cyclic Diff_2_min_dist Disjoint Disjoint_tasks Distance_change Distance_less Distribute Domain_constraint Element Element_greatereq Element_lesseq Element_sparse Elements Elements_alldifferent Global_cardinality Golomb Graph_crossing Group Group_skip_isolated_item Inflexion Interval_and_count Interval_and_sum Inverse Longest_change Map Max_index Max_n Max_nvalue Maximum Maximum_modulo Maximum_pair Min_index Min_n Min_nvalue Minimum Minimum_except_0 Minimum_modulo Minimum_pair Nclass Nequivalence Ninterval Notallequal Npair Number_of_rest Nvalue Orchad Place_in_pyramid Polyomino Relaxed_sliding_sum Same Same_interval Same_modulo Same_partition Sliding_card_skip0 Sliding_sum Sliding_time_window Smooth Soft_alldifferent_ctr Soft_alldifferent_var

  16.  OVERVIEW  CLASSIFICATION OF GLOBAL CONSTRAINTS  GENERIC FILTERING ALGORITHMS  SWEEP BASED FILTERING ALGORITHMS  RESOURCES CONSTRAINT  COST FILTERING ALGORITHMS  ENGINEERING OF FILTERING ALGORITHMS  CONSTRAINT DEBUGGING  IMPLIED CONSTRAINTS  SUMMARY AND CONCLUSION

  17. Applications of Sweep Algorithms Within theGeometry Literature Database, more than 100 references: • Voronoi diagram • Map overlay • Nearest objects • Triangulations • Hidden surface removals • Rectangles intersection • Shortest path sweep line event point y (1) sweep line status (2) (1)Move to next eventpoint (2)Updatesweep line status x But not yet used within constraint programming !

  18. Applications of Sweep Algorithms within Constraint Programming Pruning for the following constraint patterns: • A conjunction of constraints with two sharedvariables • Several conjunction of constraints with one sharedvariable • The cardinality operator with two sharedvariables • The non-overlapping constraint between polygons • A multi-resource cumulatives constraint

  19. Y 4 4 4 4 4 3 3 3 3 3 2 2 2 2 2 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 Examples ofForbiddenandSafeRegions Y Y Y Y X X X X X 0X4 0Y4 0R9 0X4 0Y4 2Z3 0X4 0Y4 1S6 0X4 0Y4 0T0 1U2 0X4 0Y4 X+1T T+1X Y+1U U+4Y alldifferent( {X,Y,4-Y,R}) |X-Y|>Z X+2YS X+Y0 (mod 2)

  20. 4 4 4 3 3 3 2 2 2 1 1 1 0 0 0 alldifferent({X,Y,4-Y,R}) An Example |X-Y|>Z PROBLEM: Adjust minimum of X according to Y and to the fact that 4 or 5 constraints should hold: X+2YS 0X4 0Y4 2Z3 1S6 0T0 1U2 alldifferent({X,Y,4-Y, R}) |X-Y|>Z X+2YS X+1T  T+1XY+1U  U+4Y X+Y0 (mod 2) X+1T  T+1X Y+1U  U+4Y X+Y0 (mod 2) Deduction: X>1 Y Y Y X=0 X=1 X=2

  21.  OVERVIEW  CLASSIFICATION OF GLOBAL CONSTRAINTS  GENERIC FILTERING ALGORITHMS  SWEEP BASED FILTERING ALGORITHMS  RESOURCES CONSTRAINT  COST FILTERING ALGORITHMS  ENGINEERING OF FILTERING ALGORITHMS  CONSTRAINT DEBUGGING  IMPLIED CONSTRAINTS  SUMMARY AND CONCLUSION

  22. resource consumption 4  4 3 4 3 2 1 1 2 0 time resource consumption 7  0 6 Cumulated profiles 4 5 2  0 1 1 2 2 3 3 4 4 5 5 6 6 3 1 time 1 0 -1 2 1 0 -1 -2 The cumulative Constraint The originalcumulative constraint [Aggoun & Beldiceanu 92]: Restrict the resource consumption at each point in time. The generalizedcumulatives constraint [Beldiceanu & Carlsson 01]: A pool of cumulative resources , Height of a task can be negative, Maximum or minimum resource consumption , Holds for time-points crossed by at least one task.

  23. For all tasks : For all time-points crossed by task : Let be the machine where task is assigned , For all tasks which both cross point , and are assigned to : The sum of the height of tasks is not greater (less) than the capacity of machine . 1 2 3 4 5 6 1 0 -1 2 1 0 -1 -2 t i t D E F I N I T I O N m t s i m s m resource consumption 7  0 6 Machine 2 E X A M P L E 4 5 2  0 3 1 Machine 1 time

  24.  OVERVIEW  CLASSIFICATION OF GLOBAL CONSTRAINTS  GENERIC FILTERING ALGORITHMS  SWEEP BASED FILTERING ALGORITHMS  RESOURCES CONSTRAINT  COST FILTERING ALGORITHMS  ENGINEERING OF FILTERING ALGORITHMS  CONSTRAINT DEBUGGING  IMPLIED CONSTRAINTS  SUMMARY AND CONCLUSION

  25. Include Objective Within Constraint

  26. FILTERING ALGORITHMS Algorithms sum_of...(Variables, Values, Cost) find BOUNDS for Cost PROPAGATE from bounds of Costto Variables Lower bound LB: domination Remove val from var iff: LB+lower_regret(var,val)>max(Cost) Upper bound UB: matching Remove val from var iff: UB-upper_regret(var,val)<min(Cost)

  27. Algorithms (main results) Lower bound LB: domination O(n log n + m) for a tight bound (when intervals) n:number of variables m: number of values O(n log n + m) for computing all the exact lower regret of all values (when intervals) n:number of variables m: number of values Upper bound UB: matching O(m log m + c e) for a tight bound m: number of values c:cardinality of max.matching e:nb.of edges in bipartite graph O(e) for computing all the exact upper regret e:number of edges in bipartite graph

  28.  OVERVIEW  CLASSIFICATION OF GLOBAL CONSTRAINTS  GENERIC FILTERING ALGORITHMS  SWEEP BASED FILTERING ALGORITHMS  RESOURCES CONSTRAINT  COST FILTERING ALGORITHMS  ENGINEERING OF FILTERING ALGORITHMS  CONSTRAINT DEBUGGING  IMPLIED CONSTRAINTS  SUMMARY AND CONCLUSION

  29. Engineering Integrate standard constraints from other systems Global cardinality, sort, ... Reuse algorithms from literature Alldifferent [Mehlhorn, Thiel], Knapsack (dynamic programming [Trick]) Incremental algorithms Special cases when go down, optimizations valid for several global constraints (target, source) Reingenering of the code Revisiting filtering algorithms for inserting explanations Making the system available on several platforms

  30.  OVERVIEW  CLASSIFICATION OF GLOBAL CONSTRAINTS  GENERIC FILTERING ALGORITHMS  SWEEP BASED FILTERING ALGORITHMS  RESOURCES CONSTRAINT  COST FILTERING ALGORITHMS  ENGINEERING OF FILTERING ALGORITHMS  CONSTRAINT DEBUGGING  IMPLIED CONSTRAINTS  SUMMARY AND CONCLUSION

  31. Different Aspects of Trace Control of Execution Posting constraints, demons, waking constraints, entailment, failure, choice points Locating Information Situate a piece of information according to the context it originally came Domain Modification Intendedpruning, domain modification, domain Declarative Aspect Explanation(s) for pruning, failing, adding a constraint, waking a demon Procedural Aspect Method used or not, nested block structure, method dependant explanations

  32.  OVERVIEW  CLASSIFICATION OF GLOBAL CONSTRAINTS  GENERIC FILTERING ALGORITHMS  SWEEP BASED FILTERING ALGORITHMS  RESOURCES CONSTRAINT  COST FILTERING ALGORITHMS  ENGINEERING OF FILTERING ALGORITHMS  CONSTRAINT DEBUGGING  IMPLIED CONSTRAINTS  SUMMARY AND CONCLUSION

  33. Implied Constraints (as relations between graph properties) QUESTION For a directed graph, relation between:  NV: number of vertices,  NA: number of arcs,  NCC: number of connected components. ANSWER INTUITION The maximum number of arcs is achieved by having a complete clique in each connected components and the minimum number of connected components. PROPAGATION RULES

  34. Implied Constraints (as relations between graph properties) QUESTION For a directed graph, relation between:  NV: number of vertices,  NA: number of arcs,  NCC : number of connected components,  NSCC: number of strongly connected components. GUESS

  35. Summary and Conclusion • Provide a Constraint Classification • Generic Propagation Algorithms for several Families of Constraints • Use Algorithms from Graph and Geometry • Several Constaints Implemented within SICStus and Used within Demonstrators Collaboration required with: applied mathematics, design of algorithms

  36. Further Sources of Information Papers (some at http://www.sics.se/libindex.html) • Sweep as a Generic Pruning Technique Applied to the Non-Overlapping Rectangles Constraint, [Beldiceanu,Carlsson 2001] . • Sweep as a Generic Pruning Technique Applied to Constraint Relaxation, [Beldiceanu,Carlsson 2001] . • Non-overlapping Constraints between Convex Polytopes, [Beldiceanu,Guo,Thiel 2001] . • A New Multi-Resource cumulatives Constraint with Negative Heights, [Beldiceanu,Carlsson 2001] . • Sweep Synchronization as a Global Propagation Mechanism[Beldiceanu,Carlsson, Thiel 2002] . (submitted) • Cost-Filtering Algorithms for the two Sides of the Sum of Weights of Distinct Values Constraint, [Beldiceanu,Thiel 2002] . (in preparation) Implementation (http://www.sics.se/sicstus/) • Alldifferent, Assignment, Case, Circuit, Count, Cumulative, Cumulatives, Disjoint1, Disjoint2, Element, Global_cardinality, Knapsack, Scalar_product, Serialized, Sort, Sum, Sum_of_weights_of_distinct_values.

More Related