Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Mathematical Programming OR/MA 504 Chapter 5 Integer Linear Programming.

Similar presentations


Presentation on theme: "Introduction to Mathematical Programming OR/MA 504 Chapter 5 Integer Linear Programming."— Presentation transcript:

1 Introduction to Mathematical Programming OR/MA 504 Chapter 5 Integer Linear Programming

2 6-2 Introduction When one or more variables in an LP problem must assume an integer value we have an Integer Linear Programming (ILP) problem. ILPs occur frequently… –Scheduling workers –Manufacturing airplanes Integer variables also allow us to build more accurate models for a number of common business problems.

3 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 6-4 Relaxation 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 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 6-5 Integer Feasible vs. LP Feasible Region X1X1 X2X2 Integer Feasible Solutions 0 0 123 4 1 2 3

6 6-6 Solving ILP Problems When solving an LP relaxation, sometimes you “get lucky” and obtain an integer feasible solution. This was the case in the original Blue Ridge Hot Tubs problem in earlier chapters. But what if we reduce the amount of labor available to 1520 hours and the amount of tubing to 2650 feet? See file Fig5-1.xlsFig5-1.xls

7 6-7 Bounds 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 6-8 Rounding It is tempting to simply round a fractional solution to the closest integer solution. In general, this does not work reliably: –The rounded solution may be infeasible. –The rounded solution may be suboptimal.

9 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 6-10 Branch-and-Bound The Branch-and-Bound (B&B) algorithm can be used to solve ILP problems. Requires the solution of a series of LP problems termed “candidate problems”. Theoretically, this can solve any ILP. Practically, it often takes LOTS of computational effort (and time).

11 6-11 Stopping Rules Because B&B can take so long, most ILP packages allow you to specify a suboptimality tolerance factor. This allows you to stop once an integer solution is found that is within some % of the global optimal solution. Bounds obtained from LP relaxations are helpful here. –Example LP relaxation has an optimal obj. value of $64,306. 95% of $64,306 is $61,090. Thus, an integer solution with obj. value of $61,090 or better must be within 5% of the optimal solution.

12 6-12 Using Solver Let’s see how to specify integrality conditions and suboptimality tolerances using Solver… See file Fig5-2.xlsFig5-2.xls

13 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 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 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 6-16 Defining the Constraints 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 } Wednesday 1X 1 + 1X 2 + 1X 3 + 0X 4 + 0X 5 + 1X 6 + 1X 7 >= 25 } Thursday 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 Nonnegativity & integrality conditions X i >= 0 and integer for all i

17 6-17 Implementing the Model See file Fig5-3.xlsFig5-3.xls

18 6-18 Binary Variables Binary variables are integer variables that can assume only two values: 0 or 1. These variables can be useful in a number of practical modeling situations….

19 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 The company 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. Unused funds in any year cannot be carried over.

20 6-20 Defining the Decision Variables

21 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 6-22 Defining the Constraints 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 6-23 Implementing the Model See file Fig5-4.xlsFig5-4.xls

24 6-24 Binary Variables & Logical Conditions 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 X 4 – X 5 <= 0

25 6-25 The Fixed-Charge Problem Many decisions result in a fixed or lump-sum cost being incurred: – The cost to lease, rent, or purchase a piece of equipment or a vehicle that will be required if a particular action is taken. – The setup cost required to prepare a machine or to produce a different type of product. – The cost to construct a new production line that will be required if a particular decision is made. – The cost of hiring additional personnel that will be required if a particular decision is made.

26 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 6-27 Defining the Decision Variables X i = the amount of product i to be produced, i = 1, 2, 3

28 6-28 Defining the Objective Function Maximize total profit. MAX: 48X 1 + 55X 2 + 50X 3 – 1000Y 1 – 800Y 2 – 900Y 3

29 6-29 Defining the Constraints 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 Binary Constraints All Y i must be binary Nonnegativity conditions X i >= 0, i = 1, 2,..., 6 Is there a missing link?

30 6-30 Defining the Constraints (cont’d) 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 6-31 Finding Reasonable Values for M 1 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 6-32 MAX:48X 1 + 55X 2 + 50X 3 - 1000Y 1 - 800Y 2 - 900Y 3 S.T.: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 <= 0linking constraints X 3 - 75Y 3 <= 0 All Y i must be binary X i >= 0, i = 1, 2, 3 Summary of the Model

33 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 6-34 Implementing the Model See file Fig5-5.xlsFig5-5.xls

35 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 6-36 Quantity Discounts Assume… – 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 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 6-38 A Contract Award Problem 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 6-39 A Contract Award Problem 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 6-40 Defining the Decision Variables X ij = tons of cement purchased from company i for project j

41 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 6-42 Defining the Constraints 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 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 6-43 Implementing the Transportation Constraints See file Fig5-6.xlsFig5-6.xls

44 6-44 Defining the Constraints-I 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 6-45 Defining the Constraints-II 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 6-46 Defining the Constraints-III 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 6-47 Implementing the Side Constraints See file Fig5-7.xlsFig5-7.xls

48 6-48 The Branch-And-Bound Algorithm 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 and integer

49 6-49 Solution to LP Relaxation 0 1 2 3 0 12 34 X1X1 X2X2 Feasible Integer Solutions Optimal Relaxed Solution X 1 = 2.769, X 2 =1.826 Obj = 11.019

50 6-50 The Branch-And-Bound Algorithm MAX:2X 1 + 3X 2 S.T. X 1 + 3X 2 <= 8.25 2.5X 1 + X 2 <= 8.75 X 1 <= 2 X 1, X 2 >= 0 and integer Problem I MAX:2X 1 + 3X 2 S.T. X 1 + 3X 2 <= 8.25 2.5X 1 + X 2 <= 8.75 X 1 >= 3 X 1, X 2 >= 0 and integer Problem II

51 6-51 Solution to LP Relaxation 0 1 2 3 0 12 34 X1X1 X2X2 Problem I Problem II X 1 =2, X 2 =2.083, Obj = 10.25

52 6-52 The Branch-And-Bound Algorithm MAX: 2X 1 + 3X 2 S.T. X 1 + 3X 2 <= 8.25 2.5X 1 + X 2 <= 8.75 X 1 <= 2 X 2 <= 2 X 1, X 2 >= 0 and integer Problem III MAX: 2X 1 + 3X 2 S.T. X 1 + 3X 2 <= 8.25 2.5X 1 + X 2 <= 8.75 X 1 <= 2 X 2 >= 3 X 1, X 2 >= 0 and integer Problem IV

53 6-53 Solution to LP Relaxation 0 1 2 3 0 12 34 X1X1 X2X2 Problem III Problem II X 1 =2, X 2 =2, Obj = 10 X 1 =3, X 2 =1.25, Obj = 9.75

54 6-54 B&B Summary X 1 =2.769 X 2 =1.826 Obj = 11.019 X 1 =2 X 2 =2.083 Obj = 10.25 X 1 =2 X 2 =2 Obj = 10 infeasible X 1 =3 X 2 =1.25 Obj = 9.75 Original Problem Problem II Problem I Problem IIIProblem IV X 1 >=3 X 1 <=2 X 2 >=3X 2 <=2

55 6-55 End of Chapter 5


Download ppt "Introduction to Mathematical Programming OR/MA 504 Chapter 5 Integer Linear Programming."

Similar presentations


Ads by Google