Presentation is loading. Please wait.

Presentation is loading. Please wait.

Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-1 Integer Linear Programming Chapter 6.

Similar presentations


Presentation on theme: "Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-1 Integer Linear Programming Chapter 6."— Presentation transcript:

1 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-1 Integer Linear Programming Chapter 6

2 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-2 Introduction u When one or more variables in an LP problem must assume an integer value we have an Integer Linear Programming (ILP) problem. u ILPs occur frequently –Scheduling workers –Manufacturing airplanes u Integer variables also allow us to build more accurate models for a number of common business problems.

3 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-3 Integrality Conditions MAX: 350X 1 + 300X 2 } profit S.T.:1X 1 + 1X 2 <= 200} pumps 9X 1 + 6X 2 <= 1566} labor 12X 1 + 16X 2 <= 2880} tubing X 1, X 2 >= 0} nonnegativity X 1, X 2 must be integers } integrality Integrality conditions are easy to state but make the problem much more difficult (and sometimes impossible) to solve.

4 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-4 Relaxation u Original ILP MAX:2X 1 + 3X 2 S.T.:X 1 + 3X 2 <= 8.25 2.5X 1 + X 2 <= 8.75 X 1, X 2 >= 0 X 1, X 2 must be integers u LP Relaxation MAX:2X 1 + 3X 2 S.T.:X 1 + 3X 2 <= 8.25 2.5X 1 + X 2 <= 8.75 X 1, X 2 >= 0

5 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-5 Integer Feasible vs. LP Feasible Region X1X1 X2X2 Integer Feasible Solutions 0 0 123 4 1 2 3

6 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-6 Solving ILP Problems u When solving an LP relaxation, sometimes you “get lucky” and obtain an integer feasible solution. u This was the case in the original Blue Ridge Hot Tubs problem in earlier chapters. u But what if we reduce the amount of labor available to 1520 hours and the amount of tubing to 2650 feet? See file Fig6-2.xls

7 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-7 Bounds u The optimal solution to an LP relaxation of an ILP problem gives us a bound on the optimal objective function value.  For maximization problems, the optimal relaxed objective function values is an upper bound on the optimal integer value.  For minimization problems, the optimal relaxed objective function values is a lower bound on the optimal integer value.

8 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-8 Rounding u It is tempting to simply round a fractional solution to the closest integer solution. u In general, this does not work reliably: –The rounded solution may be infeasible. –The rounded solution may be suboptimal.

9 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-9 How Rounding Down Can Result in an Infeasible Solution X1X1 X2X2 0 0 1234 1 2 3 optimal relaxed solution infeasible solution obtained by rounding down

10 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-10 Branch-and-Bound u The Branch-and-Bound (B&B) algorithm can be used to solve ILP problems. u Requires the solution of a series of LP problems termed “candidate problems”. u Theoretically, this can solve any ILP. u Practically, it often takes LOTS of computational effort (and time).

11 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-11 Stopping Rules u Because B&B take take so long, most ILP packages allow you to specify a suboptimality tolerance factor. u This allows you to stop once an integer solution is found that is within some % of the global optimal solution. u Bounds obtained from LP relaxations are helpful here. –Example v LP relaxation has an optimal obj. value of $64,306. v 95% of $64,306 is $61,090. v Thus, an integer solution with obj. value of $61,090 or better must be within 5% of the optimal solution.

12 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-12 Using Solver Let’s see how to specify integrality conditions and suboptimality tolerances using Solver… See file Fig6-8.xls

13 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-13 An Employee Scheduling Problem: Air-Express Day of Week Workers Needed Sunday18 Monday27 Tuesday22 Wednesday26 Thursday25 Friday21 Saturday19 Shift Days OffWage 1Sun & Mon$680 2Mon & Tue$705 3Tue & Wed$705 4Wed & Thr$705 5Thr & Fri$705 6Fri & Sat$680 7Sat & Sun$655

14 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-14 Defining the Decision Variables X 1 = the number of workers assigned to shift 1 X 2 = the number of workers assigned to shift 2 X 3 = the number of workers assigned to shift 3 X 4 = the number of workers assigned to shift 4 X 5 = the number of workers assigned to shift 5 X 6 = the number of workers assigned to shift 6 X 7 = the number of workers assigned to shift 7

15 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-15 Defining the Objective Function Minimize the total wage expense. MIN: 680X 1 +705X 2 +705X 3 +705X 4 +705X 5 +680X 6 +655X 7

16 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-16 Defining the Constraints u Workers required each day 0X 1 + 1X 2 + 1X 3 + 1X 4 + 1X 5 + 1X 6 + 0X 7 >= 18 } Sunday 0X 1 + 0X 2 + 1X 3 + 1X 4 + 1X 5 + 1X 6 + 1X 7 >= 27 } Monday 1X 1 + 0X 2 + 0X 3 + 1X 4 + 1X 5 + 1X 6 + 1X 7 >= 22 }Tuesday 1X 1 + 1X 2 + 0X 3 + 0X 4 + 1X 5 + 1X 6 + 1X 7 >= 26 } Weds. 1X 1 + 1X 2 + 1X 3 + 0X 4 + 0X 5 + 1X 6 + 1X 7 >= 25 } Thurs. 1X 1 + 1X 2 + 1X 3 + 1X 4 + 0X 5 + 0X 6 + 1X 7 >= 21 } Friday 1X 1 + 1X 2 + 1X 3 + 1X 4 + 1X 5 + 0X 6 + 0X 7 >= 19 } Saturday u Nonnegativity & integrality conditions X i >= 0 and integer for all i

