Shortest Path

From an AS paper

Edexcel

Edexcel · Old spec

A2 June 2025 Q4

EdexcelCurrent spec13 marksRoute InspectionShortest Path

4.

Figure 2: network on offices A to K with edges AB 13, AC 5, AD 17, BC 6, BE 24, BF 10, BJ 39, CF 17, CG 9, CD 11, DG 1, DH 25, DK 19, EJ 10, FG 4, FK 13, GK 22, HK 7, JK 16
Figure 2

[The total weight of the network is 268]

Figure 2 represents a network of corridors between 10 offices, A, B, C, D, E, F, G, H, J and K, in a building. The number on each edge represents the length, in metres, of the corresponding corridor.

On Monday morning, Turvi needs to walk from J to K via A. She wishes to minimise the distance she travels along the corridors.

(a)
(i) Use Dijkstra’s algorithm, starting at A, to find the shortest route from J to K via A.
(ii) State the length of this route. (6)

On Monday afternoon, Turvi needs a route that traverses each corridor at least once. She plans to start at J and finish at A and wants to minimise the distance travelled.

(b)
(i) By considering the pairings of all relevant nodes, find the corridors that would need to be traversed twice. You must make your method and working clear.
(ii) State the total length of this route. (5)

Turvi discovers that she cannot walk along corridors AB, CD and JK because they are being decorated. Turvi walks from J to A travelling along all the other corridors at least once. She does this in the minimum distance possible.

(c) Determine the difference between the length of the route Turvi travels and the length of the route found in (b). You must make the values used in your calculation clear. (2)

A2 June 2025 Q3

EdexcelCurrent spec10 marksShortest PathTravelling Salesman

3.

Figure 1: network on villages A to G with arcs AG 11, GF 12, GE 24 (one-way from G to E), GC 47, AE 35, AB 9 (one-way from A to B), AD 25 (one-way from A to D), BF 35, BD 8, BC 40, CD 17, FE 14, FD 31, ED 11
Figure 1

Direct roads between seven villages, A, B, C, D, E, F and G, are represented in Figure 1. The weight on each arc is the time, in minutes, taken to travel along the corresponding road. Three roads, AB, AD and GE, are one-way, as indicated by the arrow on the corresponding arc.

Floyd’s algorithm is to be used to find the complete network of shortest times between the seven villages.

(a) Set up an initial time matrix for this network. (2)

The time matrix after three iterations of Floyd’s algorithm is shown below.

ABCDEFG
A–94917354411
B∞–408∞3587
C∞40–17∞7547
D∞817–113164
E35448411–1446
F∞35753114–12
G112047282412–
(b) Perform the next two iterations of Floyd’s algorithm that follow from the table above.
You should show only the time matrix after each iteration. (5)

The final time matrix after completion of Floyd’s algorithm is shown below.

ABCDEFG
A–93417282311
B54–258193345
C5825–17284247
D46817–112537
E35192811–1426
F2332422514–12
G112045282412–

Albert must visit each village. He will start and finish at B and wishes to minimise the total time taken to visit each village.

(c)
(i) Use the nearest neighbour algorithm, starting at B, to find a Hamiltonian cycle in the complete network of shortest times shown above.
(ii) Find the total travel time for this cycle.
(iii) Given that he travels the Hamiltonian cycle found in (c)(i), interpret this cycle in terms of the actual villages visited by Albert. (3)

AS June 2025 Q3

EdexcelAS paperCurrent spec14 marksRoute InspectionShortest Path

3.

Figure 2: weighted network on vertices A to J with arcs AB 15, AC 10, AE 14, AG 30, BC 4, BD 3, BH 12, CD 9, CE 2, DE 6, DF 8, DH 6, EF 4, FH 9, FG 10, HJ 8, GJ 3
Figure 2

[The total weight of the network is 153]

Figure 2 models a network of roads in a town, where the nodes represent road junctions. The numbers on the edges are the times, in minutes, taken to walk along the corresponding roads.

(a) State, with a reason, whether the graph in Figure 2 is Eulerian, semi-Eulerian or neither. (1)
(b)
(i) Use Dijkstra’s algorithm to find the quickest path from A to J.
(ii) State the shortest time needed to walk from A to J. (6)

Ruby manages road maintenance from her office located at junction B. She needs to walk along each road at least once, starting and finishing at her office. Road AE is temporarily blocked so she is unable to walk along it. Ruby wishes to minimise her journey time.

