1 / 20

Constraint Programming 2001 Edition

Constraint Programming 2001 Edition. Jan Maluszynski and Ulf Nilsson TCSLAB, LiU {janma, ulfni}@ida.liu.se http://www.ida.liu.se/~ulfni/cp2001. Course organization. Course organization (cont’d). Course organization (cont).

raeanne
Download Presentation

Constraint Programming 2001 Edition

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. Constraint Programming 2001 Edition Jan Maluszynski and Ulf Nilsson TCSLAB, LiU {janma, ulfni}@ida.liu.se http://www.ida.liu.se/~ulfni/cp2001

  2. Course organization

  3. Course organization (cont’d)

  4. Course organization (cont) • Obligatory course assignments (23 Oct) with deadline 20 Nov, and examination 27 Nov • Course credit points 4 • Literature:K. Marriott and P. StuckeyProgramming with Constraints: An IntroductionMIT Press, 1998.+ handouts and on-line manuals

  5. A simple definition • Constraint programming is the study of computational systems based on constraints. • Constraints are roughly systems of equations, inequations and disequations over some algebraic structure. • The idea of constraint programming is to solve problems by encoding the problem as a set of constraints and exploring solutions to the constraints.

  6. Typical problem • Processes A-D may start at times 1,2,3,4,5,6,7 • Process A uses 3 resources during 2sec • Process B uses 1 resource during 4sec • Process C uses 2 resources during 1sec • Process D uses 2 resources during 1sec • There are 4 resources • Process A must finish before C can start • When are A, B, C, D earliest finished?

  7. Overview • Constraints, basics, operations, domains • Focus on finite domains, intervals • Constraint logic programming • Modeling and applications • Systems • CLP-systems • Systems for defining constraints CHR, HAL

  8. Constraints • A constraint problem consists of a set of problem variables ranging over some domain and a set of constraints restricting the values that may be assigned to the variables. • Example:x in {1,2,3}, y in {2,3,4,5}, 2x = y • Examples of domains:Reals/rationals, intervals, finite domains, Booleans, sets, monoids (strings) etc

  9. Methods for constraint solving • Reals/rational constraints • Gauss-Jordan elimination + Simplex • Real/Rational intervals • interval narrowing, box consistency, • Gauss-Seidel elimination, interval Newton method, • Booleans • for example, operations on BDD’s • Finite domains • arc, node and path consistency methods • constraint propagation (forward checking, look-ahead)

  10. Optimization • Finding a solution which satisfies constraints and minimizes/maximizes objective function • Different types • combinatorial optimization of discrete (finite domain) variables • linear optimization for continuous variables

  11. Different constraint systems • Real/rational constraints: CLP(R), CLP(Q)CLP(R), Sicstus Prolog, CHIP • Finite domains constraints: CLP(FD)Sicstus Prolog, CHIP • Boolean constraints: CLP(B)Sicstus Prolog, CHIP • Interval constraints: CLP(I)CLP(BNR), Numerica, Prolog IV

  12. Systems discussed in the course • SICStus Prolog • Chip 5.2 • Prolog IV • CHR • HAL

  13. Logic programming Constraint satisfaction/solving Optimization The programming paradigm CLP

  14. Logic programming • Logic (relations) for problem description • Declarative description style (problem description separated from its solving) • Unification (a kind of constraint solving) • Builtin search • Constraint programming does not need LP !!!

  15. Some applications • Spatial and temporal problems • Placment and layout • Manpower planning • Scheduling • Resource allocation • Configuration management • Verification (e.g. correctness, safety+liveness)

  16. Placement/Layout A window contains a number of widgets. As the window is shrinking or growing the widgets have to be repositioned while satisfying certain constraints (e.g. certain widgets must always be visible or must be in a certain relation to other widgets). Given a certain window size, produce a layout that satisfies the constraints.

  17. Scheduling A conference consists of 11 sessions of equal length. The program is to be organized as a sequence of slots,where a slot contains up to 3 parallel sessions: 1. Session 4 must take place before Session 11. 2. Session 5 must take place before Session 10. 3. Session 6 must take place before Session 11. … 8. Session 6 must not be in parallel with 7 and 10. 9. Session 7 must not be in parallel with 8 and 9. 10. Session 8 must not be in parallel with 10. Minimize the number of slots.

  18. Job shop scheduling There are n jobs and m machines. Each job requires execution of a sequence of operations within a time interval, and each operation Oi requires exclusive use of a designated machine Mi for a specied amount of processing time pi. Determine a schedule for production that satisfies the temporal and resource capacity constraints.

  19. Manpower planning Airport Counter Allocation problem: Allocate enough counters and staff (the number depends on the aircraft type) to each flight. The counters are grouped in islands and for each flight all assigned counters have to be in the same island. The staff has working regulations that must be satisfied (breaks etc).

  20. Black-box vs Glass-box solvers • Most systems rely on non-extensible, black-box constraint solvers • Efficiency unpredictable • Hard to debug • Some systems facilitate defining new constraints and solvers (glass-box approach) • Improved control of propagation and search • Examples CHR, HAL, ... • Then again, most problems are NP-complete...

More Related