mixed integer programming - zuse institute...

46
Mixed Integer Programming 1

Upload: others

Post on 12-May-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

Mixed Integer Programming

1

Page 2: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

A Linear Program\ P1 = units of Product 1 produced\ P2 = units of Product 2 produced \ P3 = units of Product 3 produced\ 500 = hours/week of milling machine time available\ 350 = hours/week of lathe time available\ 150 = hours/week of grinder time available

MaximizeProfit: 30 P1 + 12 P2 + 15 P3

Subject ToMilling_machine: 9 P1 + 3 P2 + 5 P3 <= 500Lathe: 5 P1 + 4 P2 <= 350Grinder: 3 P1 + 2 P3 <= 150Bound: P3 <= 20

End

Optimal Solution:Profit = $1742.85P1 = 26.1905 unitsP2 = 54.7619 unitsP3 = 20 units

Problem:    It doesn’t make sense to produce fractional units

Possible solution:  Round the answerP1 = 26, P2 = 54, P3 = 20Profit = $1728

2

Page 3: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

A Better Solution:  Integer Programming\Problem name: HW1_integer.lp

MaximizeProfit: 30 P1 + 12 P2 + 15 P3

Subject ToMilling_machine: 9 P1 + 3 P2 + 5 P3 <= 500Lathe: 5 P1 + 4 P2 <= 350Grinder: 3 P1 + 2 P3 <= 150

Bounds0 <= P3 <= 20

GeneralsP1 P2 P3

End

Rounded Solution:Profit = $1728P1 = 26 unitsP2 = 54 unitsP3 = 20 units

Optimal Solution:Profit = $1740P1 = 26 unitsP2 = 55 unitsP3 = 20 units

3

Page 4: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

4

Mixed Integer Programming (MIP)

Minimize   

cTx

Subject to 

Ax = b

l

uSome xj

are integer

Integrality Restriction

Page 5: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

5

Application of LP & MIP ‐

I

• Transportation‐airlines– Fleet assignment

– Crew scheduling

– Ground personnel scheduling

– Yield management 

– Fuel allocation

– Passenger mix

– Booking control

– Maintenance scheduling

– Load balancing/freight packing

– Airport traffic planning

– Gate scheduling/assignment

– Upset recover and management

• Transportation‐other– Vehicle routing

– Freight vehicle scheduling and 

assignment

– Depot/warehouse location

– Freight vehicle packing

– Public transportation system 

operation

– Rental car fleet management

• Process industries– Plant production scheduling and 

logistics

– Capacity expansion planning

– Pipeline transportation planning

– Gasoline and chemical blending

Page 6: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

6

Application of LP & MIP ‐

II

• Financial– Portfolio selection and optimization– Cash management– Synthetic option development– Lease analysis– Capital budgeting and rationing– Bank financial planning– Accounting allocations– Securities industry surveillance– Audit staff planning– Assets/liabilities management– Unit costing– Financial valuation– Bank shift scheduling– Consumer credit delinquency 

management

– Check clearing systems– Municipal bond bidding– Stock exchange operations– Debt financing

• Manufacturing– Product mix planning– Blending– Manufacturing scheduling – Inventory management– Job scheduling– Personnel scheduling– Maintenance scheduling and planning– Steel production scheduling

• Coal Industry– Coal sourcing/transportation logistics– Coal blending– Mining operations management

• Forestry– Forest land management– Forest valuation models– Planting and harvesting models

Page 7: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

7

Application of LP & MIP ‐

III

• Agriculture– Production planning– Farm land management– Agricultural pricing models– Crop and product mix decision models– Product distribution

• Public utilities and natural resources– Electric power distribution– Power generator scheduling– Power tariff rate determination– Natural gas distribution planning– Natural gas pipeline transportation– Water resource management– Alternative water supply evaluation– Water reservoir management– Public water transportation models– Mining excavation models

• Oil and gas exploration and production– Oil and gas production scheduling– Natural gas transportation scheduling

