54
1 Integer Programming Introduction to Integer Programming (IP) Difficulties of LP relaxation IP Formulations Branch and Bound Algorithms

Integer Programming

Embed Size (px)

DESCRIPTION

Integer Programming. Introduction to Integer Programming (IP) Difficulties of LP relaxation IP Formulations Branch and Bound Algorithms. Integer Programming Model. - PowerPoint PPT Presentation

Citation preview

Page 1: Integer Programming

1

Integer Programming

Introduction to Integer Programming (IP)

Difficulties of LP relaxation

IP Formulations

Branch and Bound Algorithms

Page 2: Integer Programming

2

Integer Programming Model

An Integer Programming model is a linear programming problem where some or all of the variables are required to be non-negative integers.

These models are in general substantially harder than solving linear programming models.

Network models are special cases of integer programming models and are very efficiently solvable.

We will discuss several applications of integer programming models.

We will study the branch and bound technique, one of the most popular algorithm to solve integer programming models.

Page 3: Integer Programming

3

Classifications of IP Models

Pure IP Model: Where all variables must take integer values.

Maximize z = 3x1 + 2x2

subject to x1 + x2 6 x1, x2 0, x1 and x2 integer

Mixed IP Model: Where some variables must be integer while others can take real values.

Maximize z = 3x1 + 2x2

subject to x1 + x2 6x1, x2 0, x1 integer

0-1 IP Model: Where all variables must take values 0 or 1 .

Maximize z = x1 - x2

subject to x1 + 2x2 2 2x1 - x2 1, x1, x2 = 0 or 1

Page 4: Integer Programming

4

Classifications of IP Models (contd.)

LP Relaxation: The LP obtained by omitting all integer or 0-1 constraints on variables is called the LP relaxation of IP.

IP:Maximize z = 21x1 + 11x2

subject to 7x1 + 4x2 13 x1, x2 0, x1 and x2 integer

LP Relaxation:Maximize z = 21x1 + 11x2

subject to 7x1 + 4x2 13 x1, x2 0

Result:Optimal objective function value of IP

Optimal objective function value of LP relaxation

Page 5: Integer Programming

5

IP and LP Relaxation

x x xx

xx

xx

x1

x2

1 2 3

1

3

2

7x1 + 4x2= 13

Page 6: Integer Programming

6

Simple Approaches for Solving IP

Approach 1:

Enumerate all possible solutionsDetermine their objective function valuesSelect the solution with the maximum (or, minimum) value.

Any potential difficulty with this approach?-- may be time-consuming

Approach 2:

Solve the LP relaxationRound-off the solution to the nearest feasible integer

solution

Any potential difficulty with this approach?-- may not be optimal solution to the original IP

Page 7: Integer Programming

7

X 10 If a new health care plan is adopted If it is not

X 1 If a new police station is built downtown0 If it is not

X 1 If a particular constraint must hold0 If it is not

Any decision situation that can be modeled by “yes”/“no”, “good”/“bad” etc., falls into the binary category.

To illustrate

The use of binary variables in constraints

Page 8: Integer Programming

8

Example A decision is to be made whether each of three plants should be built (Yi = 1)

or not built (Yi = 0)

Requirement Binary Representation

At least 2 plants must be built Y1 + Y2 +Y3 2

If plant 1 is built, plant 2 must not be built Y1 + Y2 1

If plant 1 is built, plant 2 must be built Y1 – Y2

One, but not both plants must be built Y1+ Y2 = 1

Both or neither plants must be built Y1 – Y2 =0

Plant construction cannot exceed $17 milliongiven the costs to build plants are $5, $8, $10 million 5Y1+8Y2+10Y3 17

The use of binary variables in constraints

Page 9: Integer Programming

9

Capital Budgeting Problem

Stockco Co. is considering four investments

It has $14,000 available for investment

Formulate an IP model to maximize the NPV obtained from the investments

IP:

Maximize z = 16x1 + 22x2 + 12x3 + 8x4

subject to

5x1 + 7x2 + 4x3 + 3x4 14x1, x2,,x3, x4 0, 1

Investmentchoice

