08 Integer Programming 1 Print
08 Integer Programming 1 Print
A Simple Example
Steel Cable Company
Integer Programming Example Market Limit (Tons)
An Integer Program
3
Coils Limit
2
Production Capacity
1
Bands
3
X
Coils
1 2 3
Branching
3
Coils
Bands
5
Bounding
3
$50,000*3= $150,000
Upper Branch Coils 1
Coils
X 3
Bands
6
Bounding
3
Yields $188,571
Coils
Bands
7
Further Nodes
3
X Yields $184,000
Coils
1 2 3 4
Bands
8
Further Nodes
3
X Yields $160,000
Bands
9
Further Nodes
3
X Yields $177,143
Node 5: Upper Branch Coils 2
Bands
10
Yields $170,000
Coils
1 2 3 4
Bands
11
Rounding Fails
3
X
Production Capacity LP Solution
X
Coils
1 2 3
A Solver Model
Steel Cable Company
Integer Programming Example Products Hours/Ton Profit/Ton Production Plan Products Tons Produced Maximum Sales Bands Coils 3 4 $ 50,000 $ 60,000
Bands 0 3
14
Integer Variables
Integer: -2, -1, 0, 1, 2, Binary: 0 or 1 Binary: Yes or No, On or Off
15
Single Sourcing
Assign each customer to only one DC Simplifies service network
16
Lower Cost?
Does Single-Sourcing Reduce/Increase distribution cost?
19
Modeling Single-Sourcing
Vanilla Approach
set DCS; set CUSTOMERS; param Capacity{DCS}; param Demand{CUSTOMERS}; param Cost{DCS, CUSTOMERS}; var Assign{DCS, CUSTOMERS} binary; minimize TotalCost:
sum{dc in DCS, cust in CUSTOMERS} Cost[dc, cust]*Assign[dc, cust] + Other Costs
15.057 Spring 03 Vande Vate 20
21
22
Size!
Thousands of customers Scores of DCs Hundreds of thousands of Integer Variables Most useless! Assign a Customer in ME to a DC in CA?
15.057 Spring 03 Vande Vate 23
Practical Solution
Dont naively include all possible assignments Only include those:
Within a specified distance Among the N closest .
24
A B C Totals
To 1 $$$$-
To 2 $$$$-
To 3 $$$ 0 $ 0
25
Binary Switches
Variables
Yes/No: Lease warehouse or not (Binary) Shipments from Warehouses to Sales Districts
Constraints:
Meet Demand Dont exceed Leased Capacity
Yes/No leased Warehouse *Capacity of Warehouse At Warehouse B: Effective Capacity = 0*250 At Warehouse A: Effective Capacity = 1*200
Objective
Variable Cost for Trucks
$100/truck from Warehouse C to District 1
An AMPL Model
set WAREHOUSES; param Capacity{WAREHOUSES}; param Lease{WAREHOUSES}; set DISTRICTS; param Demand{DISTRICTS}; param TruckCost{WAREHOUSES, DISTRICTS};
28
var Open{WAREHOUSES} binary; var Ship{WAREHOUSES, DISTRICTS} >= 0; minimize TotalCost: sum{w in WAREHOUSES} Lease[w]*Open[w] + sum{w in WAREHOUSES, d in DISTRICTS} TruckCost[w,d]*Ship[w,d]; s.t. MeetDemand{d in DISTRICTS}: sum{w in WAREHOUSES} Ship[w,d] >= Demand[d]; s.t. ObserveEffectiveCapacity{w in WAREHOUSES}: sum{d in DISTRICTS} Ship[w,d] <= Capacity[w]*Open[w];
29
Targets
Excess ShortFall Adjusted Deviation
29.29
Summary
var Invest{FUNDS} binary; var Fraction{FUNDS} >= 0;
s.t. MaxHoldings;
sum{f in FUNDS} Invest[f] <= 10;
s.t. MinHoldings;
sum{f in FUNDS} Invest[f] >= 5; s.t. MinimumPercentage{f in FUNDS}: Fraction[f] >= 0.10*Invest[f];
...
31
Dont Forget
S.t. DefineInvest{f in FUNDS}:
Invest[f] >= Fraction[f];
Cant put money in fund unless you admit to being invested in it.
32
F F F F F Denver F F Los Angeles F F F F F F FF Houston F New Orleans F F F F Atlanta F F F F Chicago F F F F F F F F Pittsburgh F F F F New Y ork F
Boston
San FranciscoF F F
4
F
F F
WesternAir
Western Airlines Hub Selection Mile 1000 CH 674 1,005 1,008 1,067 2,054 912 802 452 1,390 2,142 2,013 DE 1,398 1,949 1,008 1,019 1,059 1,273 1,771 1,411 504 1,235 1,307 HO 789 1,804 1,067 1,019 1,538 356 1,608 1,313 1,438 1,912 2,274 LA 2,182 2,979 2,054 1,059 1,538 1,883 2,786 2,426 715 379 1,113 NO 479 1,507 912 1,273 356 1,883 1,311 1,070 1,738 2,249 2,574 NY 841 222 802 1,771 1,608 2,786 1,311 368 2,182 2,934 2,815 PI 687 574 452 1,411 1,313 2,426 1,070 368 1,826 2,578 2,465 SL 1,878 2,343 1,390 504 1,438 715 1,738 2,182 1,826 752 836 SF 2,496 3,095 2,142 1,235 1,912 379 2,249 2,934 2,578 752 808 SE 2,618 2,976 2,013 1,307 2,274 1,113 2,574 2,815 2,465 836 808 Distance Matrix AT BO 1,037 AT BO 1,037 CH 674 1,005 DE 1,398 1,949 HO 789 1,804 LA 2,182 2,979 NO 479 1,507 NY 841 222 PI 687 574 SL 1,878 2,343 SF 2,496 3,095 SE 2,618 2,976
34
Summary
Mixed Integer Programming Models
Mostly about Binary Variables (Logic) Significantly Harder to solve
35