DM554/DM545 Linear and Integer Programming Lecture 9 Integer Linear Programming Modeling Marco Chiarandini Department of Mathematics & Computer Science University of Southern Denmark
Integer Programming Outline Modeling 1. Integer Programming 2. Modeling Assignment Problem Knapsack Problem Set Problems 2
Integer Programming Outline Modeling 1. Integer Programming 2. Modeling Assignment Problem Knapsack Problem Set Problems 3
Integer Programming Discrete Optimization Modeling • Often we need to deal with integral inseparable quantities • Sometimes rounding can go • Other times rounding not feasible: eg, presence of a bus on a line is 0.3... 4
Integer Programming Integer Linear Programming Modeling Linear Objective The world is not linear: "OR is the art Linear Constraints and science of obtaining bad answers but! integer variables to questions to which otherwise worse answers would be given" max c T x + h T y max c T x A x + G y ≤ b max c T x max c T x A x ≤ b x ≥ 0 A x ≤ b x ≥ 0 A x ≤ b y ≥ 0 x ∈ { 0 , 1 } n x ≥ 0 x integer y integer Linear Binary Integer Integer (Linear) Mixed Integer Programming Program (BIP) Programming (ILP) (Linear) (LP) 0/1 Integer Programming Programming (MILP) max f ( x ) Non-linear Programming g ( x ) ≤ b (NLP) x ≥ 0 5
Integer Programming Modeling Recall: • Z set of integers • Z + set of positive integer • Z + 0 set of nonnegative integers ( { 0 } ∪ Z + ) • N 0 set of natural numbers, ie, nonnegative integers { 0 , 1 , 2 , 3 , 4 , ... } 6
Integer Programming Combinatorial Optimization Problems Modeling Definition (Combinatorial Optimization Problem (COP)) Input: Given a finite set N = { 1 , . . . , n } of objects, weights c j ∀ j ∈ N , a collection of feasible subsets of N , F Task: Find a minimum weight feasible subset, ie, � min c j | S ∈ F S ⊆ N j ∈ S Many COP can be modelled as IP or BIP. � 1 if j ∈ S Typically: incidence vector of S , x S ∈ B n : x S j = 0 otherwise 7
Integer Programming Rounding Modeling 3 x 1 − 2 x 2 + 4 x 2 max 100 x 1 + 64 x 2 50 x 1 + 31 x 2 ≤ 250 3 x 1 − 2 x 2 ≥ − 4 x 1 , x 2 ∈ Z + LP optimum ( 376 / 193 , 950 / 193 ) IP optimum ( 5 , 0 ) x 1 x 1 + 0 . 64 x 2 − 4 50 x 1 + 31 x 2 − 250 � feasible region convex but not continuous: Now the optimum can be on the border (vertices) but also internal. Possible way: solve the relaxed problem. • If solution is integer, done. • If solution is rational (never irrational) try rounding to the nearest integers (but may exit feasibility region) if in R 2 then 2 2 possible roundings (up or down) if in R n then 2 n possible roundings (up or down) Note: rounding does not help in the example above! 8
Integer Programming Cutting Planes Modeling max x 1 + 4 x 2 x 1 + 6 x 2 ≤ 18 x 1 ≤ 3 x 1 , x 2 ≥ 0 x 1 , x 2 integers x 2 x 1 = 3 x 1 + 6 x 2 = 18 x 1 + x 2 = 5 x 1 x 1 + 4 x 2 = 2 9
Integer Programming Branch and Bound Modeling max x 1 + 2 x 2 x 1 + 4 x 2 ≤ 8 4 x 1 + x 2 ≤ 8 x 1 , x 2 ≥ 0 , integer x 2 x 1 + 4 x 2 = 8 x 1 x 1 + 2 x 2 = 1 4 x 1 + x 2 = 8 10
Integer Programming Modeling 4 . 8 x 1 ≤ 1 x 1 ≥ 2 x 2 x 2 x 1 = 1 x 1 + 4 x 2 = 8 x 1 + 4 x 2 = 8 x 1 x 1 x 1 + 2 x 2 = 1 x 1 + 2 x 2 = 1 4 x 1 + x 2 = 8 4 x 1 + x 2 = 8 11
Integer Programming Modeling 4 . 8 −∞ x 1 ≤ 1 x 1 ≥ 2 x 1 = 2 4 . 5 2 x 2 = 0 2 −∞ x 2 ≤ 1 x 2 ≥ 2 x 1 = 1 x 1 = 0 3 4 x 2 = 1 3 4 x 2 = 2 x 2 x 2 x 1 + 4 x 2 = 8 x 1 + 4 x 2 = 8 x 1 x 1 x 1 + 2 x 2 = 1 x 1 + 2 x 2 = 1 4 x 1 + x 2 = 8 4 x 1 + x 2 = 8 12
Integer Programming Outline Modeling 1. Integer Programming 2. Modeling Assignment Problem Knapsack Problem Set Problems 13
Integer Programming Mathematical Programming: Modeling Modeling • Find out exactly what the decision maker needs to know: • which investment? • which product mix? • which job j should a person i do? • Define Decision Variables of suitable type (continuous, integer valued, binary) corresponding to the needs • Formulate Objective Function computing the benefit/cost • Formulate mathematical Constraints indicating the interplay between the different variables. 14
Integer Programming How to “build” a constraint Modeling • Formulate relationship between the variables in plain words • Then formulate your sentences using logical connectives and, or, not, implies • Finally convert the logical statement to a mathematical constraint. Example • “The power plant must not work in both of two neighbouring time periods” • on/off is modelled using binary integer variables • x i = 1 or x i = 0 • x i = 1 implies ⇒ x i + 1 = 0 • x i + x i + 1 ≤ 1 15
Integer Programming Outline Modeling 1. Integer Programming 2. Modeling Assignment Problem Knapsack Problem Set Problems 16
Integer Programming The Assignment Problem Modeling Problem Common application: Assignees are being assigned to perform tasks . Suppose we have n persons and n jobs Each person has a certain proficiency at each job. Formulate a mathematical model that can be used to find an assignment that maximizes the total proficiency. 17
The Assignment Problem Integer Programming Modeling Model Decision Variables: � 1 if person i is assigned job j x ij = for i , j = 1 , 2 , . . . , n 0 otherwise, Objective Function: n n � � max ρ ij x ij i = 1 j = 1 where ρ ij is person i ’s proficiency at job j 18
The Assignment Problem Integer Programming Modeling Model Constraints: Each person is assigned one job: n � x ij = 1 for all i j = 1 e.g. for person 1 we get x 11 + x 12 + x 13 + · · · + x 1 n = 1 Each job is assigned to one person: n � x ij = 1 for all j i = 1 e.g. for job 1 we get x 11 + x 21 + x 31 + · · · + x n 1 = 1 19
Integer Programming Outline Modeling 1. Integer Programming 2. Modeling Assignment Problem Knapsack Problem Set Problems 20
Integer Programming The Knapsack Problem Modeling Problem .. Input: Given a set of n items, each with a value v i and weight w i ( i = 1 , . . . , n ) Task: determine the number of each items to include in a collection so that the total weight is less than a given limit, W , and the total value is as large as possible. The “knapsack” name derives from the problem faced by someone who is constrained by a fixed-size knapsack and must fill it with the most useful items. Assuming we can take at most one of any item and that � i w i > W , formulate a mathematical model to determine which items give the largest value. Model used, eg, in capital budgeting, project selection, etc. 21
Integer Programming The Knapsack Problem Modeling Decision Variables: � 1 if item i is taken x i = for i = 1 , 2 . . . , n 0 otherwise, Objective Function: n � max v i x i i = 1 Constraints: Knapsack capacity restriction: n � w i x i ≤ W i = 1 22
Integer Programming Outline Modeling 1. Integer Programming 2. Modeling Assignment Problem Knapsack Problem Set Problems 23
Integer Programming Set Covering Modeling Problem Given: a set of regions, a set of possible construction locations for emergency centers, regions that can be served in less than 8 minutes, cost of installing an emergency center in each location. Task: decide where to install a set of emergency centers such that the total cost is minimized and all regions are safely served As a COP : M = { 1 , . . . , m } regions, N = { 1 , . . . , n } centers, S j ⊆ M regions serviced by j ∈ N in 8 min. � � min c j | S j = M T ∈ N j ∈ T j ∈ T regions: M = { 1 , . . . , 5 } centers: N = { 1 , . . . , 6 } cost of centers: c j = 1 ∀ j = 1 , . . . , 6 coverages: S 1 = ( 1 , 2 ) , S 2 = ( 1 , 3 , 5 ) , S 3 = ( 2 , 4 , 5 ) , S 4 = ( 3 ) , S 5 = ( 1 ) , S 6 = ( 4 , 5 ) 24
Integer Programming Modeling Example • regions: M = { 1 , . . . , 5 } centers: N = { 1 , . . . , 6 } cost of centers: c j = 1 ∀ j = 1 , . . . , 6 coverages: S 1 = ( 1 , 2 ) , S 2 = ( 1 , 3 , 5 ) , S 3 = ( 2 , 4 , 5 ) , S 4 = ( 3 ) , S 5 = ( 1 ) , S 6 = ( 4 , 5 ) • x 1 x 2 x 3 x 4 x 5 x 6 S 1 S 2 S 3 S 4 S 5 S 6 1 1 1 0 0 1 0 2 1 0 1 0 0 0 A = 3 0 1 0 1 0 0 4 0 0 1 0 0 1 5 0 1 1 0 0 1 25
Integer Programming Modeling As a BIP: Variables: x ∈ B n , x j = 1 if center j is selected, 0 otherwise Objective: n � min c j x j j = 1 Constraints: � 1 • incidence matrix: a ij = 0 • � n j = 1 a ij x j ≥ 1 26
Integer Programming Modeling Set covering Set partitioning Set packing cover each of M at least cover exactly once each cover as many of M once element of M without overlap 1. min, ≥ 1. max or min, = 1. max, ≤ 2. all RHS terms are 1 2. all RHS terms are 1 2. all RHS terms are 1 3. all matrix elements 3. all matrix elements 3. all matrix elements are 1 are 1 are 1 min c T x max c T x max c T x A x ≥ 1 A x ≤ 1 A x = 1 x ∈ B n x ∈ B n x ∈ B n Generalization: RHS ≥ 1 Application examples: • Aircrew scheduling: M : legs to cover, N : rosters • Vehicle routing: M : customers, N : routes 27
A good written example of how to present a model: [from G. Desaulniers, J. Desrosiers, Y. Dumas, M.M. Solomon and F. Soumis. Daily Aircraft Routing and Scheduling. Management Science, 1997, 43(6), 841-855]
Recommend
More recommend