• Communications and computing– Circuit board (VLSI) layout– Logical circuit design– Magnetic field design– Complex computer graphics– Curve fitting– Virtual reality systems– Computer system capacity planning– Office automation– Multiprocessor scheduling– Telecommunications scheduling– Telephone operator scheduling– Telemarketing site selection

Page 8: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

8

Application of LP & MIP ‐

IV

• Food processing– Food blending

– Recipe optimization 

– Food transportation logistics

– Food manufacturing logistics and 

scheduling

• Health care– Hospital staff scheduling

– Hospital layout

– Health cost reimbursement

– Ambulance scheduling

– Radiation exposure models

• Pulp and paper industry– Inventory planning

– Trim loss minimization

– Waste water recycling

– Transportation planning

• Textile industry– Pattern layout and cutting optimization 

– Production scheduling

• Government and military– Post office scheduling and planning

– Military logistics

– Target assignment

– Missile detection

– Manpower deployment

• Miscellaneous applications– Advertising mix/media scheduling

– Pollution control models

– Sales region definition

– Sales force deployment

Page 9: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

9

CPLEX Across the World

1194 Cities –

Excluding ISV Deployments

Page 10: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

10

How Can We Solve a MIP?

Page 11: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

objective

Linear Program

LP optimum

feasible solutions

y

x

11

Page 12: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

objective

MIP optimum

Integer Program

rounding down optimum of LP relaxation

feasible solutions = 

y

x

optimum ofLP relaxation

12

Page 13: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

objectiveMIP optimum

Integer Program

feasible solutions = 

y

x

(x1

,y1

)

optimum ofLP relaxation

13

Page 14: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

objective

Integer Program: Branch and Bound

feasible solutions = 

Branch separation

y

x

y  y1

y y1

(x1

,y1

)

IP optimumoptimum ofLP relaxation

14

Page 15: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

objective

IP optimum

Integer Program: Cutting Planes

cutting planes

feasible solutions = 

y

x

optimum ofLP relaxation

15

Page 16: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

Solving MIPs: Branch and Bound

Consider the following integer program:Maximize    x

y + 2z

Subject to  7x

+ 2y

+ 3z 

36

5x

+ 4y

+ 7z

42

2x

+ 3y

+ 5z

28

x, y, z

0, integer

(IP0 )

16

Page 17: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

IP011511obj

1115

01131

zyx

IP2 IP1

1x 2x

10obj

402

Best IP value

Best IP solution

4.11obj

2.501

402

10/

Integral

IP4 IP3

5z 6z

Infeasible

3111obj

5311

11obj

501

0y 1y

IP6 IP5

/ 11

501

Integral

2.11obj

6.411

IP8 IP7

4z 55 zz

9obj

421

Obj.

incumbent

11obj

510

Obj.

incumbent

Branch & Bound:  Example

Maximize    x

y + 2z

Subject to  7x

+ 2y

+ 3z 

36

5x

+ 4y

+ 7z

42

2x

+ 3y

+ 5z

28

x, y, z

0, integer

17

Page 18: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

Read MPS format model from file unitcal_1.lpOptimize a model with 7035 Rows, 3723 Columns and 18155 NonZeroesPresolved: 5111 Rows, 2717 Columns, 14193 NonzerosRoot relaxation: 2287 iterations, 0.11 seconds

Nodes | Current Node | Objective Bounds | WorkExpl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time

0 0 2653304.4 0 83 - 2653304.4 - - 0sH 0 0 2690605.2 2653304.4 1.39% - 0sH 0 0 2687988.7 2676216.2 0.44% - 0s

0 0 2676687.8 0 71 2687988.7 2676687.8 0.42% - 0sH 0 0 2686373.6 2676982.3 0.35% - 0s

0 0 2678857.7 0 54 2686373.6 2678857.7 0.28% - 1sH 0 0 2685687.5 2678881.2 0.25% - 1s

