7.04a Shortest path: Dijkstra's algorithm

225 questions

Sort by: Default | Easiest first | Hardest first
Edexcel D1 2021 October Q1
10 marks Moderate -0.8
  1. Explain what is meant by the term 'path'.
    (2) \begin{figure}[h]
    \includegraphics[alt={},max width=\textwidth]{d409aaae-811d-4eca-b118-efc927885f97-02_812_1262_427_404} \captionsetup{labelformat=empty} \caption{Figure 1}
    \end{figure} Figure 1 represents a network of roads. The number on each arc represents the length, in km, of the corresponding road. Piatrice wishes to travel from A to J.
  2. Use Dijkstra's algorithm to find the shortest path Piatrice could take from A to J. State your path and its length.
    (6) Piatrice needs to return from J to A via G.
  3. Find the shortest path Piatrice could take from J to A via G and state its length.
Edexcel D1 2013 Specimen Q6
9 marks Easy -1.3
6. \begin{figure}[h]
\includegraphics[alt={},max width=\textwidth]{5fa867a2-0a3d-4f0b-9f9c-15584f2be5c0-07_602_1182_244_440} \captionsetup{labelformat=empty} \caption{Figure 5}
\end{figure} Figure 5 shows a network of cycle tracks within a national park. The number on each arc represents the time taken, in minutes, to cycle along the corresponding track.
  1. Use Dijkstra's algorithm to find the quickest route from S to T. State your quickest route and the time it takes.
    (6)
  2. Explain how you determined your quickest route from your labelled diagram.
  3. Write down the quickest route from E to T .
Edexcel D1 2009 January Q6
7 marks Moderate -0.3
6. \begin{figure}[h]
\includegraphics[alt={},max width=\textwidth]{ef029462-ffed-4cdf-87bc-56c8a13d671f-6_609_1283_260_392} \captionsetup{labelformat=empty} \caption{Figure 4}
\end{figure} Figure 4 shows a network of roads through eight villages, \(\mathrm { A } , \mathrm { B } , \mathrm { C } , \mathrm { D } , \mathrm { E } , \mathrm { F } , \mathrm { G }\) and H . The number on each arc is the length of that road in km .
  1. Use Dijkstra's algorithm to find the shortest route from A to H. State your shortest route and its length.
    (5) There is a fair in village C and you cannot drive through the village. A shortest route from A to H which avoids C needs to be found.
  2. State this new minimal route and its length.
    (2)
Edexcel D1 2010 January Q3
10 marks Moderate -0.3
3. \begin{figure}[h]
\includegraphics[alt={},max width=\textwidth]{17bc9fb2-13bf-4ffa-93ac-bef170467570-4_579_1273_239_397} \captionsetup{labelformat=empty} \caption{Figure 3}
\end{figure} [The total weight of the network is 167]
Figure 3 represents a network of paths. The number on each arc gives the time, in minutes, to travel along that path.
  1. Use Dijkstra's algorithm to find the quickest route from A to H. State your quickest route and the time taken.
    (5) Kevin must walk along each path at least once and return to his starting point.
  2. Use an appropriate algorithm to find the time of Kevin's quickest possible route, starting and finishing at A. You should make your method and working clear.
Edexcel D1 2011 January Q1
8 marks Moderate -0.8
1. \begin{figure}[h]
\includegraphics[alt={},max width=\textwidth]{0360f78d-e18c-4c47-a2ec-ddd705a4175f-2_750_1285_388_390} \captionsetup{labelformat=empty} \caption{Figure 1}
\end{figure} Figure 1 shows a network of roads between eight villages, \(\mathrm { A } , \mathrm { B } , \mathrm { C } , \mathrm { D } , \mathrm { E } , \mathrm { F } , \mathrm { G }\) and H . The number on each arc gives the length, in miles, of the corresponding road.
  1. Use Dijkstra's algorithm to find the shortest distance from A to H .
    (5)
  2. State your shortest route.
    (1)
  3. Write down the shortest route from H to C and state its length.
    (2)
Edexcel D1 2012 January Q4
9 marks Moderate -0.5
4. \begin{figure}[h]
\includegraphics[alt={},max width=\textwidth]{e02c4a9a-d2ab-489f-b838-9b4d902c4457-5_679_1420_228_312} \captionsetup{labelformat=empty} \caption{Figure 5}
\end{figure} Figure 5 models a network of roads. The number on each edge gives the time, in minutes, taken to travel along that road. Olivia wishes to travel from A to J as quickly as possible.
  1. Use Dijkstra's algorithm to find the shortest time needed to travel from A to J. State the shortest route. On a particular day Olivia must include G in her route.
  2. Find a route of minimal time from A to J that includes G , and state its length
