Comjwl. b Ops Res., Vol. 5, pp. 115422. @ PersamonPress Ltd. 1978. PrInted in Great Britain
A HEURISTIC APPROACH TO COMMODITY PURCHASING SANTIB. LAHIRI* Interactive
Science Corporation,
Braintree. Massachusetts.
U.S.A.
Scope and pwpose4iven a price quotation. the buyer is contronted with the following decision-making problems: (I) whether to buy or wait for the next offer: (2) if he decides to buy. then how much should he buy so that his long-term costs are minimized. Basically he will try to build up stock when the price is low and thus will avoid purchasing when the price is high. Since he tends to use his subjective judgment in timing his purchases, on some occasions he will buy at low prices while on other occasions he will buy at very high prices and in that process he will fail to minimize his long-term costs. In view of this he needs a system, based on some analytical study, which will help in minimizing his long-term costs. The paper discusses the development of a Heuristic model which helps improve purchasing efficiency substantially. The proposed approach has been followed in designing a number of commodity purchasing systems and has been found to be working quite satisfactorily. Abstract-In this paper a Heuristic model is proposed for commodity purchasing. The model is based on the combined use of Dynamic Programming model and a price trend forecasting model. The proposed approach is highly efficient and is simple to use even by a layman. Performance of the proposed model is comparedwith that of the Dynamic Programming model. The results of the sensitivity analysis indicate that the proposed approach performs consistently better compared to that of the Dynamic Programming model. It is. therefore, believed that the proposed approach would be fruitfully utilized in designing an optimal commodity purchasing system.
INTRODUCTION
The buyer buys different materials and ingredients, the prices of which move upwards and downwards with time. When offered a price quotation, he has to decide: (1) whether to make a purchase or wait for the next price offer: (2) if he decides to buy, then how much should he buy at that point in time so that his long-term costs are minimized. The basic principle that any good buyer will try to follow is that he will build up stock when the price is low and thus will avoid purchasing when’the price is high. But what usually happens in practice is that he tends to use his subjective judgment in timing his purchases. This means that on some occasions he buys at low prices while on other occasions he buys at very high prices and in that process he eventually fails to minimize his long-term costs. Quite clearly, he needs a system, based on some analytical study, which well help him in minimizing his long-term costs. Both Fabian et al. [l] and Kingsman[2] made an attempt to design optimal purchasing policies using a powerful analytical technique called Dynamic Programming. But their models have severe limitations, as far as their applicability in real-life problems is concerned, mainly because of the simplified assumption that the prices are subject to stationary density function. In this paper we propose a combined use of Dynamic Programmingmodel and a statistical forecasting model which demonstrates a higher purchasing efficiency when applied to real life problems. While the combined approach is Heuristic in nature, its validity has been checked with the help of a sensitivity analysis. DYNAMIC
PROGRAMMING
(DP)
MODEL
The following basic assumptions have been made in building the model: (1) time, k, is divided into successive periods; *Santi B. L&i is a Senior Applications Development Specialist with Interactive Sciences Corporation in Braintree, Massachusetts. He has a degree in Mechanical Engineering from Jadavpur University, Calcutta, and a Post-Graduate Certificate in Statistics from Indian Statistical Institute, Calcutta. He also has a Master of Science Degree in Operational Research from the University of Stmthcl~de, Glasgow, Scotland. He has published/presented more than a half-dozen papers in the~joumals and conferences of the Operational Research Society of the U.K. and India. Computer Society of India and in the World Congress on Productivity of Sciences. 115
S.B.LAHIRI
116
(2) prices in successive periods are independent; and are represented by q: y(q) has been taken as the probability density function of future prices: (3) storage cost is, h, per unit per period: (4) once the commodity is bought it cannot be resold: (5) a finite planning horizon of N periods is chosen; (6) demand, d, is known for all period of the planning horizon; (7) decisions on purchasing are made once a period: (8) no shortages are allowed; (9) amount of stock on hand is s ; (10) price quoted to the purchaser is p. On any decision making day the state of the system can be described by the following: (1) the amount of stock on hand, s; (2) the price quoted to the purchaser, p; (3) the number periods for which a purchasing decision is to be made. The cost of the optimal one-period policy for the last period with initial stock s is [(x-s)p+h(x-kd,)]
f,(s,p)=Min
(1)
x L d,
where x represents cover to be achieved after purchase and the cost of the k-period optimal policy with initial stock s and price offer p is
(2)
The problem is to determine ordering rules (in terms of s and p) for k = N. These are derived by solving the functional equations (1) and (2) above. The proof is by the method of induction which can be found in Fabian et al. [ I]. The results are summarized below: (1) The optimal purchasing policies are derived using the price breaks & at which the buyer is indifferent as to whether he should cover for k or k - 1 period ahead, given by the recurrence relations %I
Fk =
4. y(cl)dq +
a Fk-,Y(q)dq - hl I Fk-1
and Fz =
I
0
1
(3)
D
4 * y(q)dq - h
whence Fz represents the average of all prices; (2) The optimal policy is to purchase a quantity so as to raise the stock level to satisfy the demands of a number of successive complete periods ahead. For an N-period planning horizon, the stocks x, to be achieved after purchase are given below: N
P<
FN
Fi+,
dk
x=
N x= k=
P ’
F2
COMBINEDUSEOFDP
x=
&
&
dk forj=N-l,N-2,...2
-j+l
I
J
MODEL ANDSTATISTICAL FORECASTING MODEL
In general, the assumption that the prices are subject to the stationary density functions is not true. In fact, prices are subject to trends and seasonal variations. The above model can be
A Heuristicapproachto commoditypurchasing
117
adjusted to allow for this situation provided that the trend and seasonally adjusted prices in successive periods are still assumed to be independent. In order to do this we have to recalculate the price breaks each period as we moved forward in time, since the price distributions would have changed. In real-life situations it is often found that the price trends in successive periods are not independent. Generally speaking, the trends upwards or downwards, tend to persist for a number of successive periods before a reversal in trend takes place. In a situation like this, the use of the DP model alone will not be desirable. As a matter of fact, performance of the model will, in general, be poor. To deal with this situation, it is almost essential to devise a price forecasting model to be used along with the DP model. Ideally the price forecasting model should be an econometric one but even a statistical price forecasting model can be fruitfully utilized. The statistical forecasting model, used to calculate price trends, is based on exponential smoothing technique. The combined use of the DP model and the price forecasting model (given in the form of a nomogram) is very simple. It is as follows: (1) Calculate the optimal purchasing quantity using the DP model (given in a graphical form) corresponding to a price offer; (2) Calculate the price trend value using the nomogram. Price trend = current exponentially weighted average price minus past exponentially weighted average price; (3) If the current price trend value is negative, use the DP model only-i.e. buy an amount as indicated by the graph; (4) If the current price trend value is positive (and greater than zero) and the immediate past period’s trend is negative (i.e. it shows the beginning of a rising trend), then ignore the DP model completely and buy the maximum quantity that can be bought at this opportunity, without violating the constraint of the maximum cover; (5) If the current price trend value is positive and the price is less than F2,then also ignore the DP model completely and buy the maximum quantity that can be bought at this opportunity, without, of course, violating the constraint of the maximum cover; (6) If the current price trend is positive and the price is greater than Fz,then follow the DP model only. It is quite likely that such a combined approach will be heuristic in nature meaning thereby that it will never guarantee an optimum solution. Since the approach is heuristic in-nature it is imperative to conduct a sensitivity analysis to see how it reacts in a varied situation. Should the results of the sensitivity analysis go in favor of the proposed approach (by that we mean that the proposed approach must demonstrate a reasonably high purchasing efficiency consistently) we can recommend such an approach to be used in buying commodities in a market characterized by price trend effects, i.e. where the price trends, upward or downward, must persist for at least three consecutive periods before a reversal in trend takes place. As a matter of fact the combined approach has been followed in designing purchasing systems for a number of commodities, e.g. refined oil, copper scrap, copper ingots, etc. In all cases it has been found to be working much more efficiently than the DP model alone. Appendix 2 summarizes the application of the Heuristic approach uis-ci-uisDP approach to another commodity. It also shows that the Heuristic approach is much more efficient compared to the DP approach. AN EXAMPLE OF THE USE OF COMBINED APPROACH
We now go to demonstrate the effect of using the proposed approach. Let us work with the weekly price movements of a commodity for a period of four years. While the weekly demand for the commodity is reasonably steady, there is a good amount of fluctuation in prices which can be seen from the table given in the Appendix 1. First of all, the mean and standard derivation of prices for four years are calculated. They are found to be 58 and 10 respectively. An attempt is then made to generate the prices from a normal distribution with a mean of 58 and standard deviation of 10. Based on these prices and using equations (3) and (4) of the DP model, an optimal purchasing policy graph is drawn (see Fig. 1). Having drawn the optimal purchasing policy graph, an attempt is made to use an exponential smoothing technique to calculate the price trends. The forecasting nomogram (see Fig. 2) is
S. B. LAHIRI
118
120-
120-
120
II0-
110-
110
100 65 I r
90
60 8
‘& 80 + 5 t
55 5
3 i
1
70
JO1
k3
60 45 -
40 40123456789
Weeke cover to be achievedofter purchase Fig. 2. Nomogram.
Fig. I. Optimal purchasingpolicy graph.
drawn corresponding to the smoothing constant of 0.30 which has been found to give good response with respect to price changes. Starting with an initial value of 40, the price trends are calculated. These price trend values are also listed in Appendix 1. Assuming a maximum cover of eight weeks, simulated purchases are then made following the combined approach as described above. The timings and size of purchases are also shown in the appendix. The average price based on this has been found to be 55.8. For the purpose of comparison and evaluation, the following average prices have also been calculated: (1) If the buyer has merely covered his requirements each week-this is known as hand-to-mouth buying and is the average of the price offers at the beginning of each week; (2) The average price paid with perfect hindsight knowledge of price movements and buying within the constraint of maximum cover of eight weeks’ requirements; (3) The average price based on the DP model alone. The average prices paid per unit under each of these four circumstances are as follows: Hand-to-mouth 58.0
Hindsight 53.6
DP model only 57.2
Combined approach 55.8
A better evaluation of alternative purchasing systems can be obtained by calculating their purchasing efficiencies. Purchasing efficiency is defined as: Hand-to-mouth average - average achieved x loo ’ Hand-to-mouth average - hindsight average The objective of any purchasing system is to do befter than the hand-to-mouth average, and to bridge as much of the gap as possible between this and the hindsight average. To achieve the hand-to-mouth average, therefore, rates zero efficiency; to achieve the hindsight average rates 100% efficiency.
A Heuristic approachto commoditypurchasing
119
The purchasing efficiencies based on DP model alone and also on the combined approach are calculated as follows: (1) DP model alone “” -_ 57*2 Purchasing efficiency = 5r30 53.6 x 100= 18.2%. (2) Combined approach 58.0-_ 53.6 55.8 x too = 50%. Purchasing efficiency = 58.0
SENSITIVITY
ANALYSIS
To test the consistency of the results obtained by following the combined approach, a sensitivity analysis has been carried out by changing the maximum cover. Assuming the maximum cover to be 12, 24 and 36 weeks, the average prices corresponding to the hindsight, DP model and the combined approach are found to be as follows:
Maximum cover
Hindsight average
DP model average
Combined approach average
12 24 36
52.0 49.6 48.6
55.8 54.2 53.0
54.4 52.4 50.3
The purchasing efficiencies corresponding to the above average prices are given as follows:
Maximum cover
DP model efficiency
Combined approach efficiency
12 24 36
36.7% 45.2% 53.2%
60% 66.7% 81.9%
The above results clearly demonstrate the following: (1) If the price trends, upward or downward, for a commodity persist for a number of consecutive periods before being reversed, the performance of the DP model alone is poor; (2) The performance of the combined approach is consistently better compared to that of DP model. CONCLUSIONS
The most efficient purchasing policy system can be designed only with the help of perfect hindsight information. Unfortunately, it is not possible to have complete hindsight information built in the system. But while designing a purchasing system an attempt should be made to see that it can take care of as much of hindsight information as possible. The combined approach as described in this paper attempts to make use of hindsight information, to some extent, by incorporating price trend effects into the system. The approach described here is highly efficient and simple to use even by a layman. It is hoped that this approach can be fruitfully utilized in designing purchasing systems for commodities having persistent price trend effects. Of course, the purchasing policy graph could be drawn assuming any standard distributions (e.g. a uniform distribution), depending upon the situations. Similarly, different nomograms (based on different values of smoothing constant) could be used.
s. B.
I20
LAHIRI
Acknowledgements-(l) To two of my anonymous referees for their constructive suggestions which have resulted in a significant improvement in the earlier version of this paper. (2) To the Directors of the company for allowing me to publish this uaper. (3) To Mr. Thomas N. Osterland (Mananer, Man~ement Services Division) for aivina me an opportunity to work in this project and also for his u~ud~ng help which I had from time to time. (4)-To all my coliegues in. the Management Services Division for their help and encouragement. REFERENCES I. T. Fabian. J. L. Fisher. H. W. Sasieni and A. Yardeni. Purchasing Raw Material on a Fluctuating Market, Ops. Res. 8. 187-122 (1959). 2. B. G. Kingsman, Commodity Purchasing, Ops Res. Q. 20.59-79 (1%9). 3. D. J. White, Dynamic Programming,Oliver & Boyd, London (1%9). APPENDIX
I: CALCULATION FOLLOWING THE
OF THE OPTIMAL PURCHASlNG QUANTITIES HEURISTIC APPROACH AND DP MODEL
Notes on Appendix 1:
(1) Colnmn No. Description I Weeks 2 3 4 5 6 7
Price per unit Price trend Opening cover Cover to be achieved after purchase Weeks cover bought according to the heuristic Policy Weeks cover bought according to the DP Policy.
APPENDIX (1): Calculation of the optimal purchasing quantities following the Heuristic approach and DP model Columns I 2 3 45 6 7 1 2 3 45 6 7 1 2 3 4 5 6 7 8 9 10
41.88 42.00 43.00 43.58 44.25 44.50 46.88 48.88 51.25 52.50
+0.3 +Q.5 +0.7 +8.6 to.6 +8.5 +8.8 +1.2 +1.8 +1.7
11
52.25
+1.1
0,o
8
8
7 6 5 5 5 4 4 3 2 3 2 2 2 2 2 2 2 2 2 2 2 1 1
10 10 10 1 1 10 11
1 1 1 l 1 1 1 1 1 1 1 1 1 1 1 1 l I I 1 1 1 i 1
11 11 11 11 11 11 11 11 8 0 0 0 0 0 0 0 11
12
53.50
+1.1
13 14 15 16 17 18 19 '20 21
53.75 54.75 55.75 57.00 56.50 55.00 54.75 56.50
+0.9 M.8 +1.0 +0.6 +0,8 +0.5 +O.l +a0 +0.2
22
57.88
ti.4
23 24
58.50 60.00
W.7 +0.9
7,7 7,6 7,5 7,4 7.4 7,4 7,3 7,3 7,2 7,l 7,2 7,l 7,l 7,l 7,l 7,l 7,l 7.1 7,l 7,1 7,l 7,l 6,O
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
82.50 80.50 74.00 74.00 73.00 73.00 72.00 72.50 75.25 75.50 77.50 82.50 87.75 87.75 92.50 95.00 97.00 101.00 99.00 101.75 106.00 107.75 107.25 102.50
+1*0 N.1 -1.9 -1.3 -1.2 -0.9 -0.9 -0.5 +0.5 +0.4 w.9 +2.1 +3-o +212 +2.9 +2.8 r1.6 +3.0 +1.!i +1.6 +2.7 +2.4 +I.6 -0.4
0,o 0‘0 0,o 0,o 0‘0 0,o 0,o 0,o 0,o 7,0 6.0 5,0 4,o 3,0 2,0 l,O 0,o 0,o 0,o 0,e 0,o 0,o 0,o 0‘0
56.00
8
1
0 ! 1 IO i 11 11 11 11 11 11 : 0 0
:
2" I 1
1 1 0 1
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 73 74 75 76
; ; 1 1 l l 1 I
z 79 80 81 82 z 85 86 87 88 89 90 91
; 11
;
zt 94
:
!
;z
59.50
+8.5
5.01
0
I
60.75 61.50 61.50 61.50 64.25 67.50 60.75 69.25 67.00 65.00 63.50 68.50 70.25 69.50 70.25 73.00 75.00 76.00 76.50 78.50 81.25 82.00 80.50
+0.7 +0.8 +O.S +0.4 e.1 +1.7 +1.6 t1.3 +0.6 WI.2 +O.o +l.l +I.2 +0,8 il.5 +1.1 +1.4 +I.3 to.9 t1.4 +I.8 +1.2 W.6
4;o 3,o 2,0 l,O 0,o 0,o 0,o 0,o 0,o 0,o 0,o 0,o 0,o 0,o 0,o 0,o 0,o 0,o 0,o 0,o 0,o 0,o 0,o
1 1 1 1 l 1 1 1 1 I 1 1 l 1 1 1 1 1 1 1 1 1 1
0 0 0 0
1 1 1 1 1 1 1
89.25 84.00 80.50 80,25 74.50 71.60 68.50 65.20 65.50 66.75 69.75 68.25 68.25 64.75 62.00 53.25 50.50 48.50 49.75 49.75 49.50 49.75 46.00 48.50
-4.2 -4.6 -4.2 -2.7 -4.0 -3.7 -3.7 -3.5 -2.4 -1.3 -0.1 -0.4 -0.3 -1.3 -1.7 -3.8 -3.6 -3.0 -1.7 -1.2 -1.0 -0.6 -1.5 -0.9
0,o 0,o 0,o 0,o 0,o 0,o 0,o 0,o 0,o 0,o 0,o 0,o 0‘0 OS0 0.0 0,o 1,l 2,2 2,2 2.2 2,2 2,2 2,2 3,3
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 3 3 3 3 3 3 4 3
1 1 1 1 1 1 1 1
1 : 1
1 I 1 1 1 1 1 1 1 1 1 1, 1 1 1
i 1 1 1 1
; 1 1 I 1 1 1 1 1 1 1 ; 1 1 1 1 1 1 1 1 1 1 1 I : 1 1
: 2 1 1 1
: 2 1
1' 2 0
i 2 0
!
A Heuristic
121
approachtocommodity purchasing Appendix(l) Cont. C&mm
3
12
45
6
7
12
1 1 1 2 1 2 2
121 122 123 124
3 3 3 4 4 5 6 6 7 a 6 6 6 5 5 4 4 4 4 4 3 3 3 4
1 1 1 2 1 2 2 1 2 2 0 0 1 3 1 1 1 1 1 1 1 1 1 0
105 106 107 108 109 110 111 112 113 114 I15 116 117 118 119 120
42.50 41.00 42.50 43.00 43.00 43.50 44.25 45.75 46.50 47.00 47.50 48.25 49.50 50.25 48.75 47.25
-0.8 -0.9 -0.4 -0.2 +O.o w.2 +0.3 +0.7 +0.7 +0.7 +0.6 +0.6 +0.8 +0.8 +O.l -0.4
2,2 2,2 2,2 2.2 3,3 3,3 4,4 $5 5,5 6,6 7,7 6,6 5,s 5,5 7,4 7,4 7,3 7,3 7,3 7,3 7,3 7,2 7,2 7,2
145 146 147 148 149 150 151 152 153 151 155 156 157 158 159 160 161 162 163 164 165 166 167 168
45.50 44.00 43.75 43.25 44.00 44.25 44.00 43.25 43.00 43.00 43.50 44.00 44.00 45.00 46.00 45.75 44.50 44.75 45.00 46.00 47.00 48.50 49.50 50.50
-0.4 -0.7 -0.6 -0.6 -0.1 -0.t w.0 -0.3 -0.3 -0.2 +O.o w.2 +O.i +0.4 +0.5 +0.3 +0.1 +O.o +O.o +0.3 +0.5 NJ.7 +0.9 +1.0
3,3 3,3 4,4 4,4 5,5 4,4 4,4 4,4 5.5 5,s 5,5 4,4 7,4 7,4 7,4 7,3 7,3 7,4 7,4 7,4 7,3 7,3 7,2 7,2
4 5 5 6 5 5 5 6 6 6 5 5 5 5 4 4 5 5 5 4 4 3 3 3
1 2 1 2 0 1 1 2 1 1 0 4 1 1 1 1 1 1 1 I I 1 1 1
1 2 1 2 0 1 1 2 1 1 0
193 194 195 1% 197 198 199 200 201 202 203 204 205 206 207 2m
55.75 53.25 53.00 52.25 50.75 45.50 44.50 43.50 44.00 46.00 45.00 44.50 44.00 44,25 45.00 46.00
-0.7 -1.: -1.0 -0.9 -1.1 -2.3 -1.9 -1.6 -1.0 -0.1 -0.4 -0.4 -0.4 -0.2 -0.1 +0.3
1,l I,1 I,1 1,l 2,2 2‘2 3,3 4,4 4.4 4,4 3,3 4,4 4,4 3,3 2,2 1,l
2 2 2 3 3 4 5 5 5 4 5 5 5 5 5 4
1 1 1 2 1 2 2 1 1 0 2 1 0 0 0 0
1 1 1 2 1 2 2 1 1 0 2 1 0 0 0 0
97
48.50
-0.5
98 99 loo 101 102 103
50.00 49.00 46-W 45.50 44.50 43.00
-0.1 -0.5 -1.0 -0.9 -0.9 -1.1
104 43.00
-0.8
: 2 0 0 1 0 1 0 1 1 1 1 0 1 1 2
; 1 0 1 2 1 1 0 1 0 1 1
3
45
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 14.4
46.75 45.50 45.00 45.50 45.75 45.00 43.50 42.00 42.00 42.00 44.00 45.25 46.50 46.75 47.50 47.75 48.00 49.50 50.00 47.50 48.00 46.75 46.00 46.00
-0.4 -0.6 -0.6 -0.3 -0.1 -0.3 -0.7 -0.9 -0.6 -0.4 +0.2 +0.6 N.8 +0.6 +0.7 +0.5 +0.5 +0.8 +0.7 -0.3 -0.1 -0.4 -0.5 -0.4
6,3 5,3 4,3 4,4 3,3 3,3 4,4 4‘4 6,6 6,6 6,6 7,5 7,4 7,3 7,3 7,3 7,3 7,3 7,2 7,2 6,3 5,3 4,3 3,3
4 4 5 4 4 5 5 7 7 7 5 5 4 4 4 4 4 3 3 4 4 4 4 4
169 170 171 172 173 174 175 176 177 1fB 179 180 181 182 183 18.4 185 186 187 188 189 19'3 191 192
52.W 51.75 53.50 56.50 58.00 57.00 56.75 56.25 55.50 55.50 55.50 56.25 57.50 58.10 59.00 63.50 63.50 61.25 61.50 61.00 59.00 59.25 57.25 56.00
+l.l +0.7 +1.0 +1.6 +1.6 N.8 +0.5 +0.2 +O.o *.a '+O.O +0.2 +0.5 +0.6 +0.7 +I.8 +1.3 +0.2 +0.2 +O.O -0.6 -0.4 -0.8 -1.0
7,2 7,2 7,2 7,1 7,l b,O 7,1 7,1 7,1 7,l 7,; 7,1 7,1 7,1 6,0 5,0 4,o 3,0 2,0 1,o 0‘0 0,o 0,o 1,l
3 3 2 2 1 2 2 2 2 2 2 2 2 1 1 1 1 1 I 1 1 1 2 2
125
6
7
0 0 1 0 1 2
1 1 2 0 1 2 1 3 1 1 0 0 0 1 1 1 1 0 1 2 1 1
: 1 1 2 1 1 1 1 1 1 I 1 0 0 0 0 1 1 1 1 1 0 2 1 1 1 1 1 ! 0 : 0 0 0 0 1 1 2 1
: 1 1 0 1 0 2 I 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 2 1
(2)The tirst &we in Column 4 represents opening cover corresponding to the Heuristic approach whik the second figure represents that for DP policy. (3) Column 5 represents the cover to be achievedafter purchase based on the optimal purchasing policy graph given in FM. 1. According to DP policy, a purchase is made only if the opening cover corresponding to any week is kss than that indicated by this column. In case of the Heuristic approach, a purchase is made according to the conditions (3x6) as stated on pages 151-3.
CAOR Vol. 5. No. 2-c
122
s. Et. LAHIRI
(4) Whiie according to both the Heuristic approach and the DP policy we should have bought in each of the las! 4 periods