(c)
(i) Use an appropriate algorithm to find the roads that Ruby needs to traverse twice. You must make your method and working clear.
(ii) Calculate Ruby’s journey time. (5)

Ruby can save some time by choosing to start her route from any junction and to finish at her home at A. Road AE is still blocked and Ruby again wishes to minimise her journey time.

(d)
(i) Write down the junction at which Ruby should start.
(ii) Calculate how much time she would save. (2)

A2 June 2024 Q3

EdexcelCurrent spec13 marksRoute InspectionShortest Path

3.

Figure 1: network on towns A to K with arcs AB 25, AC 18, AD 47, BC 5, BD 17, CD 24, DE 20, DF 34, DG 26, EF 12, EJ 41, EK 37, FK 25, FJ 27, FG 4, FH 15, GH 21, JH 9, KH 6
Figure 1

[The total weight of the network is 413]

Figure 1 represents a network of cycle tracks between ten towns, A, B, C, D, E, F, G, H, J and K. The number on each arc represents the length, in kilometres, of the corresponding track.

(a) Use Dijkstra’s algorithm to find the shortest path from A to J. (5)

Abi needs to travel along every track shown in Figure 1 to check that they are all in good repair. She needs to start her inspection route at town G and finish her route at either town J or town K.

Abi wishes to minimise the total distance required to traverse every track.

(b) By considering all relevant pairings of vertices, determine whether Abi should finish her inspection route at town J or town K. You must
  • state which tracks she will repeat in her route
  • state the total length of her route
(6)

The direct track between town B and town C and the direct track between town H and town K are now closed to all users. A second person, Tarig, is asked to check all the remaining tracks starting at G and finishing at H.

Tarig wishes to minimise the total length of his inspection route.

(c) Determine which route, Abi’s or Tarig’s, is shorter. You must make your working clear. (2)

AS June 2024 Q3

EdexcelAS paperCurrent spec11 marksRoute InspectionShortest Path

3.

Figure 3: weighted network on vertices A to M with arcs AB 2, AC 9, AD 14, AE x, BC 5, BF 12, CF 6, CG 23, CH 15, DH 7, EJ 6, JH 1, FK 2, FG 13, GH 6, GM 10, KM y, HL 5, LM 3
Figure 3

[The total weight of the network is \(139 + x + y\)]

(a) Explain what is meant by the term “tree”. (1)

Figure 3 represents a network of walkways in a warehouse.
The arcs represent the walkways and the nodes represent junctions between them.
The number on each arc represents the length, in metres, of the corresponding walkway.

The values \(x\) and \(y\) are unknown, however it is known that \(x\) and \(y\) are integers and that

\[9 \lt x \lt y \lt 14\]
(b)
(i) Use Dijkstra’s algorithm to find the shortest route from A to M.
(ii) State an expression for the length of the shortest route from A to M. (6)

The warehouse manager wants to check that all of the walkways are in good condition.

Their inspection route starts at B and finishes at C.

The inspection route must traverse each walkway at least once and be as short as possible.

(c) State the arcs that are traversed twice. (1)
(d) State the number of times that H appears in the inspection route. (1)

The warehouse manager finds that the total length of the inspection route is 172 metres.

(e) Determine the value of \(x\) and the value of \(y\) (2)

A2 June 2023 Q3

EdexcelCurrent spec8 marksAlgorithmsShortest Path

3.

Figure 4: network on A to J with edges AB 23, AC 35, AD 41, BC 8, BE 42, BG 37, CD 7, CE 30, CG 28, CH 45, CF 43, DF 34, DH 32, EG 21, EH 7, EJ 50, FG 11, FH 22, GH 10, HJ 32
Figure 4

Figure 4 represents a network with nodes, A, B, C, D, E, F, G, H and J.

The number on each edge gives the length of the corresponding edge.

(a)
(i) Use Dijkstra’s algorithm to find the shortest path from A to J.
(ii) State the length of the shortest path from A to J. (6)

One application of Dijkstra’s algorithm has order \(n^2\), where \(n\) is the number of nodes in the network.

It takes a computer 0.0312 seconds to find the shortest path from a given start node to a given end node in a network of 9 nodes.

(b) Calculate approximately how long it would take, in minutes, for the computer to find the shortest path from a given start node to a given end node for a network of 9000 nodes. (2)

AS June 2023 Q3

EdexcelAS paperCurrent spec11 marksMinimum Spanning TreesShortest Path

3.