Edexcel D1 2013 January Q4
11 marks Moderate -0.3
4. \begin{figure}[h]
\includegraphics[alt={},max width=\textwidth]{bd6edbd4-1ec0-4c7e-bd39-b88f96bf52fb-4_629_1392_187_319} \captionsetup{labelformat=empty} \caption{Figure 4}
\end{figure}
  1. Explain what is meant, in a network, by the term path.
    (2) Figure 4 represents a network of canals. The number on each arc represents the length, in miles, of the corresponding canal.
  2. Use Dijkstra's algorithm to find the shortest path from S to T . State your path and its length.
  3. Write down the length of the shortest path from S to F . Next week the canal represented by \(\operatorname { arc } \mathrm { AB }\) will be closed for dredging.
  4. Find a shortest path from S to T avoiding AB and state its length.
Edexcel D1 2001 June Q4
11 marks Moderate -0.3
4. This question should be answered on the sheet provided in the answer booklet. \begin{figure}[h]
\captionsetup{labelformat=empty} \caption{Figure 3} \includegraphics[alt={},max width=\textwidth]{6d306129-6e1f-424a-b21c-1bf6434ee082-5_732_1238_446_391}
\end{figure} The weighted network shown in Fig. 3 models the area in which Bill lives. Each vertex represents a town. The edges represent the roads between the towns. The weights are the lengths, in km , of the roads.
  1. Use Dijkstra's algorithm to find the shortest route from Bill's home at \(S\) to \(T\). Complete all the boxes on the answer sheet and explain clearly how you determined the path of least weight from your labelling. Bill decides that on the way to \(T\) he must visit a shop in town \(E\).
  2. Obtain his shortest route now, giving its length and explaining your method clearly.
Edexcel D1 2002 June Q3
6 marks Moderate -0.8
3. \begin{figure}[h]
\captionsetup{labelformat=empty} \caption{Figure 1} \includegraphics[alt={},max width=\textwidth]{652477eb-87dc-4a5a-8514-c9be39986142-3_444_483_401_489}
\end{figure} \begin{figure}[h]
\captionsetup{labelformat=empty} \caption{Figure 2} \includegraphics[alt={},max width=\textwidth]{652477eb-87dc-4a5a-8514-c9be39986142-3_444_478_401_1106}
\end{figure} Five members of staff \(1,2,3,4\) and 5 are to be matched to five jobs \(A , B , C , D\) and \(E\). A bipartite graph showing the possible matchings is given in Fig. 1 and an initial matching \(M\) is given in Fig. 2. There are several distinct alternating paths that can be generated from \(M\). Two such paths are $$2 - B = 4 - E$$ and $$2 - A = 3 - D = 5 - E$$
  1. Use each of these two alternating paths, in turn, to write down the complete matchings they generate. Using the maximum matching algorithm and the initial matching \(M\),
  2. find two further distinct alternating paths, making your reasoning clear. \begin{figure}[h]
    \captionsetup{labelformat=empty} \caption{Figure 3} \includegraphics[alt={},max width=\textwidth]{652477eb-87dc-4a5a-8514-c9be39986142-4_577_1476_367_333}
    \end{figure} Figure 3 shows the network of paths in a country park. The number on each path gives its length in km . The vertices \(A\) and \(I\) represent the two gates in the park and the vertices \(B , C , D , E , F , G\) and \(H\) represent places of interest.
Edexcel D1 2008 June Q3
9 marks Standard +0.3
3. \begin{figure}[h]
\includegraphics[alt={},max width=\textwidth]{be646775-535e-4105-86b4-ffc7eda4fa51-3_549_1397_258_333} \captionsetup{labelformat=empty} \caption{Figure 3}
\end{figure} Figure 3 shows a network of roads. The number on each arc represents the length, in km, of that road.
  1. Use Dijkstra's algorithm to find the shortest route from A to I. State your shortest route and its length.
    (5) Sam has been asked to inspect the network and assess the condition of the roads. He must travel along each road at least once, starting and finishing at A .
  2. Use an appropriate algorithm to determine the length of the shortest route Sam can travel. State a shortest route.
    (4)
    (The total weight of the network is 197 km )
