Discovering Combinatorial Optimization with the ILOG Optimization Suite Gregory Glockner, Ph.D. Optimization Product Manager ILOG, Inc.

Slides:



Advertisements
Similar presentations
CPAIOR02 School on OptimizationC. Le Pape1 Integrating Operations Research Algorithms in Constraint Programming Claude Le Pape ILOG S.A.
Advertisements

BU Decision Models Integer_LP1 Integer Optimization Summer 2013.
1 Constraint Satisfaction Problems A Quick Overview (based on AIMA book slides)
© Imperial College London Eplex: Harnessing Mathematical Programming Solvers for Constraint Logic Programming Kish Shen and Joachim Schimpf IC-Parc.
G53CLP Constraint Logic Programming Modeling CSPs – Case Study I Dr Rong Qu.
Types of Algorithms.
EE 553 Integer Programming
Lecture 10: Integer Programming & Branch-and-Bound
Branch & Bound Algorithms
Crew Scheduling Housos Efthymios, Professor Computer Systems Laboratory (CSL) Electrical & Computer Engineering University of Patras.
Vehicle Routing & Scheduling: Part 1
Algorithm Strategies Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Integer Programming 3 Brief Review of Branch and Bound
1 Optimisation Although Constraint Logic Programming is somehow focussed in constraint satisfaction (closer to a “logical” view), constraint optimisation.
Constraint Satisfaction Problems
Penn ESE535 Spring DeHon 1 ESE535: Electronic Design Automation Day 5: February 2, 2009 Architecture Synthesis (Provisioning, Allocation)
Ch 13 – Backtracking + Branch-and-Bound
Linear Programming Applications
1 Planning and Scheduling to Minimize Tardiness John Hooker Carnegie Mellon University September 2005.
Backtracking.
1 Contents college 3 en 4 Book: Appendix A.1, A.3, A.4, §3.4, §3.5, §4.1, §4.2, §4.4, §4.6 (not: §3.6 - §3.8, §4.2 - §4.3) Extra literature on resource.
Daniel Kroening and Ofer Strichman Decision Procedures An Algorithmic Point of View Deciding ILPs with Branch & Bound ILP References: ‘Integer Programming’
CSC 8310 Programming Languages Meeting 2 September 2/3, 2014.
1 Integrated Development Environment Building Your First Project (A Step-By-Step Approach)
Decision Procedures An Algorithmic Point of View
Busby, Dodge, Fleming, and Negrusa. Backtracking Algorithm Is used to solve problems for which a sequence of objects is to be selected from a set such.
1.3 Modeling with exponentially many constr.  Some strong formulations (or even formulation itself) may involve exponentially many constraints (cutting.
Staff Scheduling at USPS Mail Processing & Distribution Centers A Case Study Using Integer Programming.
1 Outline:  Outline of the algorithm  MILP formulation  Experimental Results  Conclusions and Remarks Advances in solving scheduling problems with.
Introduction to Job Shop Scheduling Problem Qianjun Xu Oct. 30, 2001.
Chapter 9 Integer Programming
Chapter 7 Transportation, Assignment & Transshipment Problems
1 Computer Programming (ECGD2102 ) Using MATLAB Instructor: Eng. Eman Al.Swaity Lecture (1): Introduction.
MODELING AND ANALYSIS OF MANUFACTURING SYSTEMS Session 12 MACHINE SETUP AND OPERATION SEQUENCING E. Gutierrez-Miravete Spring 2001.
Heuristic Optimization Methods Tabu Search: Advanced Topics.
Notes 5IE 3121 Knapsack Model Intuitive idea: what is the most valuable collection of items that can be fit into a backpack?
MILP algorithms: branch-and-bound and branch-and-cut
CP Summer School Modelling for Constraint Programming Barbara Smith 2. Implied Constraints, Optimization, Dominance Rules.
Decision Diagrams for Sequencing and Scheduling Andre Augusto Cire Joint work with David Bergman, Willem-Jan van Hoeve, and John Hooker Tepper School of.
Chapter 1. Formulations 1. Integer Programming  Mixed Integer Optimization Problem (or (Linear) Mixed Integer Program, MIP) min c’x + d’y Ax +
Hande ÇAKIN IES 503 TERM PROJECT CONSTRAINT SATISFACTION PROBLEMS.
1 Short Term Scheduling. 2  Planning horizon is short  Multiple unique jobs (tasks) with varying processing times and due dates  Multiple unique jobs.
Chap 10. Integer Prog. Formulations
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
Integer Programming Li Xiaolei. Introduction to Integer Programming An IP in which all variables are required to be integers is called a pure integer.
Constraints and Search Toby Walsh Cork Constraint Computation Centre (4C) Logic & AR Summer School, 2002.
Integer Programming (정수계획법)
Operational Research & ManagementOperations Scheduling Economic Lot Scheduling 1.Summary Machine Scheduling 2.ELSP (one item, multiple items) 3.Arbitrary.
Types of Algorithms. 2 Algorithm classification Algorithms that use a similar problem-solving approach can be grouped together We’ll talk about a classification.
Session 3 University of Southern California ISE514 September 1, 2015 Geza P. Bottlik Page 1 Outline Questions? Sales and Operations Planning Examples Qualifiers.
Constraint Programming in Operations Management
8/14/04 J. Bard and J. W. Barnes Operations Research Models and Methods Copyright All rights reserved Lecture 6 – Integer Programming Models Topics.
The Hashemite University Computer Engineering Department
Lecture 6 – Integer Programming Models Topics General model Logic constraint Defining decision variables Continuous vs. integral solution Applications:
Introduction to Integer Programming Integer programming models Thursday, April 4 Handouts: Lecture Notes.
Balanced Billing Cycles and Vehicle Routing of Meter Readers by Chris Groër, Bruce Golden, Edward Wasil University of Maryland, College Park American University,
DECISION 1. How do you do a Bubble Sort? Bubble Sort:  You compare adjacent items in a list;  If they are in order, leave them.  If they are not in.
Discrete Optimization MA2827 Fondements de l’optimisation discrète Material from P. Van Hentenryck’s course.
Scheduling with Constraint Programming
Staff Scheduling at USPS Mail Processing & Distribution Centers
Introduction to Operations Research
1.3 Modeling with exponentially many constr.
Integer Programming (정수계획법)
1.3 Modeling with exponentially many constr.
Planning and Scheduling in Manufacturing and Services
A QUICK START TO OPL IBM ILOG OPL V6.3 > Starting Kit >
Integer Programming (정수계획법)
Constraint satisfaction problems
Chapter 1. Formulations.
Constraint satisfaction problems
Presentation transcript:

Discovering Combinatorial Optimization with the ILOG Optimization Suite Gregory Glockner, Ph.D. Optimization Product Manager ILOG, Inc.

2 Agenda q About ILOG q Brief introduction to constraint programming q Exploring combinatorial optimization q Exploring iterative optimization q Discrete scheduling Overview

3 q Founded 1987 q 590 employees q 2,000+ customers q Selling in 30 countries q NASDAQ/Euronext ISV/OEM Partners Most influential IT companies for World Leader in Software Components About ILOG

4 Views Component Suite JViews Component Suite JTGO CPLEX Solver JRules Rules ILOG Core Technologies About ILOG

5 ILOG CPLEX CPLEX ILOG Solver & ILOG Solver & ILOG JSolver ILOG Concert Technology (C++ & ) ILOG Concert Technology (C++ & Java) Hybrid ILOG Optimization Suite ILOG OPL Studio ILOG OPL Studio ILOGSchedulerILOGDispatcherILOGConfigurator ILOG JConfigurator About ILOG

6 ILOG Optimization Suite – 2 q Core Engines q ILOG Solver - Constraint Programming Engine q ILOG CPLEX - Math Programming Engine q Vertical Engine Extensions q ILOG Scheduler - Constraint-Based Scheduling q ILOG Dispatcher - Vehicle Routing, Technician Dispatching q ILOG Configurator - Product and Service Configuration q Modeling Tools q OPL Studio - Rapid Development of Optimization Apps q AMPL - Modeling Support for CPLEX About ILOG We use OPL Studio here since its high level language makes it an easy starting point

7 Inside ILOG OPL Studio q OPL: Optimization Programming Language q High-level language specialized for optimization modeling q OPLScript q Procedural language to control optimization process q OPL Studio q IDE to edit and solve models and to view results q OPL Component Libraries q APIs to integrate models into standalone applications via C++, Java, and Microsoft COM and.NET (C#, VB, VBA) q Direct links to the ILOG Optimization Suite q ILOG CPLEX, ILOG Solver, ILOG Scheduler About ILOG

8 Month ç Week ç Day ç Hour Time steps Scope Strategic ç Tactical ç Operational Application Long-term planning Published Schedule Operational Scheduling Drivers Economics ç Feasibility Technology LP ç MIP/Hybrid ç CP Range of Optimization Applications Only ILOG has optimization technology for the entire planning horizon About ILOG

9 Agenda q About ILOG q Brief introduction to constraint programming q Exploring combinatorial optimization q Exploring iterative optimization q Discrete scheduling Overview

10 Constraint Programming Example Find a solution to: x + y < 5, x  y, x, y  {1, …, 5} Branching on y Branching on x Inconsistent values removed by constraint propagation Constraint Programming

11 CP in a Nutshell q Essential problem: To satisfy a given set of constraints by assigning values to variables q Typical problems involve discrete variables q Enumerate values via branch and bound q Try all values in domain q Use general and custom searches q Constraint propagation reduces domain at each node q Eliminate inconsistent values from current partial solution Constraint Programming

12 Comparing CP and IP q Computation at nodes q CP: Constraint propagation is fast but naïve q IP: LP relaxation is slow, powerful algorithm q Constraint representation q IP uses linear inequalities q CP uses logical constraints q Search methods q IP has built-in branch-and-bound algorithm q User supplies CP search Constraint Programming

13 Some CP Constraints – 1 q Logical and high-order q (x > 0)  (y = 0) q (Q = 0)  (Q  100) q C = 5  Q  (Q > 0) q Element and table q T =  i C[x[ i ]] q (x, y)  {(0,0), (2,3), (3,2), (5,0), (0,5)} Constraint Programming

14 Some CP Constraints – 2 q Global q AllDifferent(x) q Cardinality: | { x  S : x = 3 } | = 5 q Path: x defines a Hamiltonian cycle q Custom constraints q Define your own by extending constraint classes Constraint Programming

15 Search Algorithms q IP uses priorities and economic pseudocosts to direct branch-and-bouond tree exploration scheme q CP requires explicit search algorithm q Ex 1: Branch on variable with smallest domain q Ex 2: Branch on variable with lowest costs q Exploiting problem structure leads to fastest solutions Constraint Programming

16 Comparing IP and CP modeling q Example: Pick two different items q Each has a natural formulation q IPs have more variables and constraints q CPs have large variable domains Constraint Programming IP: Use binary variables and linear constraints CP: Use general variables with logical constraints  i x[ i ] = 1  i y[ i ] = 1 x[ i ] + y[ i ] <= 1 for all i x  { 1, …, n } x <> y

17 Typical Applications q LP/MIP q Planning models with complex economics where optimal solution is required q CP q Operational models with complex operations where many good feasible solutions are required Constraint Programming

18 Agenda q About ILOG q Brief introduction to constraint programming q Exploring combinatorial optimization q Exploring iterative optimization q Discrete scheduling Overview

19 Exercise 1: Solving a set covering IP q Set of tasks q enum Tasks...; q Set of workers q range Workers 1..nbWorkers; q A subset of workers are qualified to perform each task q {Workers} qualified[Tasks] =...; q Find cheapest set of workers who are qualified to cover all jobs Combinatorial Optimization

20 Completing exercise 1 q First, setup tutorial files and launch OPL Studio q ~gglockner/tutorial/setup q cd ~/ilog q opl q Select File > Open > Project and open setcvr.prj q Write objective function and covering constraint q Run by selecting Execution > Run q Stop by selecting Execution > Abort  Note: Your personal ilog directory (e.g. ~/ilog ) contains all sample files and a shell script for OPL Studio Combinatorial Optimization

21 Exercise 2: Map coloring CP q Set of countries q enum Country...; q Set of colors q enum Colors...; q Set of bordering pairs q {adj} Border =...; q Assign a color to each country so that no bordering countries have same color Combinatorial Optimization

22 Completing exercise 2 q Load map.prj q Add logical constraint to require bordering countries to have different colors q Run and use continue to find all solutions q Optional: Rewrite the problem to see if this map can be colored using fewer colors! q Create binary indicator variable colorUsed[i] q Add objective and constraint on colorUsed indicators m NB: Unlike MP, you can index a CP decision variable by another q Change “solve” to “subject to” q Save as map2 since we will reuse old version for exercise 3 Combinatorial Optimization

23 Exercise 3: Tracing the algorithm q The CP search procedure q As ILOG Solver tries assignments, it propagates the effects to eliminate particular combinations q Once it finds a solution, it backtracks through the search tree and generate alternate solutions q OPL Studio can animate the search procedure q A graphical tree represents the search tree q A table shows the variable domains Combinatorial Optimization

24 Completing exercise 3 q Load completed map coloring model (map.prj) q Select Execution > Browse Active Model q Right click on Variables > color and select display domain q Select Debug > Stop at Choice Point and Debug > Display Search Tree q Select Execution > Next to step through search procedure q Make sure to uncheck Debug > Stop at Choice Point and Debug > Display Search Tree when finished Combinatorial Optimization

25 Demo 1: Advanced graphics q OPL’s graphical drawing board lets you develop custom graphics for a search procedure q Lines, ellipses, rectangles, and polygons q Various colors are available q Text labels q Graphics are undone when backtracking in the search tree q Try it! Run mapgr.prj Combinatorial Optimization

26 Exercise 4: Factory sequencing q There are three car colors: red, blue, and gray q Day is divided into periods q You can make one car each period q Changing colors requires one idle period q You must meet daily production requirements q A simplified supply chain application Combinatorial Optimization

27 Completing exercise 4 q Load factory.prj q Add constraint to satisfy daily demands q Careful! Should be cumulative q Add logical constraint for color changes  Useful logical operators: = (equals), <> (not equals), \/ (or), & (and), ! (not), => (implies) Combinatorial Optimization

28 Improving performance q CP models benefit from redundant constraints that reduce search space q Like IP cuts, these are implied by model structure q Ex 1: No sequence of idle periods q For any two consecutive periods, at least one should not be idle q Ex 2: Color change q If a period is idle, then the surrounding periods should have different colors Combinatorial Optimization

29 Improving performance – 2 q Alternate formulation q For each batch of cars of the same color, determine start time, duration, and the color q Focuses on runs rather than slots q Can use both formulations simultaneously! q More complicated, but more efficient q Easier to constrain run length, etc. q Fewer variables with larger domains q Take advantage of scheduling algorithms in ILOG Scheduler Combinatorial Optimization

30 Agenda q About ILOG q Brief introduction to constraint programming q Exploring combinatorial optimization q Exploring iterative optimization q Discrete scheduling Overview

31 What is iterative optimization? q Solving a sequence of related models q Try various simplified models q Decompose a large problem into subproblems q View model results under different scenarios Iterative Optimization

32 Exercise 5: Resolving q Chicken nuggets q Sold in packages of 4, 6, and 9 q You can buy 10 by combining 4 & 6 q You cannot buy 7 by combining any of these boxes q What is the largest number you cannot make? q Determine this iteratively, not by number theory! Iterative Optimization

33 Completing exercise 5 q Load nuggets.mod q Add constraints to determine if a total of nuggets can be created q Load and run nuggets.osc OPLScript q Optional q Try nuggets in sizes of 4,5,6 or 6,9,20 q Can you change the script to be more efficient? Iterative Optimization

34 Traveling Salesman Problem (TSP) q Canonical combinatorial optimization problem q Create a tour that visits every city exactly once q Make the tour as cheap as possible q Common iterative solution method q Solve an integer programming problem q If you receive sub-cycles, add constraints to break the cycles (subtours) q Repeat until you find a single tour Iterative Optimization

35 Demo 2: Solving the TSP q Open OPLScript in tsp.osc q Solves the TSP as a series of integer programs q Animates subtours via the drawing board q Try it! q You can change the data sets in the OPLScript q Note: Some data do not have graphics Iterative Optimization

36 Agenda q About ILOG q Brief introduction to constraint programming q Exploring combinatorial optimization q Exploring iterative optimization q Discrete scheduling Overview

37 Describing a scheduling problem q Modeling entities for scheduling problems q Activity variables m Defined by start time, end time, and duration m Can be breakable m Various precendence constraints for activities q Resource constraints m Unary Resources m Discrete Resources m Reservoirs m State Resources with Transition Times q Combine scheduling with generic constraint programming elements Discrete scheduling

38 Want to decide the sequence of tasks to build a house Each task requires a certain amount of time to be completed Each task requires certain other tasks to be completed enum Tasks { masonry, carpentry, plumbing, ceiling, roofing, painting, windows, facade, garden, moving }; int duration[Tasks] = [7,3,8,3,1,2,1,2,1,1]; Activity a[t in Tasks](duration[t]);... a[masonry] precedes a[ceiling]; a[carpentry] precedes a[roofing]; a[ceiling] precedes a[painting];... Activity scheduling: Construction Discrete scheduling

39 Each task requires one worker from a set Want to balance the workload enum Workers { Alan, Beth, Carl }; UnaryResource worker[Workers]; var int assign[Tasks,Workers] in 0..1; forall(t in Tasks, w in Workers) a[t] requires (assign[t,w]) worker[w]; forall(t in Tasks) sum(w in Workers) assign[t,w] = 1; Activity onsite[w in Workers]; minimize max(w in Workers) onsite[w].duration forall(t in Tasks, w in Workers) assign[t,w]=1 => (onsite[w].start <= a[t].start & onsite[w].end >= a[t].end); sum(w in Workers) onsite[w].duration >= sum(t in Tasks) duration[t]; Activity scheduling (2) Redundant Constraints Discrete scheduling

40 enum Tasks { masonry, carpentry, plumbing, ceiling, roofing, painting, windows, facade, garden, moving }; enum Workers {Alan, Beth, Carl}; int duration[Tasks] = [7,3,8,3,1,2,1,2,1,1]; scheduleHorizon = sum(t in Tasks) duration[t]; Activity a[t in Tasks](duration[t]); Activity onsite[Workers]; var int assign[Tasks,Workers] in 0..1; UnaryResource worker[Workers]; minimize max (w in Workers) onsite[w].duration subject to { a[masonry] precedes a[carpentry]; a[masonry] precedes a[plumbing]; a[masonry] precedes a[ceiling]; a[carpentry] precedes a[roofing];... forall(t in Tasks, w in Workers) a[t] requires(assign[t,w]) worker[w]; forall(t in Tasks) sum(w in Workers) assign[t,w] = 1; forall(t in Tasks, w in Workers) assign[t,w]=1 => (onsite[w].start <= a[t].start & onsite[w].end >= a[t].end); sum (w in Workers) onsite[w].duration >= sum (t in Tasks) duration[t]; }; Decision Variables Objective Function Constraints Data OPL scheduling model Discrete scheduling

41 Exercise 6: Scheduling q Open and run the model balhouse.mod q Look at the Gantt and resource charts q Double-click on the activities and resources q Try adding a constraint that Beth cannot do the plumbing q Try adding a constraint that Carl must be finished no later than day 13 m Hint: Every activity has a start, end, and duration time Discrete scheduling