0 0 2678901.7 0 65 2685687.5 2678901.7 0.25% - 1sH 60 35 2684072.4 2679836.3 0.16% 30.8 1s* 93 35 14 2683479.8 2680016.5 0.13% 23.6 1s

Cutting planes:Gomory: 5Implied bound: 167MIR: 1Flow cover: 71

Explored 568 nodes (14223 simplex iterations) in 2.07 seconds

Optimal solution found (tolerance 1.00e-04)Best objective 2.6834797511e+06, best bound 2.6834797511e+06, gap 0.0000%

Unit Commitment: Using Branch‐and‐Cut

Current UB

Current LBConstraints auto-added tostrengthen formulation

Total nodesprocessed

Applied ‘tricks’or heuristics

18

Page 19: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

19

The Basic Algorithm:  

Branch and Bound

Page 20: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

20

Key ingredients

Solution Strategy: Branch & Bound

• Split the solution space into disjoint subsets

• Bound the objective value for all solutions  in a subset

Page 21: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

21

Branch on integer variableBranching

• Choose a branching variable xj– Must be an integer variable

• Split the model into two sub‐models– xj

i or xj

i+1

• Binary variable special case:– xj

=0 or xj

=1

Page 22: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

22

Bounding ‐

Continuous Relaxation

Minimize   

cTx (= zlp

)

Subject to 

Ax = b

l

uSome x are integer

RelaxIntegrality Restriction

Lower bound on MIP objective

Page 23: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

23

Nice Properties of Continuous Rel.

• If relaxation solution satisfies integrality  restrictions:

– No need to further explore subspace• Natural branching candidates:

– Integer variables that are fractional in  relaxation

Page 24: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

24

Branch and Bound for MIP

Root

Integer

v 3 v 4

x 2 x 3

y 0 y 1

z 0 z 1

Lower Bound

Upper Bound

Integer

Page 25: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

25

Branch and Bound for MIP

Root

Integer

v 3 v 4

x 2 x 3

y 0 y 1

z 0 z 1

Lower Bound

Integer

Upper Bound

Page 26: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

26

Branch and Bound for MIP

Root

Integer

v 3 v 4

x 2 x 3

y 0 y 1

z 0 z 1

Lower Bound

Integer

Upper Bound

Page 27: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

27

Branch and Bound for MIP

Root

Integer

v 3 v 4

x 2 x 3

y 0 y 1

z 0 z 1

Lower Bound

Integer

Upper Bound

Infeas

LP Value

LP Value

Page 28: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

28

Branch and Bound for MIP

Root

Integer

v 3 v 4

x 2 x 3

y 0 y 1

z 0 z 1

Lower Bound

Integer

Upper Bound

Infeas

Page 29: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

29

Branch and Bound for MIP

Root

Integer

v 3 v 4

x 2 x 3

y 0 y 1

z 0 z 1

Lower Bound

Integer

Upper Bound

Infeas

z 0z 1

GAP

Page 30: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

30

Important Steps

Page 31: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

31

Important Steps

• Choose an unexplored node in the tree• Solve continuous relaxation• Strengthen formulation

– Generate cutting planes– Perform variable fixing

• Find integer feasible solutions that are “similar”

to  the relaxation solution (“Heuristics”)

• Choose a variable on which to branch• Explore logical implications of branch

• Repeat

The branch and bound loop

Page 32: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

32

Important Steps

• Choose an unexplored node in the tree• Solve relaxation• Generate cutting planes• Perform variable fixing

• Find integer feasible solutions that are  “similar”

to the relaxation solution

• Choose a variable on which to branch• Explore logical implications of branch

• Repeat

The branch and bound loop

Page 33: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

33

Tradeoff: feasibility versus optimalityNode Selection

• When exploring nodes  deep in the search tree…

– More likely to find integer  feasible solutions

– More likely to explore  nodes that would be 

pruned by later feasible  solutions