Edexcel D1 2012 June Q5
10 marks Moderate -0.3
5. \begin{figure}[h]
\includegraphics[alt={},max width=\textwidth]{4ad45e8f-f50a-4125-866b-a6951f85600f-6_785_1463_191_301} \captionsetup{labelformat=empty} \caption{Figure 4}
\end{figure} Figure 4 shows a network of roads. The number on each arc represents the length, in miles, of the corresponding road.
  1. Use Dijkstra's algorithm to find the shortest route from S to T . State your shortest route and its length.
    (6)
  2. Explain how you determined your shortest route from your labelled diagram.
    (2) Due to flooding, the roads in and out of D are closed.
  3. Find the shortest route from S to T avoiding D . State your shortest route and its length.
    (2)
Edexcel D1 2013 June Q7
7 marks Moderate -0.8
7. \begin{figure}[h]
\includegraphics[alt={},max width=\textwidth]{1493d74b-e9ef-4c9a-91f6-877c1eaa74e2-08_748_1563_251_242} \captionsetup{labelformat=empty} \caption{Figure 5}
\end{figure} Figure 5 represents a network of roads. The number on each arc represents the length, in miles, of the corresponding road. A large crane is required at J and it may be transported from either \(\mathrm { C } _ { 1 }\) or \(\mathrm { C } _ { 2 }\). A route of minimum length is required. It is decided to use Dijkstra's algorithm to find the shortest routes between \(\mathrm { C } _ { 1 }\) and J and between \(\mathrm { C } _ { 2 }\) and J .
  1. Explain why J , rather than \(\mathrm { C } _ { 1 }\) or \(\mathrm { C } _ { 2 }\), should be chosen as the starting vertex.
    (1)
  2. Use Dijkstra's algorithm to find the shortest route needed to transport the crane. State your route and its length.
    (6)
Edexcel D1 2013 June Q4
8 marks Moderate -0.3
4. \begin{figure}[h]
\includegraphics[alt={},max width=\textwidth]{5b32eb57-c9cd-46ec-a328-12050148bdf7-5_780_1717_276_175} \captionsetup{labelformat=empty} \caption{Figure 3}
\end{figure} Figure 3 represents a network of roads. The number on each arc represents the length, in miles, of the corresponding road. Liz wishes to travel from S to T .
  1. Use Dijkstra's algorithm to find the shortest path from S to T . State your path and its length. On a particular day, Liz must include F in her route.
  2. Find the shortest path from S to T that includes F , and state its length.
Edexcel D1 2014 June Q3
9 marks Moderate -0.5
3. \begin{figure}[h]
\includegraphics[alt={},max width=\textwidth]{23cc3c59-35d8-4120-9965-952c0ced5b3d-4_605_1378_248_370} \captionsetup{labelformat=empty} \caption{Figure 3}
\end{figure} Figure 3 represents a network of roads. The number on each arc represents the time taken, in minutes, to traverse each road.
  1. Use Dijkstra's algorithm to find the quickest route from S to T. State your quickest route and the time taken.
    (6) It is now necessary to include E in the route.
  2. Determine the effect that this will have on the time taken for the journey. You must state your new quickest route and the time it takes.
    (3)
Edexcel D1 2014 June Q5
9 marks Moderate -0.5
5. \begin{figure}[h]
\includegraphics[alt={},max width=\textwidth]{818ba207-5839-4698-aacb-75dab88b218f-06_851_1490_191_317} \captionsetup{labelformat=empty} \caption{Figure 2}
\end{figure} Sharon is planning a road trip from Preston to York. Figure 2 shows the network of roads that she could take on her trip. The number on each arc is the length of the corresponding road in miles.
  1. Use Dijkstra's algorithm to find the shortest route from Preston (P) to York (Y). State the shortest route and its length.
    (6) Sharon has a friend, John, who lives in Manchester (M). Sharon decides to travel from Preston to York via Manchester so she can visit John. She wishes to minimise the length of her route.
  2. State the new shortest route. Hence calculate the additional distance she must travel to visit John on this trip. You must make clear the numbers you use in your calculation.
    (3)