Figure 2: weighted network on vertices A to J with edges AB 40, AD 49, AE 45, BC 32, BD 6, BE 28, BF 58, CD 24, CG 41, CH 34, DG 15, EG 11, EF 30, FG 43, FJ 6, GH 23, GJ 50, HJ 61
Figure 2

Figure 2 represents a network of train tracks. The number on each edge represents the length, in kilometres, of the corresponding track.
Dyfan wishes to travel from A to J via C. Dyfan wishes to minimise the distance they travel.

Given that Dijkstra’s algorithm is to be applied only once to find Dyfan’s route,

(a) explain why the algorithm should begin at C. (1)
(b) Use Dijkstra’s algorithm to find the shortest route from A to J via C. State this route and its length. (6)
(c) Use Prim’s algorithm, starting at C, to find a minimum spanning tree for the network. You must clearly state the order in which you select the edges of your tree. (3)
(d) State the total length, in km, of the minimum spanning tree. (1)

A2 June 2023 Q1

EdexcelCurrent spec7 marksGraphs & NetworksShortest Path

1.

Figure 1: graph G on vertices A, B, C, D and E with edges EA, AB, AC, EB, ED, DB, DC and CB
Figure 1

Figure 1 shows the graph G.

(a) State whether G is Eulerian, semi-Eulerian, or neither, giving a reason for your answer. (1)
(b) Write down an example of a Hamiltonian cycle on G. (1)
(c) State whether or not G is planar, justifying your answer. (1)
(d) State the number of arcs that would need to be added to G to make the graph \(K_5\) (1)
Figure 2: the same graph with weights EA 5, AB 10, EB 4, ED 7, DB 8, AC 15, DC 2, CB 3
Figure 2

Direct roads between five villages, A, B, C, D and E, are represented in Figure 2. The weight on each arc is the time, in minutes, required to travel along the corresponding road. Floyd’s algorithm is to be used to find the complete network of shortest times between the five villages.

(e) For the network represented in Figure 2, complete the initial time matrix in the answer book. (1)

Initial time matrix (answer book)

ABCDE
A–                
B    –            
C        –        
D            –    
E                –

The time matrix after four iterations of Floyd’s algorithm is shown in Table 1.

ABCDE
A–1013155
B10–354
C133–27
D1552–7
E5477–

Table 1

(f) Perform the final iteration of Floyd’s algorithm that follows from Table 1, showing the time matrix for this iteration. (2)

A2 June 2022 Q3

EdexcelCurrent spec10 marksShortest PathTravelling Salesman

3. The initial distance matrix (Table 1) shows the lengths, in metres, of the corridors connecting six classrooms, A, B, C, D, E and F, in a school. For safety reasons, some of the corridors are one-way only.

ABCDEF
A–1232242911
B12–178∞∞
C3217–412∞
D24∞4–∞13
E∞∞1218–12
F11∞∞1312–

Table 1

(a) By adding the arcs from vertex A, along with their weights, complete the drawing of this network on Diagram 1 in the answer book. (2)
Diagram 1: vertices A to F with arcs BC 17, BD 8 (one-way from B to D), CD 4, CE 12, ED 18 (one-way from E to D), EF 12, DF 13; vertex A has no arcs
Diagram 1

Floyd’s algorithm is to be used to find the complete network of shortest distances between the six classrooms.

The distance matrix after two iterations of Floyd’s algorithm is shown in Table 2.

ABCDEF
A–1229202911
B12–1784123
C2917–41240
D24364–5313
E∞∞1218–12
F1123401312–

Table 2

(b) Perform the next two iterations of Floyd’s algorithm that follow from Table 2. You should show the distance matrix after each iteration. (4)

The final distance matrix after completion of Floyd’s algorithm is shown in Table 3.

ABCDEF
A–1224202311
B12–1282421
C2817–41217
D24214–1613
E23291216–12
F1123171312–

Table 3

Yinka must visit each classroom. He will start and finish at E and wishes to minimise the total distance travelled.

(c)
(i) Use the nearest neighbour algorithm, starting at E, to find two Hamiltonian cycles in the completed network of shortest distances.
(ii) Find the length of each of the two cycles.
(iii) State, with a reason, which of the two cycles provides the better upper bound for the length of Yinka’s route. (4)

AS June 2022 Q3

EdexcelAS paperCurrent spec14 marksRoute InspectionShortest Path

3.

Figure 2: weighted network on vertices A to H with arcs AB 4, AC 12, AD 10, BC 7, BF 15, BE 13, CF 3, DF 8, DG 11, EF 4, EH 5, FH 10, FG 6, GH 12
Figure 2

