Chapter 8 Integer Linear Programming Types of Integer Linear Programming Models Graphical and Computer Solutions for an AllInteger Linear Program Applications Involving 0-1 Variables Modeling Flexibility Provided by 0-1 Variables © 2005 Thomson/South-Western Slide 1 Types of Integer Programming Models An LP in which all the variables are restricted to be integers is called an all-integer linear program (ILP). The LP that results from dropping the integer requirements is called the LP Relaxation of the ILP. If only a subset of the variables are restricted to be integers, the problem is called a mixed-integer linear program (MILP). Binary variables are variables whose values are restricted to be 0 or 1. If all variables are restricted to be 0 or 1, the problem is called a 0-1 or binary integer linear program. © 2005 Thomson/South-Western Slide 2 Example: All-Integer LP Consider the following all-integer linear program: Max 3x1 + 2x2 s.t. 3x1 + x2 < 9 x1 + 3x2 < 7 -x1 + x2 < 1 x1, x2 > 0 and integer © 2005 Thomson/South-Western Slide 3 Example: All-Integer LP LP Relaxation Solving the problem as a linear program ignoring the integer constraints, the optimal solution to the linear program gives fractional values for both x1 and x2. From the graph on the next slide, we see that the optimal solution to the linear program is: x1 = 2.5, x2 = 1.5, z = 10.5 © 2005 Thomson/South-Western Slide 4 Example: All-Integer LP LP Relaxation x2 5 -x1 + x2 < 1 4 3x1 + x2 < 9 3 Max 3x1 + 2x2 LP Optimal (2.5, 1.5) 2 x1 + 3x2 < 7 1 1 2 3 © 2005 Thomson/South-Western 4 5 6 7 x1 Slide 5 Example: All-Integer LP Rounding Up If we round up the fractional solution (x1 = 2.5, x2 = 1.5) to the LP relaxation problem, we get x1 = 3 and x2 = 2. From the graph on the next slide, we see that this point lies outside the feasible region, making this solution infeasible. © 2005 Thomson/South-Western Slide 6 Example: All-Integer LP Rounded Up Solution x2 5 -x1 + x2 < 1 4 3x1 + x2 < 9 Max 3x1 + 2x2 3 ILP Infeasible (3, 2) 2 LP Optimal (2.5, 1.5) x1 + 3x2 < 7 1 1 2 3 © 2005 Thomson/South-Western 4 5 6 7 x1 Slide 7 Example: All-Integer LP Rounding Down By rounding the optimal solution down to x1 = 2, x2 = 1, we see that this solution indeed is an integer solution within the feasible region, and substituting in the objective function, it gives z = 8. We have found a feasible all-integer solution, but have we found the OPTIMAL all-integer solution? --------------------The answer is NO! The optimal solution is x1 = 3 and x2 = 0 giving z = 9, as evidenced in the next two slides. © 2005 Thomson/South-Western Slide 8 Example: All-Integer LP Complete Enumeration of Feasible ILP Solutions There are eight feasible integer solutions to this problem: x1 x2 z 1. 0 0 0 2. 1 0 3 3. 2 0 6 4. 3 0 9 optimal solution 5. 0 1 2 6. 1 1 5 7. 2 1 8 8. 1 2 7 © 2005 Thomson/South-Western Slide 9 Example: All-Integer LP x2 -x1 + x2 < 1 5 3x1 + x2 < 9 4 Max 3x1 + 2x2 3 ILP Optimal (3, 0) 2 x1 + 3x2 < 7 1 1 2 © 2005 Thomson/South-Western 3 4 5 6 7 x1 Slide 10 Example: All-Integer LP Partial Spreadsheet Showing Problem Data A B C 1 LHS Coefficients 2 Constraint X1 X2 3 #1 3 1 4 #2 1 3 5 #3 -1 1 6 Obj.Coefficients 3 2 © 2005 Thomson/South-Western D RHS 9 7 1 Slide 11 Example: All-Integer LP Partial Spreadsheet Showing Formulas A 8 9 10 11 12 13 14 15 B Optimal Decision Variable Values Maximized Objective Function Constraints #1 #2 #3 LHS =B3*$C$9+C3*$D$9 =B4*$C$9+C4*$D$9 =B5*$C$9+C5*$D$9 © 2005 Thomson/South-Western C X1 D X2 =B6*C9+C6*D9 <= <= <= RHS 9 7 1 Slide 12 Example: All-Integer LP Partial Spreadsheet Showing Optimal Solution A 8 9 10 11 12 13 14 15 B Optimal Decision Variable Values Maximized Objective Function Constraints #1 #2 #3 LHS 9 3 -3 © 2005 Thomson/South-Western C X1 3.000 9.000 <= <= <= D X2 2.9419E-12 RHS 9 7 1 Slide 13 Special 0-1 Constraints When xi and xj represent binary variables designating whether projects i and j have been completed, the following special constraints may be formulated: • • • • At most k out of n projects will be completed: xj < k j Project j is conditional on project i: xj - xi < 0 Project i is a corequisite for project j: xj - xi = 0 Projects i and j are mutually exclusive: xi + xj < 1 © 2005 Thomson/South-Western Slide 14 Example: Metropolitan Microwaves Metropolitan Microwaves, Inc. is planning to expand its operations into other electronic appliances. The company has identified seven new product lines it can carry. Relevant information about each line follows on the next slide. © 2005 Thomson/South-Western Slide 15 Example: Metropolitan Microwaves Product Line 1. 2. 3. 4. 5. 6. 7. TV/VCRs Color TVs Projection TVs VCRs DVD Players Video Games Home Computers © 2005 Thomson/South-Western Initial Floor Space Exp. Rate Invest. (Sq.Ft.) of Return $ 6,000 12,000 20,000 14,000 15,000 2,000 32,000 125 150 200 40 40 20 100 8.1% 9.0 11.0 10.2 10.5 14.1 13.2 Slide 16 Example: Metropolitan Microwaves Metropolitan has decided that they should not stock projection TVs unless they stock either TV/VCRs or color TVs. Also, they will not stock both VCRs and DVD players, and they will stock video games if they stock color TVs. Finally, the company wishes to introduce at least three new product lines. If the company has $45,000 to invest and 420 sq. ft. of floor space available, formulate an integer linear program for Metropolitan to maximize its overall expected return. © 2005 Thomson/South-Western Slide 17 Example: Metropolitan Microwaves Define the Decision Variables xj = 1 if product line j is introduced; = 0 otherwise. where: Product line 1 = TV/VCRs Product line 2 = Color TVs Product line 3 = Projection TVs Product line 4 = VCRs Product line 5 = DVD Players Product line 6 = Video Games Product line 7 = Home Computers © 2005 Thomson/South-Western Slide 18 Example: Metropolitan Microwaves Define the Decision Variables xj = 1 if product line j is introduced; = 0 otherwise. Define the Objective Function Maximize total expected return: Max .081(6000)x1 + .09(12000)x2 + .11(20000)x3 + .102(14000)x4 + .105(15000)x5 + .141(2000)x6 + .132(32000)x7 © 2005 Thomson/South-Western Slide 19 Example: Metropolitan Microwaves Define the Constraints 1) Money: 6x1 + 12x2 + 20x3 + 14x4 + 15x5 + 2x6 + 32x7 < 45 2) Space: 125x1 +150x2 +200x3 +40x4 +40x5 +20x6 +100x7 < 420 3) Stock projection TVs only if stock TV/VCRs or color TVs: x1 + x2 > x3 or x1 + x2 - x3 > 0 © 2005 Thomson/South-Western Slide 20 Example: Metropolitan Microwaves Define the Constraints (continued) 4) Do not stock both VCRs and DVD players: x4 + x5 < 1 5) Stock video games if they stock color TV's: x2 - x6 > 0 6) Introduce at least 3 new lines: x1 + x2 + x3 + x4 + x5 + x6 + x7 > 3 7) Variables are 0 or 1: xj = 0 or 1 for j = 1, , , 7 © 2005 Thomson/South-Western Slide 21 Example: Metropolitan Microwaves Partial Spreadsheet Showing Problem Data A B C 1 2 Constraints X1 3 #1 6 4 #2 125 5 #3 1 6 #4 0 7 #5 0 8 #6 1 9 Obj.Func.Coeff. 486 D E F LHS Coefficients X2 X3 X4 X5 12 20 14 15 150 200 40 40 1 -1 0 0 0 0 1 1 1 0 0 0 1 1 1 1 1080 2200 1428 1575 © 2005 Thomson/South-Western G X6 2 20 0 0 -1 1 282 H I X7 RHS 32 45 100 420 0 0 0 1 0 0 1 3 4224 Slide 22 Example: Metropolitan Microwaves Partial Spreadsheet Showing Example Formulas A 12 13 14 15 16 17 18 19 20 21 22 B C D X1 X2 X3 Dec.Values 0 0 0 Maximized Total Expected Return Constraints Money Space TVs VCRs Video Lines © 2005 Thomson/South-Western LHS 0 0 0 0 0 0 E X4 0 F X5 0 0 <= <= >= <= >= >= G X6 0 H X7 0 RHS 45 420 0 1 0 3 Slide 23 Example: Metropolitan Microwaves Solver Parameters Dialog Box © 2005 Thomson/South-Western Slide 24 Example: Metropolitan Microwaves Solver Options Dialog Box © 2005 Thomson/South-Western Slide 25 Example: Metropolitan Microwaves Integer Options Dialog Box © 2005 Thomson/South-Western Slide 26 Example: Metropolitan Microwaves Optimal Solution A 12 13 14 15 16 17 18 19 20 21 22 B C D X1 X2 X3 Dec.Values 1 0 1 Maximized Total Expected Return Constraints Money Space TVs VCRs Video Lines © 2005 Thomson/South-Western LHS 41 365 0 1 0 3 E X4 0 F X5 1 4261 <= <= >= <= >= >= G X6 0 H X7 0 RHS 45 420 0 1 0 3 Slide 27 Example: Metropolitan Microwaves Optimal Solution Introduce: TV/VCRs, Projection TVs, and DVD Players Do Not Introduce: Color TVs, VCRs, Video Games, and Home Computers Total Expected Return: $4,261 © 2005 Thomson/South-Western Slide 28 Example: Tina’s Tailoring Tina's Tailoring has five idle tailors and four custom garments to make. The estimated time (in hours) it would take each tailor to make each garment is shown in the next slide. (An 'X' in the table indicates an unacceptable tailor-garment assignment.) Garment Wedding gown Clown costume Admiral's uniform Bullfighter's outfit 1 19 11 12 X © 2005 Thomson/South-Western Tailor 2 3 4 5 23 20 21 18 14 X 12 10 8 11 X 9 20 20 18 21 Slide 29 Example: Tina’s Tailoring Formulate an integer program for determining the tailor-garment assignments that minimize the total estimated time spent making the four garments. No tailor is to be assigned more than one garment and each garment is to be worked on by only one tailor. -------------------This problem can be formulated as a 0-1 integer program. The LP solution to this problem will automatically be integer (0-1). © 2005 Thomson/South-Western Slide 30 Example: Tina’s Tailoring Define the decision variables xij = 1 if garment i is assigned to tailor j = 0 otherwise. Number of decision variables = [(number of garments)(number of tailors)] - (number of unacceptable assignments) = [4(5)] - 3 = 17 © 2005 Thomson/South-Western Slide 31 Example: Tina’s Tailoring Define the objective function Minimize total time spent making garments: Min 19x11 + 23x12 + 20x13 + 21x14 + 18x15 + 11x21 + 14x22 + 12x24 + 10x25 + 12x31 + 8x32 + 11x33 + 9x35 + 20x42 + 20x43 + 18x44 + 21x45 © 2005 Thomson/South-Western Slide 32 Example: Tina’s Tailoring Define the Constraints Exactly one tailor per garment: 1) x11 + x12 + x13 + x14 + x15 = 1 2) x21 + x22 + x24 + x25 = 1 3) x31 + x32 + x33 + x35 = 1 4) x42 + x43 + x44 + x45 = 1 © 2005 Thomson/South-Western Slide 33 Example: Tina’s Tailoring Define the Constraints (continued) No more than one garment per tailor: 5) x11 + x21 + x31 < 1 6) x12 + x22 + x32 + x42 < 1 7) x13 + x33 + x43 < 1 8) x14 + x24 + x44 < 1 9) x15 + x25 + x35 + x45 < 1 Nonnegativity: xij > 0 for i = 1, . . ,4 and j = 1, . . ,5 © 2005 Thomson/South-Western Slide 34 Cautionary Note About Sensitivity Analysis Sensitivity analysis often is more crucial for ILP problems than for LP problems. A small change in a constraint coefficient can cause a relatively large change in the optimal solution. Recommendation: Resolve the ILP problem several times with slight variations in the coefficients before choosing the “best” solution for implementation. © 2005 Thomson/South-Western Slide 35 End of Chapter 8 © 2005 Thomson/South-Western Slide 36
© Copyright 2026 Paperzz