1.06k likes | 1.29k Vues
Integrating Operations Research Algorithms in Constraint Programming. Claude Le Pape ILOG S.A. ILOG Optimization Suite. ILOG OPL Studio. ILOG Scheduler. ILOG Dispatcher. ILOG Configurator. ILOG CPLEX. ILOG Solver. Hybrid. ILOG Concert Technology. Outline. Introduction
E N D
IntegratingOperations Research Algorithms in Constraint Programming Claude Le Pape ILOG S.A. C. Le Pape
ILOG Optimization Suite ILOG OPL Studio ILOG Scheduler ILOG Dispatcher ILOG Configurator ILOG CPLEX ILOG Solver Hybrid ILOG Concert Technology C. Le Pape
Outline • Introduction • Problem decomposition • Constraint propagation • Propagation of global constraints • Objective functions • What ifs • Search • Conclusion C. Le Pape
Discrete Optimization(1) • A combination of choices to make (decision variables) • Distribute objects into bins (tasks to people) • Sequence and schedule tasks • Design routes between given points • Complex combination, e.g., assign deliveries of customers to trucks and drivers, schedule the deliveries for each driver, and design the routes to be followed C. Le Pape
Discrete Optimization (2) • Constraints between these choices • Capacity and geometry of bins • Precedence, delays, incompatibilities between tasks • Route network topology and capacity • Complex constraints, e.g., big trucks are not allowed on Market Street from 9 to 11 a.m. on Wednesdays C. Le Pape
Discrete Optimization (3) • One or more optimization criteria • Don’t spend too much (minimize cost) • Earn as much as possible (maximize income) • Don’t be late (minimize tardiness) • Don’t be early (minimize earliness) • Don’t take risks (quality, security, robustness) • Make sure everybody is happy (satisfaction and equilibrium between individual preferences) C. Le Pape
Mathematical Model (1) • Mathematical definition of variables • Decision variables • Intermediate variables • Optimization variables • Mathematical definition of constraints • Mathematical definition of solutions: assignments of values to variables that satisfy the constraints C. Le Pape
Mathematical Model (2) • Mathematical definition of an ordering relation between solutions • Often a partial definition: some elements of comparison often lie in the head of the user • Mathematical definition of optimal solutions: solutions that are not dominated according to the ordering relation C. Le Pape
Problem Solving • Three main classes of techniques • Linear Programming and Mixed Integer Programming • Constraint Programming • Local Search C. Le Pape
Mixed Integer Programming (1) • Explicit problem definition • Linear constraints • Real (floating point) and integer variables • One optimization criterion • Separation between problem definition and problem solving • The continuous relaxation (when fractional values are allowed for integer variables) is solvable in polynomial time • Bound on optimization criterion • Guidance for solving the MIP problem by branch-and-bound (rounding, cuts, …) C. Le Pape
Mixed Integer Programming (2) C. Le Pape
Mixed Integer Programming (3) C. Le Pape
Mixed Integer Programming (4) C. Le Pape
Mixed Integer Programming (5) C. Le Pape
Mixed Integer Programming (6) C. Le Pape
Mixed Integer Programming (7) C. Le Pape
Mixed Integer Programming (8) C. Le Pape
Mixed Integer Programming (9) C. Le Pape
Example in OPL Studio (1) range Boolean 0..1; int fixed = ...; enum Warehouses ...; int nbStores = ...; range Stores 0..nbStores-1; int capacity[Warehouses] = ...; int supplyCost[Stores,Warehouses] = ...; var Boolean open[Warehouses]; var Boolean supply[Stores,Warehouses]; C. Le Pape
Example in OPL Studio (2) minimize sum(w in Warehouses) fixed * open[w] + sum(w in Warehouses, s in Stores) supplyCost[s,w] * supply[s,w] subject to { forall(s in Stores) sum(w in Warehouses) supply[s,w] = 1; forall(w in Warehouses, s in Stores) supply[s,w] <= open[w]; forall(w in Warehouses) sum(s in Stores) supply[s,w] <= capacity[w]; }; C. Le Pape
Constraint Programming • Explicit problem definition • Separation between problem definition and problem solving • Systematic deduction of the consequences of made decisions (constraint propagation) Partial constraint propagation è development of heuristic search algorithms to generate and optimize solutions • Incremental constraint propagation (with global fix point semantics) • Localized definition of the constraint propagation process (each constraint propagates independently of other constraints) è many different types of constraints viewed as as many sub-problems C. Le Pape
Problem specification or partial solution in terms of constraints Constraint Programming New constraints (decisions) Problem definition Decision-making (and retracting) Initial constraints Dynamic changes Constraint propagation Deduced constraints Contradictions C. Le Pape
x in [2..3] y in [1..2] z in [1..3] x - y = 1 x in [2..3] y in [1..2] z in [2..3] y < z x in [2..3] y in [1..2] z in [2..3] x != z Example: Propagation Variables: x in [1..3]y in [1..3]z in [1..3] Constraints:x - y = 1y < z x != z C. Le Pape
x = 3 y = 2 z = 3 FAILURE y = 2 Backtrack x = 2 y = 1 z = 3 y = 1 Example: Decision-Making Variables: x in [2..3]y in [1..2]z in [2..3] Constraints: x - y = 1 y < z x != z C. Le Pape
Example in OPL Studio (1) int fixed = ...; int nbStores = ...; enum Warehouses ...; range Stores 0..nbStores-1; int capacity[Warehouses] = ...; int supplyCost[Stores,Warehouses] = ...; int maxCost = max(s in Stores,w in Warehouses) supplyCost[s,w]; var int open[Warehouses] in 0..1; var Warehouses supplier[Stores]; var int cost[Stores] in 0..maxCost; C. Le Pape
Example in OPL Studio (2) minimize sum(s in Stores) cost[s] + sum(w in Warehouses) fixed * open[w] subject to { forall(s in Stores) cost[s] = supplyCost[s,supplier[s]]; forall(s in Stores ) open[supplier[s]] = 1; forall(w in Warehouses) sum(s in Stores) (supplier[s] = w) <= capacity[w]; }; C. Le Pape
Example in OPL Studio (3) search { forall(s in Storesordered by decreasing regretdmin(cost[s])) tryall(w in Warehouses ordered by increasing supplyCost[s,w]) supplier[s] = w; generateSeq(open); }; C. Le Pape
Incrementality Principle (1) Masonry (7) Carpentry (3) Roofing (1) Plumbing (8) Ceilings (3) Windows (1) Facade (2) Garden (1) Painting (2) Moving (1) C. Le Pape
G. M. Incrementality Principle (2) 0 5 10 15 20 Masonry Plumbing Carpentry R. W. Ceilings Facade Paint. C. Le Pape
Incrementality Principle (3) • "Plumber" = "Roofer" • Solution: Order "Plumbing" and "Roofing" • Heuristic choice For example, "Plumbing" before "Roofing" C. Le Pape
0 5 10 15 20 Masonry Plumbing Carpentry R. W. Ceilings Facade G. Paint. M. Incrementality Principle (4) C. Le Pape
G. M. Incrementality Principle (5) 0 5 10 15 20 Masonry Plumbing Carpentry R. W. Ceilings Facade Paint. C. Le Pape
W. G. Incrementality Principle (6) 0 5 10 15 20 Masonry Plumbing Carpentry R. Ceilings Facade Paint. M. C. Le Pape
W. G. M. Incrementality Principle (7) 0 5 10 15 20 Masonry Plumbing Carpentry R. Ceilings Facade Paint. C. Le Pape
Incrementality Principle (8) Constraint propagation consists in incrementally updating characteristics of a partial problem solution when an additional constraint is added These characteristics may be: • indicators of contradictions • domains of variables (relational propagation) • the overall set of constraints (logic/algebraic propagation) C. Le Pape
Incrementality Principle (9) Particular case: arc-consistency A constraint propagation technique enforces arc-consistency if and only if when propagation stops the following statement holds: for every constraint c(v1 ... vn) for every variable vi for every value vali in the domain of vi there are values val1 ... vali-1 vali+1 ... valn in the domains of v1 ... vi-1 vi+1 ... vn such that val1 ... vali-1 vali vali+1 ... valn satisfy c Considering a constraint as a sub-problem, arc-consistency consists of removing all the values that do not belong to any solution of the sub-problem C. Le Pape
Incrementality Principle (10) Non-monotonic constraint propagation consists in incrementally updating characteristics of a partial problem solution when a constraint is added or retracted Non-monotonic constraint propagation implies the cancellation (hence the identification) of the consequences of the retracted constraints Non-monotonic constraint propagation is not used as much as "monotonic" constraint propagation (for complexity reasons) C. Le Pape
Locality Principle (1) • Each constraint (or constraint type) "includes" all the information necessary to enable its propagation and, in particular, to determine whether it is satisfied or not as soon as all its variables are instantiated • The constraint propagation methods associated with a constraint (or constraint type) are a priori independent of the methods associated with other constraints C. Le Pape
Locality Principle (2) • Example: temporal constraints and resource constraints • User: "Plumber" = "Roofer" • User: "Moving" must end before 20 • Temporal constraint: "Plumbing" must end before 17 • Disjunctive resource constraint: "Plumbing" must precede "Roofing" • Temporal constraint: "Moving" cannot end before 19 C. Le Pape
G. M. Locality Principle (3) 0 5 10 15 20 Masonry Plumbing Carpentry R. W. Ceilings Facade Paint. C. Le Pape
Resource sub-problem Resource sub-problem Resource sub-problem Resource allocation sub-problem Cost function sub-problem Locality Principle (4) Temporal sub-problem C. Le Pape
MIP/CP: Most Important Points MIP • Linear constraints • One relaxation of the global problem • Guidance from the optimal solution of the relaxed problem • Cuts • Scheduling example: hard to deal with resource constraints • CP • Any constraints • Linked relaxations of multiple sub-problems • Guidance from the possible solutions of the relaxed sub-problems • Redundant constraints • Scheduling example: hard to deal with « sum » cost functions C. Le Pape
Local Search • Operators to move from solutions to other (neighbor) solutions (or from populations of solutions to populations of solutions) • Search control strategy (meta-heuristic) • Many different types: simulated annealing, tabu search, genetic algorithms, … C. Le Pape
Main Issues (1) • Mixed Integer Programming • Is the continuous relaxation a good approximation of the convex envelope of the solutions? • Can the formulation of the problem be iteratively modified to make the optimal solution of the continuous relaxation converge toward the optimal solution of the initial problem? C. Le Pape
Main Issues (2) • Constraint Programming • Are the critical constraints propagating well? • Is a tight bound on the optimization criterion efficiently translated (by propagation) into constraints that effectively guide the search toward a solution? C. Le Pape
Main Issues (3) • Local Search • Is the neighborhood topology consistent with the optimization criterion? • Are the operators connecting (in a few steps) good solutions with better solutions, without downgrading the solution too much in intermediate steps? C. Le Pape
Outline • Introduction • Problem decomposition • Constraint propagation • Propagation of global constraints • Objective functions • What ifs • Search • Conclusion C. Le Pape
Sub-model 1 Solver 1 Sub-model 2 Solver 2 Sub-model 3 Solver 3 Problem Decomposition Complete model C. Le Pape
Sequential Decomposition • Solve sub-problem 1 • Impose the solution of sub-problem 1 and solve sub-problem 2 • Infer characteristics of « good » solutions of sub-problem 1 • Iterate C. Le Pape
Column Generation • Principle • Generate candidate solution components • Find the optimal combination of these components • Infer characteristics of « good » solution components to add • Iterate • Examples • Train scheduling • Crew scheduling • Routing C. Le Pape