Вы находитесь на странице: 1из 5

Dynamic Programming

1. A firm has divided its marketing area into three zones. The amount of sales depends on the number of salesmen in each zone. The firm has the data on the number of salesmen and sales over a period of time. This is given below. The firm has a total of nine salesmen and the problem is to allocate these salesmen to different zones so that the sales are maximum.

 Number of salesmen Zone I Zone II Zone III 0 30 35 42 1 45 45 54 2 60 52 60 3 70 64 70 4 79 72 82 5 90 82 95 6 98 93 102 7 105 98 110 8 100 100 110 9 90 100 110

Stage 1: we start with the first zone write the number of salesmen and sales

No of
0
1
2
3
4
5
6
7
8
9
salesmen
Sales
30
45
60
70
79
90
98
105
100
90
Stage 2: Now consider the first two zones. Nine salesmen can be deployed in these two zones in ten different ways.
Zone 1
0
1
2
3
4
5
6
7
8
9
Zone 2
30
45
60
70
79
90
98
105
100
90
0
35
65
80
95
105
114
125
133
140
135
125
1
45
75
90
105
115
124
135
143
150
145
2
52
82
97
112
122
131
142
150
157
3
64
94
109
124
134
143
154
162
4
72
102
117
132
142
151
162
5
82
112
127
142
152
161
6
93
123
138
153
163
7
98
128
143
158
8
100
130
145
9
100
130

Stage 3: See the allocation with the highest sales and prepare the allocations for the third zone accordingly

 Zone 1+2 0 1 2 3 4 5 6 7 8 9 Zone 2 65 80 95 105 115 125 135 143 154 163 0+0 1+0 2+0 3+0 3+1 5+0 5+1 6+1 5+3 3+6 2+1 4+3 0 42 107 122 137 147 157 167 177 185 196 205 1 54 119 134 149 159 169 179 189 197 208 2 60 125 140 155 165 175 185 195 203 3 70 135 150 160 175 185 195 205 4 82 147 162 177 187 197 207 5 95 150 175 190 200 210 6 102 167 182 197 207 7 110 175 190 205 8 110 175 190 9 110 175

Example 2: The owner of four grocery stores has purchased six crates of fresh strawberries. The following table gives the estimated profits at each store when it is allocated different number of boxes. Find the allocation to the stores so that the profits are maximized.

 Stores 1 2 3 4 Number of 0 0 0 0 0 Boxes 1 4 2 6 2 2 6 4 8 3 3 7 6 8 4 4 7 8 8 4 5 7 9 8 4 6 7 10 8 4

Step 1: Allocate between store 1 and 2

 Store 1 0 1 2 3 4 5 6 Store 2 0 4 6 7 7 7 7 0 0 0* 4* 6* 7 7 7 7 1 2 2 6* 8* 9 9 9 2 4 4 8* 10* 11 11 3 6 6 10* 12* 13 4 8 8 12* 14* 5 9 9 10 6 10 10 Step 2: Allocate between store (1+2) and 3 Store 0 1 2 3 4 5 6 1+2 Store 3 0 4 6 8 10 12 14 0+0 1+0 2+0 2+1 2+2 2+3 2+4 1+1 1+2 1+3 1+4 0 0 0* 4 6 8 10 12 14 1 6 6* 10* 12* 14* 16* 18* 2 8 8 12* 14* 16* 18* 3 8 8 12 14 16 4 8 8 12 14 5 8 8 12 6 8 8

Step 3: Allocate between store (1+2+3) and 4

 Store 0 1 2 3 4 5 6 1+2+3 Store 4 0 6 10 12 14 16 18 0+0+0 0+0+1 1+0+1 1+0+2 2+0+2 2+1+2 2+2+2 2+0+1 1+1+2 1+2+2 1+3+2 1+1+1 2+1+1 2+2+1 2+3+1 1+2+1 1+3+1 1+4+1 0 0 0 6 10 12 14 16 18* 1 2 2 8 12 14 16 18* - 2 3 3 9 13 15 17 - - 3 4 4 10 14 16 - - - 4 4 4 10 14 - - - - 5 4 4 10 - - - - - 6 4 4 - - - - - So optimal allocation is X1 X2 X3 X4 Profit 2 1 2 1 18 1 2 2 1 18 2 2 1 1 18 1 3 1 1 18 2 2 2 0 18 1 3 2 0 18 2 3 1 0 18 1 4 1 0 18