280 likes | 357 Views
1-to-1 Distribution. John H. Vande Vate Spring, 2001. D(t) = cumulative demand to time t D’(t) = rate of demand at time t. Two cases: Only Rent Costs matter Only Inventory Costs matter. When Demand Varies Predictably. Make them all the same size
E N D
1-to-1 Distribution John H. Vande Vate Spring, 2001 1
D(t) = cumulative demand to time t D’(t) = rate of demand at time t. Two cases: Only Rent Costs matter Only Inventory Costs matter When Demand Varies Predictably 2
Make them all the same size If we have n shipments in time t, make them all size D(t)/n Question reduces to n Trade off shipment cost (smaller n) vs Inventory cost (larger n) To Minimize the Maximum... 3
Total cost with n shipments is Transportation cost (ignore variable portion) fixed*n Inventory Cost Rent Cost is $/unit/year Rent * (D(T)/n)*T Average Cost per unit Rent*T/n + fixed*n/D(T) So n is Rent*T*D(T)/fixed That’s just an EOQ problem 4
More realistic - Ignore Rent • Wagner-Whitin Dynamic programming approach. • Computationally intensive • How accurate is the forecast of demand? • How sensitive is the cost to the answer? 5
Discuss Later Wagner-Whitin 6
The Continuous Approximation Approach There is some t’ where Area = (t3-t2)2D’(t’)/2 Fixed shipment cost + ci*area Area (t3-t2)height/2 height (t3-t2)D’(t’) t1 t3 t2 t0 7 t’
H(t) = (ti - ti-1) if ti-1 t < ti So total cost = (Fixed + c*areai) = (Fixed + c*(ti - ti-1)2D’(ti’)/2) = (Fixed + c*H(ti’)2D’(ti’)/2) = (Fixed /H(t) + c*H(t)D’(t’)/2)dt Step Function An abuse of notation 8
= (Fixed + c*H(ti’)2D’(ti’)/2) = (Fixed /H(t) + c*H(t)D’(t’)/2)dt Why? Fixed /H(t)dt = titi-1Fixed /H(t)dt = titi-1Fixed /(ti - ti-1)dt = Fixed c*H(t)D’(t’)/2dt = titi-1c*H(t)D’(ti’)/2dt = titi-1c*(ti - ti-1)D’(ti’)/2dt = c*(ti - ti-1)2D’(ti’)/2 = c*H(t’i)2D’(ti’)/2 Equivalence 9
Total cost = (Fixed + c*H(ti’)2D’(ti’)/2) = (Fixed /H(t) + c*H(t)D’(t’)/2)dt (Fixed /H(t) + c*H(t)D’(t)/2)dt Find a smooth function H(t) that minimizes the cost (an EOQ formula) H(t) = (2Fixed/cD’(t)) Approximation 10
If Demand is constant with rate D’ We dispatch every t time units Cost per time = Fixed/t + ctD’/2 Best headway is t = (2Fixed/cD’) Compare with H(t) H(t) = (2Fixed/cD’(t)) What is H(t)? 12
We have a continuous approximation H(t) to the discrete (step function) headways. How do we recover implementable headways from H(t)? Back to the Discrete World 13
Finding Headways consistent with H(t) Headway = Avg of H(t) in [0, Headway] Avg = Integral of H(t) over the Headway/Headway Headway2 = Integral of H(t) over the Headway Find Headways so that the squares approximate the area under H(t) Consistent Headways 14
Example 15
Inventory Cost 25.34 Shipment Cost 10 Total Cost 35.34 Is that any good? How’d we do? 18
Optimum Answer set Periods; param Demand{Periods}; table DemandTable IN "ODBC" "DSN=Wagner" "Demand": Periods<-[Period], Demand; read table DemandTable; param FixedTransp := 1; param VarTransp := 1; param Holding := 1; /* $/unit/period */ var Inv{Periods} >= 0; /* Shipment quantity */ var Ship{Periods} binary; /* Whether or not we ship */ var Q{Periods} >= 0; /* Shipment size */ 19
minimize TotalCost: sum{t in Periods} FixedTransp*Ship[t] + sum{t in Periods} VarTransp*Q[t] + sum{t in Periods} Holding*Inv[t]; s.t. InitialInventory: Q[1] - Inv[1] = Demand[1]; s.t. DefineInventory{t in Periods: t > 1}: Inv[t-1] + Q[t] - Inv[t] = Demand[t]; s.t. SetupOrNot{t in Periods}: Q[t] <= Ship[t]*sum{k in Periods: k >= t} Demand[k]; One Model 20
Optimum Solution 25.5 Answer from CA Method 35.3 Comparison 21
D’(t) changes pretty wildly Why so Bad? 22
set Periods; param Demand{Periods}; table DemandTable IN "ODBC" "DSN=Wagner" "Demand": Periods<-[Period], Demand; read table DemandTable; param FixedTransp := 1; param VarTransp := 1; param Holding := 1; /* $/unit/period */ var Ship{Periods} binary; /* Amount we ship in period s that meets demand in period t */ var Q{s in Periods, t in Periods: t >= s} >= 0; More on the Optimization Model 23
minimize TotalCost: sum{t in Periods} FixedTransp*Ship[t] + sum{s in Periods, t in Periods: t >= s} VarTransp*Q[s,t] + sum{s in Periods, t in Periods: t >= s} (t-s)*Q[s,t]; s.t. MeetDemand{t in Periods}: sum{s in Periods: s <= t} Q[s,t] = Demand[t]; s.t. ShipOrNot{s in Periods, t in Periods: t >=s}: Q[s,t] <= Ship[s]*Demand[t]; A Better Model 24
Solves faster LP relaxation closer to MIP solutions Didn’t aggregate constraints Q[s,t] <= Ship[s]*Demand[t] Implies sum{t in Periods: t >= s} Q[s,t] <= Ship[s]*sum{t in Periods: t>= s} Demand[t]; Q[s] <= Ship[s]*sum{t in Periods: t >= s} Demand[t]; Why’s it Better 25
A Computationally intensive Dynamic Programming Procedure for solving Why? Advantage/Disadvantage of CA over MIP Back To Wagner - Whitin 26
ODBC = Open Data Base Connectivity ODBC Administrator : Control Panel DSN = Data Source Name Driver = Method for reading the DSN, e.g., Excel 97 Security and other features Aside on Importing Data 27
Table <<tablename>> IN “ODBC” “DSN=<<dsnname>>” “tablename”: definedset <- [index], parametername~columnname, …; IN, OUT, INOUT SQL= sql statement With AMPL 28