1 2 3 4

Cashoutflow

$5000 $7000 $4000 $3000

NPV $16000 $22000 $12000 $8000

Page 10: Integer Programming

10

Fixed Charge Problem

Gandhi cloth company manufactures three types of clothing: shirts, shorts, and pants

Machinery must be rented on a weekly basis to make each type of clothing. Rental Cost:

$200 per week for shirt machinery $150 per week for shorts machinery $100 per week for pants machinery

There are 150 hours of labor available per week and 160 square yards of cloth

Find a solution to maximize the weekly profit

Labor hr Cloth yd Price Shirts 3 4 $6 Shorts 2 3 $4 Pants 6 4 $8

Page 11: Integer Programming

11

Fixed Charge Problem (contd.)

Decision Variables:

x1 = number of shirts produced each weekx2 = number of shorts produced each week x3 = number of pants produced each week

y1 = 1 if shirts are produced and 0 otherwisey2 = 1 if shorts are produced and 0 otherwisey3 = 1 if pants are produced and 0 otherwise

Formulation:

Max. z = 6x1 + 4x2 + 8x3 - 200y1 - 150 y2 - 100y3

subject to3x1 + 2x2 + 6x3 150

4x1 + 3x2 + 4x3 160

x1 M y1, x2 M y2, x3 M y3

x1, x2,,x3 0, and integer; y1, y2,,y3 0 or 1

Page 12: Integer Programming

12

Either-Or Constraints

Dorian Auto is considering manufacturing three types of auto: compact, midsize, large.

Resources required and profits obtained from these cars are given below.

We have 6,000 tons of steel and 60,000 hours of labor available.

If any car is produced, we must produce at least 1,000 units of that car.

Find a production plan to maximize the profit.

Compact Midsize Large

Steel Req. 1.5 tons 3 tons 5 tons

Labor Req. 30 hours 25 hours 40 hours

Profit $2000 $3000 $4000

Page 13: Integer Programming

13

Either-Or Constraints (contd.)

Decision Variables:

x1, x2, x3 = number of compact, midsize and large cars producedy1, y2, y3 = 1 if compact , midsize and large cars are produced or

not

Formulation:

Maximize z = 2x1 + 3x2 + 4x3

subject tox1 My1; x2 My2; x3 My3

1000 - x1 M(1-y1)1000 - x2 M(1-y2)

1000 - x3 M(1-y3)1.5 x1 + 3x2 + 5x3 600030 x1 + 25x2 + 40 x3 60000

x1, x2, x3 0 and integer; y1, y2, y3 = 0 or 1

Page 14: Integer Programming

14

Set Covering Problems

Western Airlines has decided to have hubs in USA.

Western runs flights between the following cities: Atlanta, Boston, Chicago, Denver, Houston, Los Angeles, New Orleans, New York, Pittsburgh, Salt Lake City, San Francisco, and Seattle.

Western needs to have a hub within 1000 miles of each of these cities.

Determine the minimum number of hubs

Cities within 1000 milesAtlanta (AT) AT, CH, HO, NO, NY, PIBoston (BO) BO, NY, PIChicago (CH) AT, CH, NY, NO, PIDenver (DE) DE, SLHouston (HO) AT, HO, NOLos Angeles (LA) LA, SL, SFNew Orleans (NO) AT, CH, HO, NONew York (NY) AT, BO, CH, NY, PIPittsburgh (PI) AT, BO, CH, NY, PISalt Lake City (SL) DE, LA, SL, SF, SESan Francisco (SF) LA, SL, SF, SESeattle (SE) SL, SF, SE

Page 15: Integer Programming

15

Formulation of Set Covering Problems

Decision Variables:

xi = 1 if a hub is located in city ixi = 0 if a hub is not located in city i

Minimize xAT + xBO + xCH + xDE + xHO + xLA + xNO + xNY + xPI + xSL + xSF + xSE

subject to

AT BO CH DE HO LA NO NY PI SL SF SE Required

