38
Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

Embed Size (px)

Citation preview

Page 1: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

Integer ProgrammingChapter 11: Hillier and LiebermanDr. Hurley’s AGB 328 Course

Page 2: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

Terms to KnowInteger Programming, Mixed Integer Programming, Binary Variable, Binary Integer Programming, Mutually Exclusive Alternatives, Contingent Decisions, Tours-of-duty Planning Problem, Rostering Problem, Auxiliary Binary Variable, Binary Representation

Page 3: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

Terms to Know Cont.Set Covering Problems, Set Partitioning Problems, Exponential Growth, LP Relaxation, Branching Tree, Branching Variable, Relaxation, Incumbent, Fathom, Descendants, Lagrangian Relaxation, Cutting Plane, Cut, Minimum Cover, Global Constraints

Page 4: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

4

Applications of Binary VariablesBinary variables only allow two

choices◦ This makes them suited for problems that

are characterized by variables that can take on only two possibilities.

Examples:◦ Do a project or not do a project?◦ To hire or not to hire?◦ To build or not to build?◦ To Sell or not to sell?

Page 5: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

5

Case Study: California Manufacturing Company (CMC)The California Manufacturing

Company is a company with factories and warehouses throughout California.

It is currently considering whether to build a new factory in Los Angeles and/or San Francisco.

Management is also considering building one new warehouse where a new factory has been recently built.

Should the CMC build factories and/or warehouses in Los Angeles and/or San Francisco?

Page 6: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

6

Case Study: CMC Cont.

Binary DecisionDecisionVariable

NPV(Millions)

CapitalNeeded

(Millions)

Build a factory in Los Angeles FLA $9 $6

Build a factory in San Francisco

FSF 5 3

Build a warehouse in Los Angeles

WLA 6 5

Build a warehouse in San Francisco

WSF 4 2

Building Money Available: $10 million

Page 7: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

7

Case Study: CMC Cont.FLA, FSF, WLA,WSF are all binary

variables which take on the value of 1 if the specific item is done and zero if it is not done.

We also need to make sure that at most one warehouse is built and it is built where a factory is built.

Page 8: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

8

