1 mathematical programming integer programming. 2 common types of ip’s and ip constraints two...

29
1 Mathematical Programming Mathematical Programming Integer Programming

Post on 20-Dec-2015

226 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Mathematical Programming Integer Programming. 2 Common Types of IP’s and IP Constraints Two common types of IP’s –#1: Capital budgeting –#2: Set covering

1

Mathematical ProgrammingMathematical Programming

Integer Programming

Page 2: 1 Mathematical Programming Integer Programming. 2 Common Types of IP’s and IP Constraints Two common types of IP’s –#1: Capital budgeting –#2: Set covering

2

Common Types of IP’s and Common Types of IP’s and IP ConstraintsIP Constraints

• Two common types of IP’s– #1: Capital budgeting– #2: Set covering

• Four common IP constraints– #3: Binary Variables & Logical Conditions– #4: Fixed costs– #5: Minimum order or purchase size– #6: Quantity discounts

Page 3: 1 Mathematical Programming Integer Programming. 2 Common Types of IP’s and IP Constraints Two common types of IP’s –#1: Capital budgeting –#2: Set covering

3

#1: Capital Budgeting#1: Capital Budgeting• Make a set of “go/no-go” decisions concerning a

pool of potential projects• Projects consume common resources

– Typically place capital demands in different time periods

– May require other resources such as staff time or expertise, possibly in different periods