[The total weight of the network is 120]

(a) Explain what is meant by the term “path”. (2)
(b) State, with a reason, whether the network in Figure 2 is Eulerian, semi-Eulerian or neither. (1)

Figure 2 represents a network of cycle tracks between eight villages, A, B, C, D, E, F, 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.

(c) Use Dijkstra’s algorithm to find the shortest path that Samira can take. (5)

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),

(d) 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
  • state which tracks Daisy will repeat in her route
  • state the total length of her route
(6)

A2 June 2022 Q2

EdexcelCurrent spec13 marksRoute InspectionShortest Path

2.

Figure 1: network on A, B, C, D, E, F, G, H, J and K with edges AB 8, AC 18, AD 14, BC 9, BE 4, BH 23, CE 3, CF 10, DF 14, DG 25, EF 17, EG 31, EH 16, FG 10, GH 6, GJ 10, GK 25, HJ 23, HK 33
Figure 1

[The total weight of the network is 299]

Figure 1 represents a network of cycle tracks between 10 landmarks, A, B, C, D, E, F, G, H, J and K. The number on each edge represents the length, in kilometres, of the corresponding track.

One day, Blanche wishes to cycle from A to K. She wishes to minimise the distance she travels.

(a)
(i) Use Dijkstra’s algorithm to find the shortest path from A to K.
(ii) State the length of the shortest path from A to K. (6)

The cycle tracks between the landmarks now need to be inspected. Blanche must travel along each track at least once. She wishes to minimise the length of her inspection route. Blanche will start her inspection route at D and finish at E.

(b)
(i) State the edges that will need to be traversed twice.
(ii) Find the length of Blanche’s route. (2)

It is now decided to start the inspection route at A and finish at K. Blanche must minimise the length of her route and travel along each track at least once.

(c) By considering the pairings of all relevant nodes, find the length of Blanche’s new route. You must make your method and working clear. (5)

A2 October 2021 Q6

EdexcelCurrent spec10 marksAlgorithmsShortest Path

6.

Figure 4: network on A to H with arcs AB 32, AC 16, AD 75, AF 95, BD 33, BE 15, CD 50, CF 70, CG 105, CH 113, DE 17, DG 50, EF 30, FG 25, FH 41, GH 10
Figure 4

In Figure 4 the weights on the arcs represent distances.

(a)
(i) Use Dijkstra’s algorithm to find the shortest path from A to H.
(ii) State the length of the shortest path from A to H. (6)

One application of Dijkstra’s algorithm has order \(n^2\), where \(n\) is the number of nodes in the network. A computer produces a table of shortest distances between any two different nodes by repeatedly applying Dijkstra’s algorithm from each node of the network.

It takes the computer 0.082 seconds to produce a table of shortest distances for a network of 10 nodes.

(b) Calculate approximately how long it will take, in seconds, for the computer to produce a table of shortest distances for a network with 200 nodes. You must give a reason for your answer. (3)
(c) Explain why your answer to part (b) can only be an approximation. (1)

A2 October 2021 Q4

EdexcelCurrent spec8 marksRoute InspectionShortest Path

4.

Figure 3: network on A, B, C, D, E and F with arcs AB 57, AC 95, AD 150, AE 63, AF 230, BC 72, BE 132, CD 289, CE 160, CF 125, DE 84, EF 191
Figure 3

[The total weight of the network is 1648]

Direct roads between six cities, A, B, C, D, E and F, are represented in Figure 3. The weight on each arc is the time, in minutes, required to travel along the corresponding road.

Floyd’s algorithm is to be used to find the complete network of shortest times between the six cities.

An initial route matrix is given in the answer book.

Initial route matrix (answer book)

ABCDEF
AABCDEF
BABCDEF
CABCDEF
DABCDEF
EABCDEF
FABCDEF
(a) Set up the initial time matrix. (1)
(b) Perform the first iteration of Floyd’s algorithm. You should show the time and route matrices after this iteration. (2)

The final time matrix after completion of Floyd’s algorithm is shown below.

ABCDEF
A–579514763220
B57–72204120197
C9572–242158125
D147204242–84275
E6312015884–191
F220197125275191–

A route is needed that minimises the total time taken to traverse each road at least once.

The route must start at B and finish at E.

(c) Use an appropriate algorithm to find the roads that will need to be traversed twice. You should make your method and working clear. (4)
(d) Write down the length of the route. (1)