17 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-17 Implementing the Model See file Fig6-14.xls

18 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-18 Binary Variables u Binary variables are integer variables that can assume only two values: 0 or 1. u These variables can be useful in a number of practical modeling situations….

19 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-19 A Capital Budgeting Problem: CRT Technologies Expected NPV Project (in $000s) Year 1 Year 2 Year 3 Year 4 Year 5 1$141 $75$25$20$15$10 2$187 $90$35 $0 $0$30 3$121 $60$15$15$15$15 4 $83 $30$20$10 $5 $5 5$265$100$25$20$20$20 6$127 $50$20$10$30$40 Capital (in $000s) Required in u The company currently has $250,000 available to invest in new projects. It has budgeted $75,000 for continued support for these projects in year 2 and $50,000 per year for years 3, 4, and 5.

20 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-20 Defining the Decision Variables

21 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-21 Defining the Objective Function Maximize the total NPV of selected projects. MAX: 141X 1 + 187X 2 + 121X 3 + 83X 4 + 265X 5 + 127X 6

22 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-22 Defining the Constraints u Capital Constraints 75X 1 + 90X 2 + 60X 3 + 30X 4 + 100X 5 + 50X 6 <= 250} year 1 25X 1 + 35x 2 + 15X 3 + 20X 4 + 25X 5 + 20X 6 <= 75} year 2 20X 1 + 0x 2 + 15X 3 + 10X 4 + 20X 5 + 10X 6 <= 50} year 3 15X 1 + 0X 2 + 15X 3 + 5X 4 + 20X 5 + 30X 6 <= 50} year 4 10X 1 + 30X 2 + 15X 3 + 5X 4 + 20X 5 + 40X 6 <= 50} year 5  Binary Constraints All X i must be binary

23 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-23 Implementing the Model See file Fig6-17.xls

24 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-24 Binary Variables & Logical Conditions u Binary variables are also useful in modeling a number of logical conditions. –Of projects 1, 3 & 6, no more than one may be selected  X 1 + X 3 + X 6 <= 1 –Of projects 1, 3 & 6, exactly one must be selected  X 1 + X 3 + X 6 = 1 –Project 4 cannot be selected unless project 5 is also selected v X 4 – X 5 <= 0

25 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-25 The Fixed-Charge Problem u Many decisions result in a fixed or lump-sum cost being incurred: l The cost to lease, rent, or purchase a piece of equipment or a vehicle that will be required if a particular action is taken. l The setup cost required to prepare a machine or production line to produce a different type of product. l The cost to construct a new production line or facility that will be required if a particular decision is made. l The cost of hiring additional personnel that will be required if a particular decision is made.

26 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-26 Example Fixed-Charge Problem : Remington Manufacturing OperationProd. 1Prod. 2Prod. 3Hours Available Machining236600 Grinding634300 Assembly562400 Unit Profit$48$55$50 Setup Cost$1000$800$900 Hours Required By:

27 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-27 Defining the Decision Variables X i = the amount of product i to be produced, i = 1, 2, 3

28 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-28 Defining the Objective Function Maximize total profit. MAX: 48X 1 + 55X 2 + 50X 3 – 1000Y 1 – 800Y 2 – 900Y 3

29 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-29 Defining the Constraints u Resource Constraints 2X 1 + 3X 2 + 6X 3 <= 600} machining 6X 1 + 3X 2 + 4X 3 <= 300} grinding 5X 1 + 6X 2 + 2X 3 <= 400} assembly u Binary Constraints All Y i must be binary u Nonnegativity conditions X i >= 0, i = 1, 2,..., 6 u Is there a missing link?

30 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-30 Defining the Constraints (cont’d) u Linking Constraints (with “Big M”) X 1 <= M 1 Y 1 or X 1 - M 1 Y 1 <= 0 X 2 <= M 2 Y 2 or X 2 - M 2 Y 2 <= 0 X 3 <= M 3 Y 3 or X 3 - M 3 Y 3 <= 0  If X i > 0 these constraints force the associated Y i to equal 1.  If X i = 0 these constraints allow Y i to equal 0 or 1, but the objective will cause Solver to choose 0.  Note that M i imposes an upper bounds on X i.  It helps to find reasonable values for the M i.

31 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-31 Finding Reasonable Values for M 1 u Consider the resource constraints 2X 1 + 3X 2 + 6X 3 <= 600} machining 6X 1 + 3X 2 + 4X 3 <= 300} grinding 5X 1 + 6X 2 + 2X 3 <= 400} assembly  What is the maximum value X 1 can assume? Let X 2 = X 3 = 0 X 1 = MIN(600/2, 300/6, 400/5) = MIN(300, 50, 80) = 50  Maximum values for X 2 & X 3 can be found similarly.