AT 1 0 1 0 1 0 1 1 1 0 0 0 xAT >= 1BO 0 1 0 0 0 0 0 1 1 0 0 0 xBO >= 1CH 1 0 1 0 0 0 1 1 1 0 0 0 xCH >= 1DE 0 0 0 1 0 0 0 0 0 1 0 0 xDE >= 1HO 1 0 0 0 1 0 1 0 0 0 0 0 xHO >= 1LA 0 0 0 0 0 1 0 0 0 1 1 0 xLA >= 1NO 1 0 1 0 1 0 1 0 0 0 0 0 xNO >= 1NY 1 1 1 0 0 0 0 1 1 0 0 0 xNY >= 1PI 1 1 1 0 0 0 0 1 1 0 0 0 xPI >= 1SL 0 0 0 1 0 1 0 0 0 1 1 1 xSL >= 1SF 0 0 0 0 0 1 0 0 0 1 1 1 xSF >= 1SE 0 0 0 0 0 0 0 0 0 1 1 1 xSE >= 1

Page 16: Integer Programming

16

Additional Applications

Location of fire stations needed to cover all cities

Location of fire stations to cover all regions

Truck dispatching problem

Political redistricting

Capital investments

Page 17: Integer Programming

17

Branch and Bound Algorithm

Branch and bound algorithms are the most popular methods for solving integer programming problems

They enumerate the entire solution space but only implicitly; hence they are called implicit enumeration algorithms.

A general-purpose solution technique which must be specialized for individual IP's.

Running time grows exponentially with the problem size, but small to moderate size problems can be solved in reasonable time.

Page 18: Integer Programming

18

Example:

s.t.

Page 19: Integer Programming

19

Solved as LP by Simplex method

Page 20: Integer Programming

20

An Example

Telfa Corporation makes tables and chairs

A table requires one hour of labor and 9 square board feet of wood

A chair requires one hour of labor and 5 square board feet of wood

Each table contributes $8 to profit, and each chair contributes $5 to profit.

6 hours of labor and 45 square board feet is available

Find a product mix to maximize the profit

Maximize z = 8x1 + 5x2

subject to x1 + x2 6; 9x1 + 5x2 45; x1, x2 0; x1, x2 integer

Page 21: Integer Programming

21

Feasible Region for Telfa’s Problem

Subproblem 1 : The LP relaxation of original

Optimal LP Solution: x1 = 3.75 and x2 = 2.25 and z = 41.25

Subproblem 2: Subproblem 1 + Constraint x1 4

Subproblem 3: Subproblem 1 + Constraint x1 3

Page 22: Integer Programming

22

Feasible Region for Subproblems

Branching : The process of decomposing a subproblem into two or more subproblems is called branching.

Optimal solution of Subproblem 2:

z = 41, x1 = 4, x2 = 9/5 = 1.8

Subproblem 4: Subproblem 2 + Constraint x2 2

Subproblem 5: Subproblem 2 + Constraint x2 1

Page 23: Integer Programming

23

Feasible Region for Subproblems 4 & 5

Page 24: Integer Programming

24

The Branch and Bound Tree

Subproblem 1z = 41.25x1 = 3.75x2 = 2.25

Optimal solution of Subproblem 5:

z = 40.05, x1 = 4.44, x2 = 1

Subproblem 6: Subproblem 5 + Constraint x1 5

Subproblem 7: Subproblem 5 + Constraint x1 4

3

Subproblem 2z = 41x1 = 4

x2 = 1.8

Subproblem 3

Subproblem 4Infeasible

Subproblem 5

x1 4 x1 3

x2 2 x2 1

1

2

4

Page 25: Integer Programming

25

Feasible Region for Subproblems 6 & 7

Optimal solution of Subproblem 7:

z = 37, x1 = 4, x2 = 1

Optimal solution of Subproblem 6:

z = 40, x1 = 5, x2 = 0

Page 26: Integer Programming

26

The Branch and Bound Tree

Subproblem 1z = 41.25x1 = 3.75x2 = 2.25

Subproblem 2z = 41x1 = 4

x2 = 1.8

Subproblem 3z = 39x1 = 3

x2 = 3,

Subproblem 4Infeasible