A2 October 2020 Q6

EdexcelCurrent spec11 marksRoute InspectionShortest Path

6.

Figure 4: network on A to G with arcs AB 24, AC 42, AD 65, BC 15, CE 19, CF 45, CD 21, CG 31, DF 34, DG y, EF x, FG 24
Figure 4

[The total weight of the network is \(320 + x + y\)]

(a) State, with justification, whether the graph in Figure 4 is Eulerian, semi-Eulerian or neither. (2)

The weights on the arcs in Figure 4 represent distances. The weight on arc EF is \(x\) where \(12 \lt x \lt 26\) and the weight on arc DG is \(y\) where \(0 \lt y \lt 10\)

An inspection route of minimum length that traverses each arc at least once is found. The inspection route starts and finishes at A and has a length of 409

It is also given that the length of the shortest route from F to G via A is 140

(b) Using appropriate algorithms, find the value of \(x\) and the value of \(y\). (9)

A2 October 2020 Q3

EdexcelCurrent spec9 marksShortest PathTravelling Salesman

3.

Figure 2: network on A, B, C, D and E with arcs AB 8, AC 4, AD 7, BC 3, BE 10, CE 6, DE 1 and DC 1 (one-way from D to C)
Figure 2

Direct roads between five villages, A, B, C, D and E, are shown in Figure 2. The weight on each arc is the time, in minutes, it takes to travel along the corresponding road. The road from D to C is one-way as indicated by the arrow on the corresponding arc.

Floyd’s algorithm is to be used to find the complete network of shortest times between the five villages.

(a) Set up initial time and route matrices. (2)

The matrices after two iterations of Floyd’s algorithm are shown below.

Time matrix

ABCDE
A–84718
B8–31510
C43–116
D7151–1
E181061–

Route matrix

ABCDE
AABCDB
BABCAE
CABCAE
DAACDE
EBBCDE
(b) Perform the next two iterations of Floyd’s algorithm that follow from the tables above. You should show the time and route matrices after each iteration. (4)

The final time matrix after completion of Floyd’s algorithm is shown below.

Final time matrix

ABCDE
A–7478
B7–3109
C43–76
D541–1
E6521–
(c)
(i) Use the nearest neighbour algorithm, starting at A, to find a Hamiltonian cycle in the complete network of shortest times.
(ii) Find the time taken for this cycle.
(iii) Interpret the cycle in terms of the actual villages visited. (3)

AS June 2019 Q4

EdexcelAS paperCurrent spec10 marksRoute InspectionShortest Path

4.

Figure 1: network on vertices A to H with arcs AB 10, AC 17, AD 9, BC 5, BE 25, CD 7, CE x + y, CF 7, CG 3, DG 12, EF 16, EH 9, FG 2, FH 13, GH 3x + y
Figure 1

[The total weight of the network is \(135 + 4x + 2y\)]

The weights on the arcs in Figure 1 represent distances. The weights on the arcs CE and GH are given in terms of \(x\) and \(y\), where \(x\) and \(y\) are positive constants and \(7 < x + y < 20\)

There are three paths from A to H that have the same minimum length.

(a) Use Dijkstra’s algorithm to find \(x\) and \(y\). (7)

An inspection route starting at A and finishing at H is found. The route traverses each arc at least once and is of minimum length.

(b) State the arcs that are traversed twice. (1)
(c) State the number of times that vertex C appears in the inspection route. (1)
(d) Determine the length of the inspection route. (1)

A2 June 2019 Q3

EdexcelCurrent spec14 marksShortest PathTravelling Salesman

3.

Figure 2: network on A, B, C, D and E with arcs AB 15, AC 7, AD 18, AE 3 (one-way from A to E), CB 5 (one-way from C to B), CD 4, CE 9, DE 3
Figure 2

The network in Figure 2 shows the direct roads linking five villages, A, B, C, D and E. The number on each arc represents the length, in miles, of the corresponding road. The roads from A to E and from C to B are one-way, as indicated by the arrows.

(a) Complete the initial distance and route tables for the network provided in the answer book. (2)

Initial distance table (answer book)

ABCDE
A                    
B                    
C                    
D                    
E                    

Initial route table (answer book)

ABCDE
A                    
B                    
C                    
D                    
E                    
(b) Perform the first three iterations of Floyd’s algorithm. You should show the distance table and the route table after each of the three iterations. (5)

After five iterations of Floyd’s algorithm the final distance table and partially completed final route table are shown below.

Distance table

