9618/33/O/N/25 question 8: worked solution (October/November 2025, paper 33)

Show as plain text

Cambridge A2 Level Computer Science 9618 · 18.1 Artificial Intelligence (AI) Worked solution from the Artificial Intelligence (AI) Paper 3 Advanced Theory booklet, Part 1 of 1. Q16 9618/33/O/N/25 original Q8 Structured · 5 marks Worked solution Start at Start with distance 0 and set every other node to infinity (∞). Initialisation [1] Update the neighbours of Start: T = 6 and Y = 22. Mark Start as visited. Values are updated and visited nodes are shown [1] Visit the smallest unvisited node each time and update its neighbours: Visited T V W X Y Z Start 6 ∞ ∞ ∞ 22 ∞ T (6) 6 10 ∞ ∞ 22 ∞ V (10) 6 10 13 19 22 ∞ W (13) 6 10 13 18 22 ∞ X (18) 6 10 13 18 21 28 Y (21) 6 10 13 18 21 28 Route to X is worked out two ways: V → X = 10 + 9 = 19, but W → X = 13 + 5 = 18, so keep 18. Y: 18 + 3 = 21 is less than 22. Z: 18 + 10 = 28 is less than 21 + 8 = 29. More than one route calculated for a node [1] Write the answers in the table: T V W X Y Z 6 10 13 18 21 28 Four or five answers correct scores 1 mark; all six answers correct [2] KEY IDEA Dijkstra's always visits the nearest unvisited node and updates its neighbours with the shorter total distance. TOTAL 5 marks Official mark scheme VIDEO ▶ Topic lesson A lesson on this topic · by The CS Classroom. Tap the picture to open it on YouTube.