Edexcel D1 2015 June Q3
10 marks Moderate -0.3
3. \begin{figure}[h]
\includegraphics[alt={},max width=\textwidth]{ba22b22e-c0d5-438d-821b-88619eacdb5d-4_901_894_228_612} \captionsetup{labelformat=empty} \caption{Figure 3}
\end{figure} Figure 3 represents a network of roads. The number on each arc is the length, in km , of the corresponding road.
  1. Use Dijkstra's algorithm to find the shortest route from A to J. State the shortest route and its length.
  2. Explain how you determined the shortest route from your labelled diagram.
  3. Find the shortest route from A to J via E and state its length.
Edexcel D1 2016 June Q4
12 marks Moderate -0.8
4. \begin{figure}[h]
\includegraphics[alt={},max width=\textwidth]{22ff916a-4ba8-4e0c-9c53-e82b0aff0b98-05_841_1201_226_431} \captionsetup{labelformat=empty} \caption{Figure 3}
\end{figure} Figure 3 represents a network of tram tracks. The number on each edge represents the length, in miles, of the corresponding track. One day, Sarah wishes to travel from A to F. She wishes to minimise the distance she travels.
  1. Use Dijkstra's algorithm to find the shortest path from A to F . State your path and its length. On another day, Sarah wishes to travel from A to F via J.
  2. Find a route of minimal length that goes from A to F via J and state its length.
  3. Use Prim's algorithm, starting at G , to find the minimum spanning tree for the network. You must clearly state the order in which you select the edges of your tree.
  4. State the length, in miles, of the minimum spanning tree.
Edexcel D1 2017 June Q4
15 marks Standard +0.3
4. \begin{figure}[h]
\includegraphics[alt={},max width=\textwidth]{65fb7699-4301-47d2-995d-713ee33020c8-05_999_1214_233_424} \captionsetup{labelformat=empty} \caption{Figure 4
[0pt] [The total weight of the network is 85]}
\end{figure} Figure 4 represents a network of roads. The number on each edge represents the length, in miles, of the corresponding road. Robyn wishes to travel from A to H. She wishes to minimise the distance she travels.
  1. Use Dijkstra's algorithm to find the shortest path from A to H. State the shortest path and its length. On a particular day, Robyn needs to check each road. She must travel along each road at least once. Robyn must start and finish at vertex A.
  2. Use the route inspection algorithm to find the length of the shortest inspection route. State the edges that should be repeated. You should make your method and working clear.
    (5) The roads BD and BE become damaged and cannot be used. Robyn needs to travel along all the remaining roads to check that there is no damage to any of them. The inspection route must still start and finish at vertex A.
    1. State the edges that should be repeated.
    2. State a possible route and calculate its length. You must make your method and working clear.
Edexcel D1 2018 June Q4
14 marks Standard +0.3
4. \begin{figure}[h]
\includegraphics[alt={},max width=\textwidth]{6b51f3a0-0945-4254-8c63-20e1371e9e3a-05_812_1655_269_205} \captionsetup{labelformat=empty} \caption{Figure 2}
\end{figure} [The total weight of the network is 293] Figure 2 models a network of roads. The number on each edge gives the time, in minutes, taken to travel along the corresponding road.
  1. Use Dijkstra's algorithm to find the shortest time needed to travel from A to J . State the quickest route.
    (6) The road represented by edge GJ is closed due to essential maintenance. Sahil needs to travel along all the other roads to check that they are in good repair. Sahil wishes to complete his route as quickly as possible and will start and finish at the same vertex.
  2. Use the route inspection algorithm to find the duration of Sahil's quickest route. State the edges that will need to be traversed twice. You should make your method and working clear.
    (6) Given that Sahil will start and finish at vertex C,
  3. state the number of times that Sahil will visit vertex E and vertex F in his inspection route.
    (2)
Edexcel D1 2019 June Q3
11 marks Moderate -0.8
3.
ABCDEFGHJ
A-385-----
B3-4------
C84--94---
D5----749-
E--9--4--7
F--474--813
G---4---4-
H---9-84-7
J----713-7-
The table above shows the lengths, in metres, of the paths between nine vertices, \(\mathrm { A } , \mathrm { B } , \mathrm { C } , \mathrm { D } , \mathrm { E } , \mathrm { F }\), G, H and J.
  1. Use Prim's algorithm, starting at A , to find a minimum spanning tree for this table of distances. You must clearly state the order in which you select the edges and state its weight. Draw your minimum spanning tree using the vertices in the answer book.
  2. State whether your minimum spanning tree is unique. Justify your answer.
  3. Use Dijkstra's algorithm to find the length of the shortest path from A to J.