ABCDE
A–12763
B15–222118
C75–47
D1194–3
E141273–

Route table

ABCDE
AA    
BAB   
CABC  
DCCCD 
EDDDDE
(c)
(i) Explain how the partially completed final route table can be used to find the shortest route from E to A.
(ii) State this route. (3)

Mabintou decides to use the distance table to try to find the shortest cycle that passes through each vertex. Starting at D, she applies the nearest neighbour algorithm to the final distance table.

(d)
(i) State the cycle obtained using the nearest neighbour algorithm.
(ii) State the length of this cycle.
(iii) Interpret the cycle in terms of the actual villages visited.
(iv) Prove that Mabintou’s cycle is not optimal. (4)

A2 June 2019 Q2

EdexcelCurrent spec14 marksRoute InspectionShortest Path

2.

Figure 1: network on A to J with arcs AB 38, AC 75, AF 42, BD 42, BE 15, CF 20, CG 7, DJ 10, EG 10, EJ 17, FG 12, FH 39, GJ 14, GH 23, HJ 6
Figure 1

[The total weight of the network is 370]

Figure 1 represents a network of corridors in a building. The number on each arc represents the length, in metres, of the corresponding corridor.

(a) Use Dijkstra’s algorithm to find the shortest path from A to D, stating the path and its length. (6)

On a particular day, Naasir needs to check the paintwork along each corridor. Naasir must find a route of minimum length. It must traverse each corridor at least once, starting at B and finishing at G.

(b) Use an appropriate algorithm to find the arcs that will need to be traversed twice. You must make your method and working clear. (4)
(c) Find the length of Naasir’s route. (1)

On a different day, all the corridors that start or finish at B are closed for redecorating. Naasir needs to check all the remaining corridors and may now start at any vertex and finish at any vertex. A route is required that excludes all those corridors that start or finish at B.

(d)
(i) Determine the possible starting and finishing points so that the length of Naasir’s route is minimised. You must give reasons for your answer.
(ii) Find the length of Naasir’s new route. (3)

AS June 2018 Q1

EdexcelAS paperCurrent spec9 marksAlgorithmsShortest Path

1.

Figure 1: network on vertices A to J with arcs AB 3, AD 25, AI 12, BC 5, CD 14, CE 6, DE 7, EF 8, EG 16, IF 7, IJ 10, FG 9, GH 11, JH 23
Figure 1

Figure 1 represents a network of roads.
The number on each arc represents the time taken, in minutes, to drive along the corresponding road.

(a)
(i) Use Dijkstra’s algorithm to find the shortest time needed to travel from A to H.
(ii) State the quickest route. (6)

For a network with \(n\) vertices, Dijkstra’s algorithm has order \(n^2\)

(b) 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)
(c) Explain why your answer to part (b) is only an approximation. (1)

D1 June 2019 Q3

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, A, B, C, D, E, F, G, H and J.

(a) 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. (5)
(b) State whether your minimum spanning tree is unique. Justify your answer. (1)
(c) Use Dijkstra’s algorithm to find the length of the shortest path from A to J. (5)

D1 June 2018 Q4

EdexcelOld spec14 marksRoute InspectionShortest Path

4.

Figure 2: weighted network of roads with vertices A to J
Figure 2

[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.

(a) 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.

(b) 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,

(c) state the number of times that Sahil will visit vertex E and vertex F in his inspection route. (2)

D1 June 2017 Q4

EdexcelOld spec15 marksRoute InspectionShortest Path

4.

Figure 4: weighted network of roads with vertices A to J
Figure 4

[The total weight of the network is 85]

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.

(a) Use Dijkstra’s algorithm to find the shortest path from A to H. State the shortest path and its length. (6)

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.

(b) 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.

(c)
(i) State the edges that should be repeated.
(ii) State a possible route and calculate its length. You must make your method and working clear. (4)

D1 June 2016 Q4

4.

Figure 3: weighted network of tram tracks with vertices A to K
Figure 3

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.

(a) Use Dijkstra’s algorithm to find the shortest path from A to F. State your path and its length. (6)

On another day, Sarah wishes to travel from A to F via J.

(b) Find a route of minimal length that goes from A to F via J and state its length. (2)
(c) 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. (3)
(d) State the length, in miles, of the minimum spanning tree. (1)

D1 June 2015 Q3

EdexcelOld spec10 marksShortest Path

3.

Figure 3: weighted network of roads with vertices A to J
Figure 3

Figure 3 represents a network of roads. The number on each arc is the length, in km, of the corresponding road.

(a) Use Dijkstra’s algorithm to find the shortest route from A to J. State the shortest route and its length. (6)
(b) Explain how you determined the shortest route from your labelled diagram. (2)
(c) Find the shortest route from A to J via E and state its length. (2)

D1 June 2014 (R) Q3

EdexcelOld spec9 marksShortest Path

3.

Figure 3: weighted network of roads with vertices S, A, B, C, D, E, F, G, T
Figure 3

Figure 3 represents a network of roads. The number on each arc represents the time taken, in minutes, to traverse each road.

(a) 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.

(b) 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)