– Often have logical linking constraints (can only do project #4 if you do project #6, etc.)

• When there is just one resource constraint it is known as a “knapsack problem”

Page 4: 1 Mathematical Programming Integer Programming. 2 Common Types of IP’s and IP Constraints Two common types of IP’s –#1: Capital budgeting –#2: Set covering

4

#2: Set Covering#2: Set Covering• Choose least cost set of “facilities” that serves

(covers) every customer adequately.• Example: Company wants to locate fewest

number of service centers such that all customers in region are within X miles of a service center.

• Example: A city has eight districts; each can house an ambulance. How many ambulances are needed and where should they be placed to make sure all districts are within 3 minutes of an ambulance?

Page 5: 1 Mathematical Programming Integer Programming. 2 Common Types of IP’s and IP Constraints Two common types of IP’s –#1: Capital budgeting –#2: Set covering

5

Set Covering (cont.)Set Covering (cont.)

• Decision variables– Xi = 1 if ambulance placed in district i– Xi = 0 if no ambulance placed in district i

• Objective– minimize number of ambulances– i.e., minimize number of Xi’s that equal 1

• 8 Constraints, 1 for each neighborhood– for every neighborhood, at least one of the

neighborhoods within a 3 minute drive must have its Xi = 1

Page 6: 1 Mathematical Programming Integer Programming. 2 Common Types of IP’s and IP Constraints Two common types of IP’s –#1: Capital budgeting –#2: Set covering

6

Data for Ambulance Problem:Data for Ambulance Problem:Travel Time Between DistrictsTravel Time Between Districts

#1 #2 #3 #4 #5 #6 #7 #8

#1 0 4 4 6 8 8 8 10

#2 3 0 3 4 7 6 9 9

#3 3 3 0 2 5 3 5 9

#4 6 3 2 0 3 2 5 5

#5 6 8 4 3 0 5 2 4

#6 9 6 4 2 4 0 3 2#7 8 12 6 5 2 3 0 2#8 10 9 7 4 4 2 2 0

Fro

m N

eigh

borh

ood

To Neighborhood

Page 7: 1 Mathematical Programming Integer Programming. 2 Common Types of IP’s and IP Constraints Two common types of IP’s –#1: Capital budgeting –#2: Set covering

7

Ambulance Problem:Ambulance Problem:Mathematical FormulationMathematical Formulation

Min X1 + X2 + X3 + X4 + X5 + X6 + X7 + X8

s.t. X1 + X2 + X3 >= 1

X2 + X3 + X4 >= 1

X2 + X3 + X4 >= 1

X3 + X4 + X5 + X6 >= 1

X4 + X5 + X7 >= 1

X3 + X4 + X6 + X7 + X8 >= 1

X5 + X6 + X7 + X8 >= 1

X6 + X7 + X8 >= 1 and all Xi binary

Page 8: 1 Mathematical Programming Integer Programming. 2 Common Types of IP’s and IP Constraints Two common types of IP’s –#1: Capital budgeting –#2: Set covering

8

#3: Binary Variables and #3: Binary Variables and Logical ConditionsLogical Conditions

• Suppose could place an ambulance in only one of the first three districts:– X1 + X2 + X3 <= 1

• Suppose needed an ambulance in at least one of the first three districts– X1 + X2 + X3 >= 1

• Exactly one– X1 + X2 + X3 = 1

Page 9: 1 Mathematical Programming Integer Programming. 2 Common Types of IP’s and IP Constraints Two common types of IP’s –#1: Capital budgeting –#2: Set covering

9

Binary Variables and Binary Variables and Logical Conditions (cont.)Logical Conditions (cont.)

• Suppose could only do project #2 if project #1 is funded. I.e., cannot have X2 = 1 if X1 = 0. Then add constraint:– X1 - X2 >= 0

• Suppose could only do project #2 if either project #1 or project #3 is funded.– X1 - X2 + X3 >= 0

• Etc.

Page 10: 1 Mathematical Programming Integer Programming. 2 Common Types of IP’s and IP Constraints Two common types of IP’s –#1: Capital budgeting –#2: Set covering

10

Can Apply This Idea Can Apply This Idea to Constraintsto Constraints

• If must meet at least 1 of 2 constraints:– X1 + 2X2 + 3X3 <= 15 or– 2X1 + X2 + X3 <= 10

• Create binary variables Yi & constraints– M Y1 >= X1 + 2X2 + 3X3 - 15– M Y2 >= 2X1 + X2 + X3 - 10– where M is any very, very large number

• If constraint i violated, then Yi must be 1• Ensure both constraints are not violated

– Y1 + Y2 <= 1

Page 11: 1 Mathematical Programming Integer Programming. 2 Common Types of IP’s and IP Constraints Two common types of IP’s –#1: Capital budgeting –#2: Set covering

11

Extend to GeneralExtend to GeneralSets of ConstraintsSets of Constraints

• Suppose must meet K of L constraints:– gi(X1, X2, X3, ..., Xn) <= 0, i = 1, 2, 3, ..., L

– Create binary variables Yi such that Yi = 1 if constraint i is violated.

– M Yi >= gi(X1, X2, X3, ..., Xn) for each i

– To ensure that no more than L-K constraints are violated, add constraint

– Y1 + Y2 + Y3 + ... + YL <= (L - K)

Page 12: 1 Mathematical Programming Integer Programming. 2 Common Types of IP’s and IP Constraints Two common types of IP’s –#1: Capital budgeting –#2: Set covering

12

#4: Fixed Costs:#4: Fixed Costs:Ordering ShirtsOrdering Shirts

• Suppose ordering shirts from LL Bean costs $20/shirt plus a $5 shipping charge (regardless of the number of shirts ordered) and ordering shirts from Land’s End costs $19/shirt plus a $10 shipping charge.

• How express total cost as a function of– X1 = # of shirts ordered from LL Bean

– X2 = # of shirts ordered from Land’s End

Page 13: 1 Mathematical Programming Integer Programming. 2 Common Types of IP’s and IP Constraints Two common types of IP’s –#1: Capital budgeting –#2: Set covering

13

Algebraic Formulation of Total Algebraic Formulation of Total Cost of Ordering ShirtsCost of Ordering Shirts

• Create two new binary variables– Y1 = 1 if order shirts from Bean; else 0– Y2 = 1 if order shirts from L.E.; else 0

• Add four constraints– M Yi >= Xi for i = 1 and 2– Yi <= M Xi for i = 1 and 2– M is some very large number (“Big M”)– Note: Yi = 1 if Xi > 0 and Yi = 0 if Xi = 0.

• Total cost of ordering shirts is Min 5 Y1 + 20 X1 + 10 Y2 + 19 X2

Page 14: 1 Mathematical Programming Integer Programming. 2 Common Types of IP’s and IP Constraints Two common types of IP’s –#1: Capital budgeting –#2: Set covering

14

Fixed Costs:Fixed Costs:General FormulationGeneral Formulation

• Suppose incur a fixed cost FCi > 0 if a decision variable is greater than 0 (in addition to variable cost (ci) per unit)– Create a binary variable Yi

– Add constraints: M Yi >= Xi for each i

– Ensures Yi = 1 if Xi > 0

– Objective function becomes

Min FC1 Y1 + c1 X1 + FC2 Y2 + c2 X2 + ...

– Minimization ensures Yi = 0 if Xi = 0.

Page 15: 1 Mathematical Programming Integer Programming. 2 Common Types of IP’s and IP Constraints Two common types of IP’s –#1: Capital budgeting –#2: Set covering

15

#5: Minimum Order #5: Minimum Order or Purchase Size or Purchase Size

• Suppose a book store has to order at least 20 copies of a title if it orders any.

• If X = # of copies ordered, how can this constraint be written? – Create binary variable Y such that Y = 1 if X > 0

and Y = 0 if X = 0.– Add constraints: – M Y >= X and (so if X > 0, Y = 1)– X >= 20 Y (if Y = 1, X >= 20)

Page 16: 1 Mathematical Programming Integer Programming. 2 Common Types of IP’s and IP Constraints Two common types of IP’s –#1: Capital budgeting –#2: Set covering

16

General Formulation of Min. General Formulation of Min.

Order or Purchase SizeOrder or Purchase Size

• Suppose that if Xi > 0, it must be at least Li (I.e., cannot have 0 < Xi < Li)

– Create a binary variable Yi such that Yi = 1 if Xi > 0 and Yi = 0 if Xi = 0.

– Add constraints:

– M Yi >= Xi and (so if Xi > 0, Yi = 1)

– Xi >= Li Yi for each i (if Yi = 1, Xi >= Li)

Page 17: 1 Mathematical Programming Integer Programming. 2 Common Types of IP’s and IP Constraints Two common types of IP’s –#1: Capital budgeting –#2: Set covering

17

#6: Quantity Discounts #6: Quantity Discounts

• Suppose first Li units cost Ci1; additional units can be purchased at Ci2 < Ci1.

– Create a binary variable Yi such that Yi = 1 if Xi > Li. Divide Xi into Xi1 and Xi2.

– Add constraints:

Xi2 <= M Yi and (if Xi2 > 0, Yi = 1)

Xi1 >= Li Yi for each i (if Yi = 1, Xi1 >= Li)

Obj fn: Min C11 X11 + C12 X12 + C21 X21 +

C22 X22 + C31 X31 + C32 X32 + ...

Page 18: 1 Mathematical Programming Integer Programming. 2 Common Types of IP’s and IP Constraints Two common types of IP’s –#1: Capital budgeting –#2: Set covering

18

Quantity DiscountQuantity Discount Example Example (One Item; Multiple Breaks)(One Item; Multiple Breaks)

• Stock brokerage fees are– $27.50 fixed cost per order + – 0.0092 * $ amount up to $10K– 0.0066 * $ amount between $10K - $25K +– 0.0045 * $ amount over $25K.

• How express the brokerage fee as a function of the value of the order? Let– X1 = order amount up to $10K– X2 = order amount from $10K - $25K– X3 = order amount over $25K– Y1, Y2, Y3 are binary

Page 19: 1 Mathematical Programming Integer Programming. 2 Common Types of IP’s and IP Constraints Two common types of IP’s –#1: Capital budgeting –#2: Set covering

19

Quantity Discount Quantity Discount Example SolutionExample Solution

• ConstraintsX3 <= M Y3 (if X3 > 0, Y3 = 1)

X2 >= 15,000 Y3 (if Y3 = 1, X2 >= 15,000)

X2 <= 15,000 Y2 (if X2 > 0, Y2 = 1)

X1 >= 10,000 Y2 (if Y2 > 0, X1 >= 10,000)

X1 <= 10,000 Y1 (if X1 > 0, Y1 = 1)

• Purchase – amount: X1 + X2 + X3

– cost: 27.50 Y1 + 0.0092 X1 + 0.0066 X2

+ 0.0045 X3

Page 20: 1 Mathematical Programming Integer Programming. 2 Common Types of IP’s and IP Constraints Two common types of IP’s –#1: Capital budgeting –#2: Set covering

20

BreakBreak

Page 21: 1 Mathematical Programming Integer Programming. 2 Common Types of IP’s and IP Constraints Two common types of IP’s –#1: Capital budgeting –#2: Set covering

21

Mathematical ProgrammingMathematical Programming

Nonlinear Programming

Page 22: 1 Mathematical Programming Integer Programming. 2 Common Types of IP’s and IP Constraints Two common types of IP’s –#1: Capital budgeting –#2: Set covering

22

MaximinMaximin

Page 23: 1 Mathematical Programming Integer Programming. 2 Common Types of IP’s and IP Constraints Two common types of IP’s –#1: Capital budgeting –#2: Set covering

23

MaximinMaximin

Page 24: 1 Mathematical Programming Integer Programming. 2 Common Types of IP’s and IP Constraints Two common types of IP’s –#1: Capital budgeting –#2: Set covering

24

MaximinMaximin

Page 25: 1 Mathematical Programming Integer Programming. 2 Common Types of IP’s and IP Constraints Two common types of IP’s –#1: Capital budgeting –#2: Set covering

25

MaximinMaximin

Page 26: 1 Mathematical Programming Integer Programming. 2 Common Types of IP’s and IP Constraints Two common types of IP’s –#1: Capital budgeting –#2: Set covering

26

Minimale AbweichungMinimale Abweichung

Page 27: 1 Mathematical Programming Integer Programming. 2 Common Types of IP’s and IP Constraints Two common types of IP’s –#1: Capital budgeting –#2: Set covering

27

Minimale AbweichungMinimale Abweichung

Page 28: 1 Mathematical Programming Integer Programming. 2 Common Types of IP’s and IP Constraints Two common types of IP’s –#1: Capital budgeting –#2: Set covering

28

Minimale AbweichungMinimale Abweichung

Page 29: 1 Mathematical Programming Integer Programming. 2 Common Types of IP’s and IP Constraints Two common types of IP’s –#1: Capital budgeting –#2: Set covering

29

BreakBreak