Dynamic programming order sequencing

A question is this type if and only if it asks to determine the optimal order in which to complete a fixed set of tasks (building houses, renovating properties) where costs depend on what has already been completed.

13 questions · Moderate -0.4

Sort by: Default | Easiest first | Hardest first
Edexcel D1 Q2
7 marks Moderate -0.8
2. This question should be answered on the sheet provided. A builder is going to put up houses on a plot of land of area \(12000 \mathrm {~m} ^ { 2 }\).
There are 5 designs to choose from and no more than one of each design can be built.
DesignKendalMilvertonArlingtonElfordGrosvenor
Plot area ('000 \(\mathrm { m } ^ { 2 }\) )3113510
Value ( \(\pounds ^ { \prime } 000 \mathrm {~s}\) )1001904080120
The builder needs to work out which houses he should build in order to maximise the total value of the site. He does this using a tree diagram and each "branch" on the tree is terminated when the total area of land on that branch exceeds \(12000 \mathrm {~m} ^ { 2 }\).
    1. Complete the tree diagram so that each branch is terminated or all choices have been considered.
    2. Hence, determine which designs the builder should use and the total value that the site will have when completed.
  1. Explain how this method could be altered if more than one of each design is allowed.
AQA D2 2011 June Q6
9 marks Moderate -0.5
6 Bob is planning to build four garden sheds, \(A , B , C\) and \(D\), at the rate of one per day. The order in which they are built is a matter of choice, but the costs will vary because some of the materials left over from making one shed can be used for the next one. The expected profits, in pounds, are given in the table below.
\multirow{2}{*}{Day}\multirow{2}{*}{Already built}Expected profit (£)
\(\boldsymbol { A }\)\(\boldsymbol { B }\)\(\boldsymbol { C }\)\(\boldsymbol { D }\)
Monday-50657080
\multirow{4}{*}{Tuesday}A-728384
B60-8083
C5768-85
D627081-
\multirow{6}{*}{Wednesday}\(\boldsymbol { A }\) and \(\boldsymbol { B }\)--8488
\(\boldsymbol { A }\) and \(\boldsymbol { C }\)-71-82
\(A\) and \(D\)-7483-
\(\boldsymbol { B }\) and \(\boldsymbol { C }\)65--86
\(\boldsymbol { B }\) and \(\boldsymbol { D }\)69-85-
\(\boldsymbol { C }\) and \(\boldsymbol { D }\)6673--
\multirow{4}{*}{Thursday}\(\boldsymbol { A } , \boldsymbol { B }\) and \(\boldsymbol { C }\)---90
\(\boldsymbol { A } , \boldsymbol { B }\) and \(\boldsymbol { D }\)--87-
\(A , C\) and \(D\)-76--
\(\boldsymbol { B } , \boldsymbol { C }\) and \(\boldsymbol { D }\)70---
By completing the table of values opposite, or otherwise, use dynamic programming, working backwards from Thursday, to find the building schedule that maximises the total expected profit.
Stage (Day)State (Sheds already built)Action (Shed to build)CalculationProfit in pounds
Thursday\(A , B , C\)D90
\(A , B , D\)C87
A, C, DB76
B, C, DA70
WednesdayA, BC\(84 + 90\)174
D\(88 + 87\)175
A, \(C\)B\(71 + 90\)161
D\(82 + 76\)158
A, \(D\)B
C
\(B , C\)A
D
\(B , D\)A
C
\(C , D\)A
B
TuesdayAB\(72 + 175\)247
C\(83 + 161\)244
D
Monday
\section*{Schedule}
\cline { 2 - 5 } \multicolumn{1}{c|}{}MondayTuesdayWednesdayThursday
Shed to build
\includegraphics[max width=\textwidth, alt={}]{1aca4e91-d1b3-4a78-8880-e42a4fbf3ddb-18_2486_1714_221_153}
Edexcel D2 2011 June Q7
13 marks Moderate -0.5
7. Patrick is to take orders for his company's products. He will visit four countries over the next four weeks.
He will visit just one country each week.
He will leave from his office in London and will only return there after visiting the four countries.
He will travel directly from one country to the next.
He wishes to determine a schedule of four countries to visit. Table 1 shows the countries he could visit in each week. \begin{table}[h]
WeekWeek 1Week 2Week 3Week 4
Possible countriesA or BC, D or EF or GH or I
\captionsetup{labelformat=empty} \caption{Table 1}
\end{table} Table 2 shows the value of the orders, in \(\pounds 100\) s, he expects to take in each country. \begin{table}[h]
CountryABCDEFGHI
Value of expected orders in \(\pounds 100\) s221742413929273638
\captionsetup{labelformat=empty} \caption{Table 2}
\end{table} Table 3 shows the cost, in \(\pounds 100\) s, of travelling between the various countries. \begin{table}[h]
Travel costs in £100sABCDEFGHI
London5354
A542
B443
C65
D63
E44
F67
G56
\captionsetup{labelformat=empty} \caption{Table 3}
\end{table} The expected income is the value of the expected orders minus the cost of travel. It is decided to use dynamic programming to find a schedule that maximises the total expected income for these four weeks.
  1. Complete the table in the answer book to determine the optimal expected income.
  2. State Patrick's two optimal schedules.
Edexcel D2 2013 June Q7
13 marks Standard +0.8
7. Nigel has a business renting out his fleet of bicycles to tourists. At the start of each year Nigel must decide on one of two actions:
  • Keep his fleet of bicycles, incurring maintenance costs.
  • Replace his fleet of bicycles.
The cost of keeping the fleet of bicycles, the cost of replacing the fleet of bicycles and the annual income are dependent on the age of the fleet of bicycles.
Table 1 shows these amounts, in \(\pounds 1000\) s. \begin{table}[h]
Age of fleet of bicyclesnew1 year old2 years old3 years old4 years old
Cost of keeping (£1000s)01238
Cost of replacing (£1000s)-78910
Income (£1000s)118520
\captionsetup{labelformat=empty} \caption{Table 1}
\end{table} Nigel has a new fleet of bicycles now and wishes to maximise his total profit over the next four years. He is planning to sell his business at the end of the fourth year.
The amount Nigel will receive will depend on the age of his fleet of bicycles.
These amounts, in £1000s, are shown in Table 2. \begin{table}[h]
Age of fleet of bicycles
at end of 4th year
1 year
old
2 years
old
3 years
old
4 years
old
Amount received at end
of 4th year \(( \pounds 1000 \mathrm {~s} )\)
6421
\captionsetup{labelformat=empty} \caption{Table 2}
\end{table} Complete the table in the answer book to determine Nigel's best strategy to maximise his total profit over the next four years. You must state the action he should take each year (keep or replace) and his total profit.
(Total 13 marks)
OCR D2 2011 January Q5
18 marks Moderate -0.5
5 A card game between two players consists of several rounds. In each round the players both choose a card from those in their hand; they then show these cards to each other and exchange tokens. The number of tokens that the second player gives to the first player depends on the colour of the first player's card and the design on the second player's card. The table shows the number of tokens that the first player receives for each combination of colour and design. A negative entry means that the first player gives tokens to the second, zero means that no tokens are exchanged. Let the stages be \(0,1,2,3,4,5\). Stage 0 represents arriving at the sanctuary entrance. Stage 1 represents visiting the first bird, stage 2 the second bird, and so on, with stage 5 representing leaving the sanctuary. Let the states be \(0,1,2,3,4\) representing the entrance/exit, kite, lark, moorhen and nightjar respectively.
  1. Calculate how many minutes it takes to travel the route $$( 0 ; 0 ) - ( 1 ; 1 ) - ( 2 ; 2 ) - ( 3 ; 3 ) - ( 4 ; 4 ) - ( 5 ; 0 ) .$$ The friends then realise that if they try to find the quickest route using dynamic programming with this (stage; state) formulation, they will get the route \(( 0 ; 0 ) - ( 1 ; 1 ) - ( 2 ; 2 ) - ( 3 ; 3 ) - ( 4 ; 1 ) - ( 5 ; 0 )\), or this in reverse, taking 27 minutes.
  2. Explain why the route \(( 0 ; 0 ) - ( 1 ; 1 ) - ( 2 ; 2 ) - ( 3 ; 3 ) - ( 4 ; 1 ) - ( 5 ; 0 )\) is not a solution to the friends' problem. Instead, the friends set up a dynamic programming tabulation with stages and states as described above, except that now the states also show, in brackets, any birds that have already been visited. So, for example, state \(1 ( 234 )\) means that they are currently visiting the kite and have already visited the other three birds in some order. The partially completed dynamic programming tabulation is shown opposite.
  3. For the last completed row, i.e. stage 2, state 1(3), action 4(13), explain where the value 18 and the value 6 in the working column come from.
  4. Complete the table in the insert and hence find the order in which the birds should be visited to give a quickest route and find the corresponding minimum journey time.
    StageStateActionWorkingSuboptimal minimum
    \multirow{4}{*}{4}1(234)01010
    2(134)01414
    3(124)01212
    4(123)01717
    \multirow{12}{*}{3}1(23)4(123)\(17 + 6 = 23\)23
    1(24)3(124)\(12 + 2 = 14\)14
    1(34)2(134)\(14 + 3 = 17\)17
    2(13)4(123)\(17 + 4 = 21\)21
    2(14)3(124)\(12 + 2 = 14\)14
    2(34)1(234)\(10 + 3 = 13\)13
    3(12)4(123)\(17 + 3 = 20\)20
    3(14)2(134)\(14 + 2 = 16\)16
    3(24)1(234)\(10 + 2 = 12\)12
    4(12)3(124)\(12 + 3 = 15\)15
    4(13)2(134)\(14 + 4 = 18\)18
    4(23)1(234)\(10 + 6 = 16\)16
    \multirow{12}{*}{2}1(2)3(12) 4(12)\(20 + 2 = 22\)21
    1(3)2(13) 4(13)\(21 + 3 = 24 18 + 6 = 24\)24
    1(4)
    2(1)
    2(3)
    2(4)
    3(1)
    3(2)
    3(4)
    4(1)
    4(2)
    4(3)
    \multirow{4}{*}{1}1
    2
    3
    4
    00
    1
    2
    3
    4
Edexcel D2 Q2
10 marks Moderate -0.3
2. This question should be answered on the sheet provided. A pool player is to play in four tournaments. Some of the tournaments take place simultaneously and the player has to choose one of each of the following: $$\begin{array} { l l } 1 ^ { \text {st } } \text { tournament: } & A , B \text { or } C , \\ 2 ^ { \text {nd } } \text { tournament: } & D , E \text { or } F , \\ 3 ^ { \text {rd } } \text { tournament: } & G , H \text { or } I , \\ 4 ^ { \text {th } } \text { tournament: } & J , K \text { or } L \end{array}$$ Each tournament has six rounds and the player estimates how well he will do in each tournament based on which tournament he plays before it. The table below shows his expectations with each number indicating the round he expects to reach and a "7" indicating he expects to win the tournament.
\multirow{2}{*}{}Expected performance in tournament
ABC\(D\)E\(F\)\(G\)\(H\)IJ\(K\)\(L\)
\multirow{10}{*}{Previous tournament}None533
A637
B554
C755
D533
E356
\(F\)365
G241
H322
\(I\)253
He wishes to choose the tournaments such that his worst performance is as good as possible. Use dynamic programming to find which tournaments he should play.
(10 marks)
OCR D2 2011 January Q6
13 marks Moderate -0.5
6 Answer this question on the insert provided. Four friends have decided to sponsor four birds at a bird sanctuary. They want to construct a route through the bird sanctuary, starting and ending at the entrance/exit, that enables them to visit the four birds in the shortest possible time. The table below shows the times, in minutes, that it takes to get between the different birds and the entrance/exit. The friends will spend the same amount of time with each bird, so this does not need to be included in the calculation.
Entrance/exitKiteLarkMoorhenNightjar
Entrance/exit-10141217
Kite10-326
Lark143-24
Moorhen1222-3
Nightjar17643-
Let the stages be \(0,1,2,3,4,5\). Stage 0 represents arriving at the sanctuary entrance. Stage 1 represents visiting the first bird, stage 2 the second bird, and so on, with stage 5 representing leaving the sanctuary. Let the states be \(0,1,2,3,4\) representing the entrance/exit, kite, lark, moorhen and nightjar respectively.
  1. Calculate how many minutes it takes to travel the route $$( 0 ; 0 ) - ( 1 ; 1 ) - ( 2 ; 2 ) - ( 3 ; 3 ) - ( 4 ; 4 ) - ( 5 ; 0 ) .$$ The friends then realise that if they try to find the quickest route using dynamic programming with this (stage; state) formulation, they will get the route \(( 0 ; 0 ) - ( 1 ; 1 ) - ( 2 ; 2 ) - ( 3 ; 3 ) - ( 4 ; 1 ) - ( 5 ; 0 )\), or this in reverse, taking 27 minutes.
  2. Explain why the route \(( 0 ; 0 ) - ( 1 ; 1 ) - ( 2 ; 2 ) - ( 3 ; 3 ) - ( 4 ; 1 ) - ( 5 ; 0 )\) is not a solution to the friends' problem. Instead, the friends set up a dynamic programming tabulation with stages and states as described above, except that now the states also show, in brackets, any birds that have already been visited. So, for example, state \(1 ( 234 )\) means that they are currently visiting the kite and have already visited the other three birds in some order. The partially completed dynamic programming tabulation is shown opposite.
  3. For the last completed row, i.e. stage 2, state 1(3), action 4(13), explain where the value 18 and the value 6 in the working column come from.
  4. Complete the table in the insert and hence find the order in which the birds should be visited to give a quickest route and find the corresponding minimum journey time.
    StageStateActionWorkingSuboptimal minimum
    \multirow{4}{*}{4}1(234)01010
    2(134)01414
    3(124)01212
    4(123)01717
    \multirow{12}{*}{3}1(23)4(123)\(17 + 6 = 23\)23
    1(24)3(124)\(12 + 2 = 14\)14
    1(34)2(134)\(14 + 3 = 17\)17
    2(13)4(123)\(17 + 4 = 21\)21
    2(14)3(124)\(12 + 2 = 14\)14
    2(34)1(234)\(10 + 3 = 13\)13
    3(12)4(123)\(17 + 3 = 20\)20
    3(14)2(134)\(14 + 2 = 16\)16
    3(24)1(234)\(10 + 2 = 12\)12
    4(12)3(124)\(12 + 3 = 15\)15
    4(13)2(134)\(14 + 4 = 18\)18
    4(23)1(234)\(10 + 6 = 16\)16
    \multirow{12}{*}{2}1(2)3(12) 4(12)\(20 + 2 = 22\)21
    1(3)2(13) 4(13)\(21 + 3 = 24 18 + 6 = 24\)24
    1(4)
    2(1)
    2(3)
    2(4)
    3(1)
    3(2)
    3(4)
    4(1)
    4(2)
    4(3)
    \multirow{4}{*}{1}1
    2
    3
    4
    00
    1
    2
    3
    4
AQA D2 2006 January Q2
9 marks Moderate -0.8
2 A manufacturing company is planning to build three new machines, \(A , B\) and \(C\), at the rate of one per month. The order in which they are built is a matter of choice, but the profits will vary according to the number of workers available and the suppliers' costs. The expected profits in thousands of pounds are given in the table.
\multirow[b]{2}{*}{Month}\multirow[b]{2}{*}{Already built}Profit (in units of £1000)
\(\boldsymbol { A }\)\(\boldsymbol { B }\)\(\boldsymbol { C }\)
1-524748
\multirow[t]{3}{*}{2}A-5854
B70-54
\(\boldsymbol { C }\)6863-
\multirow[t]{3}{*}{3}\(\boldsymbol { A }\) and \(\boldsymbol { B }\)--64
\(\boldsymbol { A }\) and \(\boldsymbol { C }\)-67-
\(\boldsymbol { B }\) and \(\boldsymbol { C }\)69--
  1. Draw a labelled network such that the most profitable order of manufacture corresponds to the longest path within that network.
  2. Use dynamic programming to determine the order of manufacture that maximises the total profit, and state this maximum profit.
AQA D2 2007 June Q5
10 marks Moderate -0.5
5 [Figure 3, printed on the insert, is provided for use in this question.]
A maker of exclusive furniture is planning to build three cabinets \(A , B\) and \(C\) at the rate of one per month. The order in which they are built is a matter of choice, but the costs will vary because of the materials available and suppliers' costs. The expected costs, in pounds, are given in the table.
\multirow[t]{2}{*}{Month}\multirow[t]{2}{*}{Already built}Cost
\(\boldsymbol { A }\)B\(\boldsymbol { C }\)
1-500440475
2A-440490
B510-500
\(\boldsymbol { C }\)520490-
3\(\boldsymbol { A }\) and \(\boldsymbol { B }\)--520
\(\boldsymbol { A }\) and \(\boldsymbol { C }\)-500-
\(\boldsymbol { B }\) and \(\boldsymbol { C }\)510--
  1. Use dynamic programming, working backwards from month 3, to determine the order of manufacture that minimises the total cost. You may wish to use Figure 3 for your working.
  2. It is discovered that the figures given were actually the profits, not the costs, for each item. Modify your solution to find the order of manufacture that maximises the total profit. You may wish to use the final column of Figure 3 for your working.
AQA D2 2012 June Q5
10 marks Moderate -0.8
5 Dave plans to renovate three houses, \(A , B\) and \(C\), at the rate of one per year. The order in which they are renovated is a matter of choice, but some costs vary over the three years. The expected costs, in thousands of pounds, are given in the table below. (b)
YearAlready renovatedHouse renovatedCalculationValue
3\(A\) and \(B\)C
\(A\) and \(C\)B
\(B\) and \(C\)A
2AB
C
BA
C
CA
B
1
Optimum order \(\_\_\_\_\)
AQA D2 2016 June Q5
11 marks Moderate -0.5
5 Robert is planning to renovate four houses, \(A , B , C\) and \(D\), at the rate of one per month. The houses can be renovated in any order but the costs will vary because some of the materials left over from renovating one house can be used for the next one. The expected profits, in hundreds of pounds, are given in the table below.
Edexcel D2 2019 June Q7
15 marks Moderate -0.5
7. A company has purchased a plot of land and has decided to build four holiday homes, A, B, C and D, on the land at the rate of one home per year. The company expects that the construction costs each year will vary, depending on which houses have already been constructed and which house is currently under construction. The expected construction costs, in thousands of pounds, are shown in the table below.
\cline { 2 - 7 } \multicolumn{1}{c|}{}ABCDEF
A-5347393540
B53-32464143
C4732-514737
D394651-3649
E35414736-42
F4043374942-
\begin{table}[h]
1234Supply
A1720231425
B1615192229
C1914111532
Demand28172318
\captionsetup{labelformat=empty} \caption{Table 1}
\end{table} 2. You may not need to use all of these tables \begin{table}[h]
\captionsetup{labelformat=empty} \caption{Table 1}
1234Supply
A25
B29
C32
Demand28172318
\end{table}
1234Supply
A25
B29
C32
Demand28172318
1234Supply
A25
B29
C32
Demand28172318
1234Supply
A25
B29
C32
Demand28172318
1234Supply
A25
B29
C32
Demand28172318
1234Supply
A25
B29
C32
Demand28172318
1234Supply
A25
B29
C32
Demand28172318
1234Supply
A25
B29
C32
Demand28172318
1234Supply
A25
B29
C32
Demand28172318
3.
ABCDE
Frank50734
Gill538101
Harry43790
Imogen63654
Jiao02732
You may not need to use all of these tables
\(A\)\(B\)\(C\)\(D\)\(E\)
\(F\)
\(G\)
\(H\)
\(I\)
\(J\)
ABCDE
F
G
H
I
J
\(A\)\(B\)\(C\)\(D\)\(E\)
\(F\)
\(G\)
\(H\)
\(I\)
\(J\)
\(A\)\(B\)\(C\)\(D\)\(E\)
\(F\)
\(G\)
\(H\)
\(I\)
\(J\)
\(A\)\(B\)\(C\)\(D\)\(E\)
\(F\)
\(G\)
\(H\)
\(I\)
\(J\)
\(A\)\(B\)\(C\)\(D\)\(E\)
\(F\)
\(G\)
\(H\)
\(I\)
\(J\)
\(A\)\(B\)\(C\)\(D\)\(E\)
\(F\)
\(G\)
\(H\)
\(I\)
\(J\)
Stephen plays 1Stephen plays 2Stephen plays 3
Eugene plays 1450
Eugene plays 2-211
Eugene plays 3-3-43
4. 5. (a)
b.v.\(x\)\(y\)\(z\)\(r\)\(s\)\(t\)Value
30
60
80
0
You may not need to use all of these tableaux
b.v.\(x\)\(y\)\(z\)\(r\)\(s\)\(t\)ValueRow Ops
\(P\)
b.v.\(x\)\(y\)\(z\)\(r\)\(s\)\(t\)ValueRow Ops
\(P\)
b.v.\(x\)\(y\)\(z\)\(r\)\(s\)\(t\)ValueRow Ops
\(P\)
6. (a) Value of initial flow
(b) and (c) \includegraphics[max width=\textwidth, alt={}, center]{e0c66144-9e34-42fc-9f40-a87a49331483-20_725_1251_404_349} \section*{Diagram 1}
\includegraphics[max width=\textwidth, alt={}]{e0c66144-9e34-42fc-9f40-a87a49331483-20_1070_1264_1322_349}
\section*{Diagram 2} (d)
(e) \includegraphics[max width=\textwidth, alt={}, center]{e0c66144-9e34-42fc-9f40-a87a49331483-21_714_1385_1306_283} \section*{Diagram 3} (f)
7. (a)
StageStateActionDest.Value
1ABCDABCD65*
StageStateActionDest.Value
\includegraphics[max width=\textwidth, alt={}]{e0c66144-9e34-42fc-9f40-a87a49331483-24_2642_1833_118_118}
Edexcel D2 2004 June Q6
18 marks Standard +0.3
Joan sells ice cream. She needs to decide which three shows to visit over a three-week period in the summer. She starts the three-week period at home and finishes at home. She will spend one week at each of the three shows she chooses travelling directly from one show to the next. Table 1 gives the week in which each show is held. Table 2 gives the expected profits from visiting each show. Table 3 gives the cost of travel between shows. Table 1
Week123
ShowsA, B, CD, EF, G, H
Table 2
Show\(A\)\(B\)\(C\)\(D\)\(E\)\(F\)\(G\)\(H\)
Expected Profit (£)900800100015001300500700600
Table 3
Travel costs (£)\(A\)\(B\)\(C\)\(D\)\(E\)\(F\)\(G\)\(H\)
Home7080150809070
\(A\)180150
\(B\)140120
\(C\)200210
\(D\)200160120
\(E\)170100110
It is decided to use dynamic programming to find a schedule that maximises the total expected profit, taking into account the travel costs.
  1. Define suitable stage, state and action variables. [3]
  2. Determine the schedule that maximises the total profit. Show your working in a table. [12]
  3. Advise Joan on the shows that she should visit and state her total expected profit. [3]
(Total 18 marks)