D1 June 2014 Q5

EdexcelOld spec9 marksShortest Path

5.

Figure 2: network of roads between Preston, Blackburn, Skipton, York, Accrington, Leeds, Chorley, Horwich, Wigan and Manchester with lengths in miles
Figure 2

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.

(a) 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.

(b) 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)

D1 June 2013 (R) Q7

EdexcelOld spec7 marksShortest Path

7.

Figure 5: network of roads C1, C2, D, E, F, G, H, I, J with lengths in miles
Figure 5

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 C1 or C2. A route of minimum length is required.

It is decided to use Dijkstra’s algorithm to find the shortest routes between C1 and J and between C2 and J.

(a) Explain why J, rather than C1 or C2, should be chosen as the starting vertex. (1)
(b) Use Dijkstra’s algorithm to find the shortest route needed to transport the crane. State your route and its length. (6)

D1 June 2013 Q4

EdexcelOld spec8 marksShortest Path

4.

Figure 3: network of roads S, A, B, C, D, E, F, G, H, T with lengths in miles
Figure 3

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.

(a) Use Dijkstra’s algorithm to find the shortest path from S to T. State your path and its length. (6)

On a particular day, Liz must include F in her route.

(b) Find the shortest path from S to T that includes F, and state its length. (2)

D1 January 2013 Q4

EdexcelOld spec11 marksGraphs & NetworksShortest Path

4.

Figure 4: network of canals S, A, B, C, D, E, F, T with lengths in miles
Figure 4
(a) 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.

(b) Use Dijkstra’s algorithm to find the shortest path from S to T. State your path and its length. (6)
(c) Write down the length of the shortest path from S to F. (1)

Next week the canal represented by arc AB will be closed for dredging.

(d) Find a shortest path from S to T avoiding AB and state its length. (2)

D1 June 2012 Q5

EdexcelOld spec10 marksShortest Path

5.

Figure 4: network of roads S, A, B, C, D, E, F, T with lengths in miles
Figure 4

Figure 4 shows a network of roads. The number on each arc represents the length, in miles, of the corresponding road.

(a) Use Dijkstra’s algorithm to find the shortest route from S to T. State your shortest route and its length. (6)
(b) Explain how you determined your shortest route from your labelled diagram. (2)

Due to flooding, the roads in and out of D are closed.

(c) Find the shortest route from S to T avoiding D. State your shortest route and its length. (2)

D1 January 2012 Q4

EdexcelOld spec9 marksShortest Path

4.

Figure 5: network with edges AC 37, AD 68, AB 20, BD 45, BE 40, CH 20, CF 48, CD 27, DF 20, DE 12, EG 15, FH 20, FI 15, FG 20, GI 18, HJ 71, IJ 22
Figure 5

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.

(a) Use Dijkstra’s algorithm to find the shortest time needed to travel from A to J. State the shortest route. (7)

On a particular day Olivia must include G in her route.

(b) Find a route of minimal time from A to J that includes G, and state its length (2)

D1 June 2011 Q6

EdexcelOld spec10 marksShortest Path

6.

Figure 6: network with arcs AB 25, AC 11, AD 27, BC 10, BG 43, BE 29, CE 40, CD 13, DF 15, EF 10, EG 10, EH 30, FH 53, GH 12
Figure 6

Figure 6 shows a network of cycle tracks. The number on each arc gives the length, in km, of that track.

(a) Use Dijkstra’s algorithm to find the shortest route from A to H. State your shortest route and its length. (6)
(b) Explain how you determined your shortest route from your labelled diagram. (2)

The track between E and F is now closed for resurfacing and cannot be used.

(c) Find the shortest route from A to H and state its length. (2)

D1 January 2011 Q1

EdexcelOld spec8 marksShortest Path

1.