32 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-32 Summary of the Model MAX:48X 1 + 55X 2 + 50X 3 - 1000Y 1 - 800Y 2 - 900Y 3 Subject to:2X 1 + 3X 2 + 6X 3 <= 600} machining 6X 1 + 3X 2 + 4X 3 <= 300} grinding 5X 1 + 6X 2 + 2X 3 <= 400} assembly X 1 - 50Y 1 <= 0 X 2 - 67Y 2 <= 0 linking X 3 - 75Y 3 <= 0 All Y i must be binary X i >= 0, i = 1, 2, 3 }

33 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-33 Potential Pitfall  Do not use IF( ) functions to model the relationship between the X i and Y i. –Suppose cell A5 represents X 1 –Suppose cell A6 represents Y 1 –You’ll want to let A6 = IF(A5>0,1,0) –This will not work with Solver!  Treat the Y i just like any other variable. – Make them changing cells. –Use the linking constraints to enforce the proper relationship between the X i and Y i.

34 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-34 Implementing the Model See file Fig6-21.xls

35 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-35 Minimum Order Size Restrictions Suppose Remington doesn’t want to manufacture any units of product 3 unless it produces at least 40 units... Consider, X 3 <= M 3 Y 3 X 3 >= 40 Y 3

36 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-36 Quantity Discounts Suppose if Blue Ridge Hot Tubs produces more than 75 Aqua-Spas, it obtains discounts that increase the unit profit to $375. If it produces more than 50 Hydro-Luxes, the profit increases to $325.

37 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-37 Quantity Discount Model MAX: 350X 11 + 375X 12 + 300X 21 + 325X 22 S.T.:1X 11 + 1X 12 + 1X 21 + 1X 22 <= 200 } pumps 9X 11 + 9X 12 + 6X 21 + 6X 22 <= 1566} labor 12X 11 + 12X 12 +16X 21 + 16X 22 <= 2880} tubing X 12 <=M 12 Y 1 X 11 >=75Y 1 X 22 <=M 22 Y 2 X 21 >=50Y 2 X ij >= 0 X ij must be integers, Y i must be binary

38 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-38 A Contract Award Problem u B&G Construction has 4 building projects and can purchase cement from 3 companies for the following costs: Max. Project 1Project 2Project 3Project 4Supply Co. 1$120$115$130$125525 Co. 2$100$150$110$105450 Co. 3$140$95$145$165550 Needs450275300350 (tons) Cost per Delivered Ton of Cement

39 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-39 A Contract Award Problem u Side constraints: –Co. 1 will not supply orders of less than 150 tons for any project –Co. 2 can supply more than 200 tons to no more than one of the projects –Co. 3 will accept only orders that total 200, 400, or 550 tons

40 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-40 Defining the Decision Variables X ij = tons of cement purchased from company i for project j

41 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-41 Defining the Objective Function Minimize total cost MIN: 120X 11 + 115X 12 + 130X 13 + 125X 14 + 100X 21 + 150X 22 + 110X 23 + 105X 24 + 140X 31 + 95X 32 + 145X 33 + 165X 34

42 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-42 Defining the Constraints u Supply Constraints X 11 + X 12 + X 13 + X 14 <= 525} company 1 X 21 + X 22 + X 23 + X 24 <= 450} company 2 X 31 + X 32 + X 33 + X 34 <= 550} company 3 u Demand Constraints X 11 + X 21 + X 31 = 450} project 1 X 12 + X 22 + X 32 = 275} project 2 X 13 + X 23 + X 33 = 300} project 3 X 14 + X 24 + X 34 = 350} project 4

43 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-43 Implementing the Transportation Constraints See file Fig6-25.xls

44 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-44 Defining the Constraints u Company 1 Side Constraints X 11 <=525Y 11 X 12 <=525Y 12 X 13 <=525Y 13 X 14 <=525Y 14 X 11 >=150Y 11 X 12 >=150Y 12 X 13 >=150Y 13 X 14 >=150Y 14 Y ij binary

45 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-45 Defining the Constraints u Company 2 Side Constraints X 21 <=200+250Y 21 X 22 <=200+250Y 22 X 23 <=200+250Y 23 X 24 <=200+250Y 24 Y 21 + Y 22 + Y 23 + Y 24 <= 1 Y ij binary

46 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-46 Defining the Constraints u Company 3 Side Constraints X 31 + X 32 + X 33 + X 34 = 200Y 31 + 400Y 32 + 550Y 33 Y 31 + Y 32 + Y 33 <= 1

47 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-47 Implementing the Side Constraints See file Fig6-25.xls

48 Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-48 End of Chapter 6


Download ppt "Spreadsheet Modeling and Decision Analysis, 3e, by Cliff Ragsdale. © 2001 South-Western/Thomson Learning. 6-1 Integer Linear Programming Chapter 6."

Similar presentations


Ads by Google