Subproblem 5z = 40.55x1 = 4.44

x2 = 1

x1 4 x1 3

x2 2 x2 1

Subproblem 6z = 40x1 = 5

x2 = 0,

Subproblem 7z = 37x1 = 4x2 = 1

1

2

3 4

7

6 5

Page 27: Integer Programming

27

Solving Knapsack Problems

Max z = 16x1+ 22x2 + 12x3 + 8x4

subject to

5x1+ 7x2 + 4x3 + 3x4 14xi = 0 or 1 for all i = 1, 2, 3, 4

LP Relaxation:

Max z = 16x1+ 22x2 + 12x3 + 8x4

subject to

5x1+ 7x2 + 4x3 + 3x4 14 0 xi 1 for all i = 1, 2, 3, 4

Solving the LP Relaxation: Order xi’s in the decreasing order of ci/ai where ci are the cost

coefficients and ai’s are the coefficients in the constraint ( Here: x1→x2 → x3 → x4) Select items in this order until the constraint is satisfied with

equality

Page 28: Integer Programming

28

The Branch and Bound Tree

x3 = 0 x3 = 1

x2 = 0 x4 = 1

Subproblem 1z = 44

x1 = x2 = 1x3 =.5

1

7 2

8 9

Subproblem 5z = 43.6

x1 =.6, x2=x3=1 x4 = 0, LB = 36

Subproblem 4z = 36

x1 = x3=1x2 = 0, x4 =1

Subproblem 3z = 43.7

x1 =x3= 1, x2 = .7, x4=0

Subproblem 6z = 42

x1 =0, x2=x3=1 x4 = 1, LB = 42

5

Subproblem 7LB = 42

Infeasible 6

x2 = 1

x1 = 0 x1 = 1

Subproblem 2z = 43.3, LB=42

x1 = x2=1x3 = 0, x4 =.67

Subproblem 8z = 38, LB=42

x1 = x2=1x3 = x4 = 0

Subproblem 9 z= 42.85, LB=42

x1 = x4 =1x3 = 0, x2 = .85

x4 = 0

3 4

Page 29: Integer Programming

29

Strategies of Branch and Bound

The branch and bound algorithm is a divide and conquer algorithm, where a problem is divided into smaller and smaller subproblems. Each subproblem is solved separately, and the best solution is taken.

Lower Bound (LB): Objective function value of the best solution found so far.

Branching Strategy : The process of decomposing a subproblem into two or more subproblems is called branching.

Page 30: Integer Programming

30

Strategies of Branch and Bound (contd.)

Upper Bounding Strategy: The process of obtaining an upper bound (UB) for each subproblem is called an upper bounding strategy.

Pruning Strategy: If for a subproblem, UB LB, then the subproblem need not be explored further.(Illustrate how to fathom nodes in a search tree )

Searching Strategy: The order in which subproblems are examined. Popular search strategies: LIFO and FIFO.

Page 31: Integer Programming

31

11.6 分枝界限法及其在二位元整數規劃的應用

Page 32: Integer Programming

32

分枝界限法的步驟

分枝 界限 洞悉

Page 33: Integer Programming

33

分枝

Page 34: Integer Programming

34

界限

Page 35: Integer Programming

35

洞悉

Page 36: Integer Programming

36

洞悉測試摘要

Page 37: Integer Programming

37

BIP 分枝界限演算法摘要

Page 38: Integer Programming

38

Page 39: Integer Programming

39

完成例題解題過程

Page 40: Integer Programming

40

Page 41: Integer Programming

41

Page 42: Integer Programming

42

應用分枝界限法的其他選擇

Page 43: Integer Programming

43

11.7 混合整數規劃之分枝界限演算法

Page 44: Integer Programming

44

MIP分枝界限演算法摘要

Page 45: Integer Programming

45

Page 46: Integer Programming

46

Page 47: Integer Programming

47

Page 48: Integer Programming

48

Page 49: Integer Programming

49

Page 50: Integer Programming

50

Page 51: Integer Programming

51

Page 52: Integer Programming

52

Page 53: Integer Programming

53

Page 54: Integer Programming

54