Figure 1: network with arcs AE 14, AC 9, AB 4, BC 3, BD 10, CE 3, CF 14, CD 2, DF 10, DH 16, EG 4, EF 8, FG 3, FH 4, GH 8
Figure 1

Figure 1 shows a network of roads between eight villages, A, B, C, D, E, F, G and H. The number on each arc gives the length, in miles, of the corresponding road.

(a) Use Dijkstra’s algorithm to find the shortest distance from A to H. (5)
(b) State your shortest route. (1)
(c) Write down the shortest route from H to C and state its length. (2)

D1 June 2010 Q6

EdexcelOld spec9 marksShortest Path

6.

Figure 5: network with arcs SA 24, SC 61, SB 18, AD 42, AC 34, BC 42, BE 12, CD 7, CF 15, CE 28, DF 23, DG 12, FG 38, FE 11, FH 35, EH 47, GT 14, HT 11
Figure 5

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.

(a) Use Dijkstra’s algorithm to find the quickest route from S to T. State your quickest route and the time it takes. (6)
(b) Explain how you determined your quickest route from your labelled diagram. (2)
(c) Write down the quickest route from E to T. (1)

D1 January 2010 Q3

EdexcelOld spec10 marksRoute InspectionShortest Path

3.

Figure 3: network with arcs AB 15, AD 20, AC 19, BE 8, BD 14, CD 12, CF 10, DE 2, DG 6, DF 7, EG 3, EH 15, GH 11, FG 4, FH 21
Figure 3

[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.

(a) 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.

(b) 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. (5)

D1 June 2009 Q6

EdexcelOld spec7 marksShortest Path

6.

Figure 4: network of roads with vertices A to I and lengths in km
Figure 4

Figure 4 represents a network of roads. The number on each arc gives the length, in km, of that road.

(a) Use Dijkstra’s algorithm to find the shortest distance from A to I. State your shortest route. (6)
(b) State the shortest distance from A to G. (1)

D1 January 2009 Q6

EdexcelOld spec7 marksShortest Path

6.

Figure 4: network of roads through villages A to H with lengths in km
Figure 4

Figure 4 shows a network of roads through eight villages, A, B, C, D, E, F, G and H. The number on each arc is the length of that road in km.

(a) 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.

(b) State this new minimal route and its length. (2)

D1 June 2008 Q3

EdexcelOld spec9 marksRoute InspectionShortest Path

3.

Figure 3: network of roads with vertices A to I and lengths in km
Figure 3

Figure 3 shows a network of roads. The number on each arc represents the length, in km, of that road.

(a) 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.

(b) 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 197km)

D1 June 2006 Q4

EdexcelOld spec12 marksGraphs & NetworksShortest Path

4.

(a) Explain what is meant by the term ‘path’. (2)
Figure 3: network of cycle tracks on A to I
Figure 3

Figure 3 shows a network of cycle tracks. The number on each edge represents the length, in miles, of that track. Mary wishes to cycle from \(A\) to \(I\) as part of a cycling holiday. She wishes to minimise the distance she travels.

(b) Use Dijkstra’s algorithm to find the shortest path from \(A\) to \(I\). Show all necessary working in the boxes in Diagram 1 in the answer book. State your shortest path and its length. (6)
(c) Explain how you determined the shortest path from your labelling. (2)

Mary wants to visit a theme park at \(E\).

(d) Find a path of minimal length that goes from \(A\) to \(I\) via \(E\) and state its length. (2)

D1 June 2005 Q6

EdexcelOld spec10 marksShortest Path

6.

Figure 5: road network on A to J
Figure 5

Figure 5 shows a network of roads. The number on each arc represents the length of that road in km.

(a) Use Dijkstra’s algorithm to find the shortest route from \(A\) to \(J\). State your shortest route and its length. (5)
(b) Explain how you determined the shortest route from your labelled diagram. (2)

The road from \(C\) to \(F\) will be closed next week for repairs.

(c) Find the shortest route from \(A\) to \(J\) that does not include \(CF\) and state its length. (3)

D1 January 2005 Q5

EdexcelOld spec11 marksRoute InspectionShortest Path

5.

Figure 3: network of paths on A to H
Figure 3

Figure 3 shows a network of paths. The number on each arc gives the distance, in metres, of that path.

(i) Use Dijkstra’s algorithm to find the shortest distance from \(A\) to \(H\). (5)
(ii) Solve the route inspection problem for the network shown in Figure 3. You should make your method and working clear. State a shortest route, starting at \(A\), and find its length.

[The total weight of the network is 1241]

(6)