= integer feasible

Page 34: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

34

Node Selection Options

• Depth first• Breadth first• Best first

– Weight objective and # integer infeasibilities

• Best estimate

• Plunging (combined with above)– Always choose a child of the previously 

explored node

– Probed dive

Options

Page 35: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

35

Important Steps The branch and bound Loop

• Choose an unexplored node in the tree• Solve relaxation• Generate cutting planes• Perform variable fixing

• Find integer feasible solutions that are  “similar”

to the relaxation solution

• Choose a variable on which to branch• Explore logical implications of branch

• Repeat

Page 36: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

36

Node Relaxation Solution

• Change from parent relaxation is small : a  new bound on the branching variable

– Previous basis remains dual feasible

– Solution likely to be “close”

to previous basis

• A few iterations of dual simplex typically  suffice to restore optimality

• Cost per node quite low

Ideally suited to dual simplex

Page 37: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

37

Important Steps

• Choose an unexplored node in the tree• Solve relaxation• Generate cutting planes• Perform variable fixing

• Find integer feasible solutions that are  “similar”

to the relaxation solution

• Choose a variable on which to branch• Explore logical implications of branch

• Repeat

The branch and bound loop

Page 38: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

38

Important Steps

• Choose an unexplored node in the tree• Solve relaxation• Generate cutting planes• Perform variable fixing

• Find integer feasible solutions that are  “similar”

to the relaxation solution

• Choose a variable on which to branch• Explore logical implications of branch

• Repeat

The branch and bound loop

Page 39: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

Reduced Cost Fixing

• Recall: reduced cost DN

is the marginal cost of  moving a variable off of its bound

• If zlp

+ |Dj

z*– z* = objective of best known feasible solution (incumbent)

• Then xj

can be fixed to its current value in  this subtree (“region”)

Use reduced costs to fix variables

39

Page 40: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

40

Important Steps

• Choose an unexplored node in the tree• Solve relaxation• Generate cutting planes• Perform variable fixing

• Find integer feasible solutions that are  “similar”

to the relaxation solution

• Choose a variable on which to branch• Explore logical implications of branch

• Repeat

The branch and bound loop

Page 41: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

41

Important Steps

• Choose an unexplored node in the tree• Solve relaxation• Generate cutting planes• Perform variable fixing

• Find integer feasible solutions that are  “similar”

to the relaxation solution

• Choose a variable on which to branch• Explore logical implications of branch

• Repeat

The branch and bound loop

Page 42: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

42

Variable Selection

• Guiding principles:– Make important decisions early

– Both directions of branch should have an  impact

• Example:– Decide whether or not to build a factory first– Decide how many lines to place in the factory 

later

Greatly affects search tree size

Page 43: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

43

Variable Selection

• Question:– How to predict impact of a branch?

• Possible answers:– Find variables that are furthest from their bounds

• Maximum infeasibility

– Measure the impact for each branching candidate• Strong branching [Applegate, Bixby, Chvatal, Cook]

– Use historical information• Pseudo‐costs

Predicting impact

Page 44: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

44

Important Steps

• Choose an unexplored node in the tree• Solve relaxation• Generate cutting planes• Perform variable fixing

• Is the relaxation solution near‐feasible?• Choose a variable on which to branch• Explore logical implications of branch

• Repeat

The branch and bound loop

Page 45: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

45

Logical Propagation

• Simple example:– x + 2y + 3z 

3, all variables binary

– x = 1 (e.g., fixed during tree exploration)– z = 2/3 still feasible in LP relaxation

• Use bound strengthening

to tighten  variable bounds

Propagate implications logically

Page 46: Mixed Integer Programming - Zuse Institute Berlinco-at-work.zib.de/berlin2009/downloads/2009-09-24/2009... · 2009-09-25 · – Fleet assignment ... • Textile industry ... Ideally

46

Next

• Brief History of CPLEX MIP

• Heuristic details

• Cutting plane details