Edexcel D1 Q7
10 marks Standard +0.3
7. \begin{figure}[h]
\includegraphics[alt={},max width=\textwidth]{552f3296-ad61-448b-8168-6709fb359fa2-7_915_1509_267_278} \captionsetup{labelformat=empty} \caption{Figure 5}
\end{figure} Figure 5 shows the possible bus journeys linking towns, S, A, B, C, D, E, F, G, H and T. Each arc represents a bus journey. The number on each arc represents the cost, in pounds, of travelling along that route.
  1. Use Dijkstra's algorithm, on the diagram in the answer book to find the cheapest route from S to T. State your cheapest route and its cost.
    (6)
  2. Explain how you determined your cheapest route from your labelled diagram. The bus journey from S to B is cancelled due to a driver's illness.
  3. Find the cheapest route from S to T that does not include SB , and state its cost.
Edexcel D1 2002 November Q5
10 marks Moderate -0.3
5. \begin{figure}[h]
\captionsetup{labelformat=empty} \caption{Figure 3} \includegraphics[alt={},max width=\textwidth]{438a62e6-113c-428e-85bf-4b1cbecee0de-5_763_1490_348_242}
\end{figure}
  1. Use Dijkstra's algorithm to find the shortest route from \(S\) to \(T\) in Fig. 3. Show all necessary working in the boxes in the answer booklet. State your shortest route and its length.
  2. Explain how you determined the shortest route from your labelling.
  3. It is now necessary to go from \(S\) to \(T\) via \(H\). Obtain the shortest route and its length.
Edexcel FD1 AS 2018 June Q1
9 marks Moderate -0.5
1. \begin{figure}[h]
\includegraphics[alt={},max width=\textwidth]{3e853c6d-e90e-4a09-b990-1c2c146b54e1-2_1105_1459_463_402} \captionsetup{labelformat=empty} \caption{Figure 1}
\end{figure} Figure 1 represents a network of roads.
The number on each arc represents the time taken, in minutes, to drive along the corresponding road.
    1. Use Dijkstra's algorithm to find the shortest time needed to travel from A to H .
    2. State the quickest route. For a network with \(n\) vertices, Dijkstra's algorithm has order \(n ^ { 2 }\)
  1. If it takes 1.5 seconds to run the algorithm when \(n = 250\), calculate approximately how long it will take, in seconds, to run the algorithm when \(n = 9500\). You should make your method and working clear.
  2. Explain why your answer to part (b) is only an approximation.
Edexcel FD1 AS 2021 June Q4
8 marks Challenging +1.2
4. \begin{figure}[h]
\includegraphics[alt={},max width=\textwidth]{d3f5dcb4-3e23-4d78-965a-a1acaac13819-05_712_1433_223_315} \captionsetup{labelformat=empty} \caption{Figure 2}
\end{figure} Dijkstra's algorithm has been applied to the network in Figure 2.
A working value has only been replaced at a node if the new working value is smaller.
  1. State the length of the shortest path from A to G .
  2. Complete the table in the answer book giving the weight of each arc listed. (Note that arc CE and arc EF are not in the table.)
  3. State the shortest path from A to G. It is now given that
Edexcel FD1 AS 2022 June Q3
14 marks Moderate -0.5
3. \begin{figure}[h]
\includegraphics[alt={},max width=\textwidth]{c8134d3b-71cb-4b92-ac54-81a4ff8f3011-05_702_1479_201_293} \captionsetup{labelformat=empty} \caption{Figure 2}
\end{figure} [The total weight of the network is 120]
  1. Explain what is meant by the term "path".
  2. State, with a reason, whether the network in Figure 2 is Eulerian, semi-Eulerian or neither. Figure 2 represents a network of cycle tracks between eight villages, \(\mathrm { A } , \mathrm { B } , \mathrm { C } , \mathrm { D } , \mathrm { E } , \mathrm { F } , \mathrm { G }\) and H . The number on each arc represents the length, in km , of the corresponding track. Samira lives in village A, and wishes to visit her friend, Daisy, who lives in village H.
  3. Use Dijkstra's algorithm to find the shortest path that Samira can take. An extra cycle track of length 9 km is to be added to the network. It will either go directly between C and D or directly between E and G . Daisy plans to cycle along every track in the new network, starting and finishing at H .
    Given that the addition of either track CD or track EG will not affect the final values obtained in (c),
  4. use a suitable algorithm to find out which of the two possible extra tracks will give Daisy the shortest route, making your method and working clear. You must