Mathematical Model for CMC

}1,0{,,,

1

0

0

10*2*5*3*6

:Subject to

*4*6*5*9,,,

WSFWLAFSFFLA

WSFWLA

WSFWSF

FLAWLA

WSFWLAFSFFLA

WSFWLAFSFFLAMaxWSFWLAFSFFLA

Page 9: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

Innovative Uses for Binary VariablesEither-Or ConstraintA Subset of Constraints Must

HoldA Constraint that Needs a Single

Value Out of Multiple PossibilitiesA Fixed Cost Is Only Associated

with a Positive Usage of a Variable

Binary Representation of General Integer Variables

Page 10: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

Either-Or ConstraintSuppose you have a situation

where you have two potential constraints, but only one of them can hold◦To handle this issue, you can add to

one constraint My1 to the RHS and to the other constraint M(1-y1) to the RHS where y1 is a binary variable

◦For example: 5x1+9x2 ≤ 24 + My1

8x1+6x2 ≤ 35 + M(1-y1)

Page 11: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

A Subset of Constraints Must HoldSuppose you have N constraints

where only K of the constraints hold (K<N)◦You would add to constraint i the

amount Myi and one other constraint where

◦For example: 5x1 + 12x2 ≤ 34 + My1

6x1 + 11x2 ≤ 43 + My2

7x1 + 10x2 ≤ 57 + My3

y1+ y2 + y3 = 1

Page 12: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

A Constraint that Needs a Single Value Out of Multiple PossibilitiesSuppose you have a constraint

where the function can take on one out of many values◦To handle this issue, you would multiply

value i by a binary variable yi and sum them all together while adding one more constraint that

◦For example:◦5x1 +31x2 = 25 or 50 or 75

5x1 +31x2 = 25y1+ 50y2+ 75y3

y1+ y2 + y3 = 1

Page 13: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

A Fixed Cost Is Only Associated with a Positive Usage of a VariableSuppose you have the situation

where your objective function only takes on a fixed cost ki if you use a corresponding variable xi > 0, if xi = 0 then ki = 0◦To handle this issue you would add to

the objective function kiyi and a new constraint xi ≤ Myi

◦For example, suppose that variable x1 has an associated set-up cost if you decide to use it

Page 14: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

Subject to:+ 3523+42

Page 15: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

Binary Representation of General Integer VariablesThere are some times when you

may want to represent a variable that is supposed to be an integer by transforming it into a binary representation◦This can be done by defining the

variable x =

Page 16: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

Goods Product Company ExampleObjective: Maximize ProfitsDecision Variables: Product 1,

Product 2, and Product 3Constraints:

◦Production time available for Plants 1 and 2

◦At most two out of the three products can be produced

◦Only one of the two plants can produce the new products

Page 17: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

Data for Goods Product Company Product 1 uses 3 hours of Plant 1 or 4

hours of Plant 2 per unit of production◦You can sell up to 7 at a profit of $5,000

Product 2 uses 4 hours of Plant 1 or 6 hours of Plant 2 per unit of production◦You can sell up to 5 at a profit of $7,000

Product 3 uses 2 hours of Plant 1 or 2 hours of Plant 2 per unit of production◦You can sell up to 9 at a profit of $3,000

Plant 1 has 30 hours available while Plant 2 has 40 hours

Page 18: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

Mathematical Model for Goods Product Company

Subject to:

We will examine the spreadsheet model in class

Page 19: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

Supersuds Corporation ExampleObjective: Maximize ProfitsDecision Variables: Number of TV

spots for Product 1, Product 2, and Product 3

Constraints: ◦Number of TV spots allocated to the

three products cannot be more than five

Major Issue: Proportionality Assumption is violated

Page 20: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

Data for SupersudsIf any of the products does not buy a

TV spot, it will not get any profitIf Product 1 buys 1, 2 , or 3 TV spot(s),

its profitability would be 1, 3, or 3 respectively

If Product 2 buys 1, 2 , or 3 TV spot(s), its profitability would be 0, 2, or 3 respectively

If Product 3 buys 1, 2 , or 3 TV spot(s), its profitability would be -1, 2, or 4 respectively

Page 21: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

Mathematical Model 1 for Supersuds

Subject to:

We will examine the spreadsheet model in class

Page 22: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

Mathematical Model 2 for Supersuds

Subject to:

We will examine the spreadsheet model in class

Page 23: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

23

Wyndor Case RevisitedTwo new products have been

developed:◦ An 8-foot glass door◦ A 4x6 foot glass window

Wyndor has three production plants◦ Production of the door utilizes Plants 1 and

3◦ Production of the window utilizes Plants 2

and 3Objective is to find the optimal mix of

these two new products.

Page 24: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

24

Wyndor Case Revisited Cont.

Production Time Used for Each Unit Produced

Plant Doors Windows Available Per Week

1 1 hour 0 hour 4 hour

2 0 hour 2 hour 12 hour

3 3 hour 2 hour 18 hour

Unit Profit $300 $500

Page 25: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

25

Wyndor Case Revisited Cont.

5) and 4 ts(Constrain 0 W0,D

3)t (Constrain 182W3D

2)t (Constrain212W

1)t (Constrain 4D

:Subject to

500300 Max WD, w.r.t.

WD

Page 26: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

26

Changing Wyndor to Account for Setup Costs Suppose that two changes are

made to the original Wyndor problem:

◦ If Wyndor chooses to produce doors, it must pay a one time set-up cost of $700, while if Wyndor produces windows it must pay a set-up cost of $1,300.

◦ We want to restrict the doors and windows to be integer values.

Page 27: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

27

Wyndor’s Mathematical Model With Set-Up Costs

{0,1} WSDS,

integers are nd 0, WD,

WS*99W

DS*99D

182W3D

212W

4D

:Subject to

1300700500300 Max WSDS, W,D, w.r.t.

a

WSDSWD

Page 28: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

28

Changing Wyndor to Account for Mutually Exclusive Products

Suppose Wyndor decides that it only wants to produce doors or windows rather than both.◦ This implies that either doors have to

be zero or windows have to be zero.

Page 29: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

29

Wyndor’s Mathematical Model With Mutually Exclusive Products

{0,1} WSDS,

integers are nd 0, WD,

1WSDS

WS*99W

DS*99D

182W3D

212W

4D

:Subject to

1300700500300 Max WSDS, W,D, w.r.t.

a

WSDSWD

Page 30: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

30

Changing Wyndor to Account for Either-Or Constraints

Suppose the company is trying to decide whether to build a new up-to-date plant that will be used to replace plant 3.◦ This implies that Wyndor wants to

examine the profitably of using plant 4 versus plant 3.

Page 31: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

31

Wyndor’s Data with Either/Or Constraint

Production Time Used for Each Unit Produced

Plant Doors Windows Available Per Week

1 1 hour 0 hour 4 hour

2 0 hour 2 hour 12 hour

3 3 hour 2 hour 18 hour

4 2 hours 4 hours 28 hours

Unit Profit $300 $500

Page 32: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

32

Wyndor’s Mathematical Model With Either/Or Constraint

{0,1}P4 P3,

integers are nd 0, WD,

14P3P

P3*99284W2D

P4*99182W3D

212W

4D

:Subject to

500300 MaxP4 P3, W,D, w.r.t.

a

WD

Page 33: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

33

The Challenges of RoundingIt may be tempting to round a

solution from a non-integer problem, rather than modeling for the integer value.

There are three main issues that can arise:◦Rounded Solution may not be

feasible.◦Rounded solution may not be close

to optimal.◦There can be many rounded

solutions

Page 34: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

Algorithms For Solving BIPs and MIPsBranch-and-Bound AlgorithmBranch-and-Cut Algorithm

Page 35: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

Branch-and-Bound AlgorithmThis algorithm has three main

steps in an iteration:◦Branching

This is where you create two new sub-problems

◦Bounding For each sub-problem, apply the simplex

method to the LP relaxation

◦Fathoming This where you are deciding whether to

dismiss the sub-problem from further consideration

Page 36: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

Fathoming TestTest 1: Its bound is less than Z*,

where Z* represents the value you get from the objective function for the current best incumbent solution

Test 2: The LP relaxation problem has no solution

Test 3: The optimal solution for the LP relaxation problem is binary/integer

Page 37: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

Branch-and-Cut AlgorithmsThese algorithms primarily rely upon:

◦Problem preprocessing Fixing variables that you know upfront must

be a particular variable Eliminating redundant constraints Tightening constraints in a way to reduce the

feasible region

◦Generating cutting planes This reduces the feasible region for the LP

relaxation which does not reduce the feasible solutions

◦Clever branch-and-bound techniques

Page 38: Integer Programming Chapter 11: Hillier and Lieberman Dr. Hurley’s AGB 328 Course

In-Class Activity (Not Graded)Create a spreadsheet model for

each of the Wyndor problems previously discussed