130 likes | 265 Views
WOOD 492 MODELLING FOR DECISION SUPPORT. Lecture 17 Integer Programming. Integer Programming (IP). For discrete inputs/outputs Number of workers required in a factory For binary variables (yes/no decisions) Building a facility For logical conditions (if {x} then {y})
E N D
WOOD 492 MODELLING FOR DECISION SUPPORT Lecture 17 Integer Programming
Integer Programming (IP) • For discrete inputs/outputs • Number of workers required in a factory • For binary variables (yes/no decisions) • Building a facility • For logical conditions (if {x} then {y}) • If sawing pattern 1 is selected, then sawing pattern 2 can not be selected Wood 492 - Saba Vahid
Example 9: Integer Formulation Example • A facility location problem • A manufacturing company has $10 million available capital and would like to invest this in building new factories and warehouses in Los Angeles and San Francisco in order to maximize Net Present Value (NPV). • Decision Variables: which facilities to build? (either build or don’t build, binary) • Constraints: • Factories can be built in L.A. or S.F, or both • Only one warehouse can be located and should be in a city where a new factory is being built Wood 492 - Saba Vahid
This is a Binary Integer Program (BIP) • ObjZ=9 X1 +5 X2 +6 X3 +4 X4 (Total NPV) • Subject to: 6 X1+3 X2+ 5 X3+ 2 X4 10 (Total Capital) X3+ X4 1 (One warehouse) -X1 + X3 0 (warehouse and factory - X2 + X4 0 in the same city) Xi 1 (Upper bound) Xi 0 (Lower Bound) LP Matrix Wood 492 - Saba Vahid
Using indicator variables • Indicators are binary variables used for modelling problems with: • Fixed costs • Either/OR constraints • If/Then constraints • … Wood 492 - Saba Vahid
Fixed-Charge Problems • When taking up an activity has a one-time fixed cost • production line set-up cost • Road establishment cost • Example: • A cabinet manufacturer can outsource the cabinet doors at $20/door or make them in the factory with $500 line set-up cost and then $10/door production cost. Wood 492 - Saba Vahid
Fixed-Charge Problems • Objective is to minimize costs • Decision variables are • X1 number of outsourced doors • X2 number of manufactured doors • Total cost for outsourced doors: • 20 X1 • Total cost for the manufactured doors: • 0if X2=0 • 500 + 10 X2 if X2>0 Wood 492 - Saba Vahid
Fixed-Charge Problems • How can we force the $500 costs when X2 is greater than 0? • We define an indicator variable Y2 : • if X2=0 then Y2=0 • otherwise Y2=1 • Now, rewrite the formula for production cost: • Manufacturing cost: 500 Y2 + 10 X2 • Objective: Min Z= 20 X1 + 500 Y2 + 10 X2 Wood 492 - Saba Vahid
Fixed-Charge Problems • Now, how to ensure that Y2 value changes according to X2 value? • Big M method: • Choose a big number M (relative to problem parameters, bigger than any possible value of X2) • Add the following to the existing constraints • X2 <= M.Y2 • Y2 is binary • How does this constraint work? • If X2>0, then Y2 has to be 1, so that X2<=M • If X2=0, then Y2 can be either 0 or 1, however since 500Y2 is a term in the objective function, the solution algorithm always picks Y2=0, because it results in the lower objective function value Wood 492 - Saba Vahid
Either/OR Constraints • When only one of two constraints must hold • E.g. there are two suppliers for cabinet doors • Each supplier has a certain number of doors available for shipping • Only one of the suppliers can be selected • Variables: number of doors purchased (X) • Supply constraints (depending on which supplier is elected): • Either X <= 100 • OR X <= 150 Wood 492 - Saba Vahid
Either/OR Constraints • Define an indicator variable Y: • If first supplier is selected, Y=1 and first constraint is activated • otherwise Y=0 and second constraint is activated • Use the Big M Method • Constraint 1: X <= 100 + M. (1-Y) • Constraint 2: X <= 150 + M. Y • How does this formulation work? • If supplier 1 is selected, then Y=1, so the first constraint will be X<=100 and the second constraint will be X<=150+M which in effect eliminates the second constraint (since M is a really big number) • If supplier 2 is selected, then Y=0 and the first constraint is eliminated • The solution algorithm picks the Y value that results in the best value of the objective function Wood 492 - Saba Vahid
Lab 6 preview • Same problem as in Lab 3 • Adding extra constraints: • Building the roads to each cut block (if we harvest, we have to build the road first) • Selecting only one sawing pattern for all log sizes • Selecting the optimal number of shifts to run the sawmill (1,2, or 3) LP matrix Wood 492 - Saba Vahid
Next Class • Branch and bound Wood 492 - Saba Vahid