Question 7 of 8: Dynamic Programming — Patrol Car Allocation
Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)
Notes on this paper
National Exams — May 2016 — 98-Ind-A1 Operations Research. Three-hour, open-book exam (any non-communicating calculator permitted); the paper totals 160 marks across 8 questions (each worth 20) and only 100 marks are required, so a candidate would normally answer 5 — all eight are solved below for completeness.
Reference texts: Hillier & Lieberman, Introduction to Operations Research (11th ed., McGraw-Hill) — linear programming and the revised simplex method (ch. 3–5), network optimization models (ch. 9), integer programming (ch. 12), decision analysis (ch. 16), and queueing theory (ch. 17).
Question 7: Dynamic Programming — Patrol Car Allocation (20 marks)
Given. 5 patrol cars to allocate among 3 precincts; expected crimes as a function of cars assigned, per precinct (table below).
Given data — crimes vs. cars assigned
Precinct
0 cars
1
2
3
4
5
1
25
17
10
4
1
0
2
36
27
20
14
12
11
3
30
20
12
8
6
5
Find. The allocation $(x_1,x_2,x_3)$ with $x_1+x_2+x_3=5$ that minimizes total crimes, solved by (backward) dynamic programming.
Fig. 7 — DP as a shortest-path network: both tied optimal allocations, $(1,2,2)$ and $(2,1,2)$, are shown converging to the same minimum-crime path (total 49).
Approach. Treat "cars remaining to allocate" as the DP state and the precincts as three stages; solve backward from precinct 3 to precinct 1, at each state keeping the best crime total for every possible number of cars still available.
Stage 3 (last precinct). With $s$ cars left to give entirely to precinct 3, the best choice is always to use all of them (crimes strictly decrease with more cars): $f_3(s)=\text{crimes}_3(s)$.
$f_3(s)$
s
0
1
2
3
4
5
$f_3(s)$
30
20
12
8
6
5
Stage 2.$f_2(s)=\min_{0\le x_2\le s}\big[\text{crimes}_2(x_2)+f_3(s-x_2)\big]$, evaluated for every $s=0,\dots,5$:
$$f_2(5)=\min\{36{+}5,\,27{+}6,\,20{+}8,\,14{+}12,\,12{+}20,\,11{+}30\}=\min\{41,33,28,26,32,41\}=\boxed{26}\ \text{at } x_2=3.$$
The full table (needed because stage 1 can hand stage 2 any leftover from 0 to 5):
$f_2(s)$ and best $x_2$
s
0
1
2
3
4
5
$f_2(s)$
66
56
47
39
32
26
best $x_2$
0
0
1
1
2
3
Stage 1 (all 5 cars).$f_1(5)=\min_{0\le x_1\le 5}\big[\text{crimes}_1(x_1)+f_2(5-x_1)\big]$:
$$\min\{25{+}26,\ 17{+}32,\ 10{+}39,\ 4{+}47,\ 1{+}56,\ 0{+}66\}=\min\{51,49,49,51,57,66\}=\boxed{49}.$$
The minimum is tied at $x_1=1$ (giving $17+f_2(4)=17+32=49$) and $x_1=2$ (giving $10+f_2(3)=10+39=49$).
Recover both optimal policies. For $x_1=1$: remaining $s=4\Rightarrow x_2=2$ (from the stage-2 table), remaining $s=2\Rightarrow x_3=2$, giving $(x_1,x_2,x_3)=(1,2,2)$, crimes $17+20+12=49$. For $x_1=2$: remaining $s=3\Rightarrow x_2=1$, remaining $s=2\Rightarrow x_3=2$, giving $(2,1,2)$, crimes $10+27+12=49$. Both use all 5 cars and both are optimal.