Six original Cambridge-style questions on graphs, Dijkstra's algorithm and the A* algorithm, with full traces in the solutions.
Describe the structure of a weighted, directed graph.
Explain how a graph can be used to help an AI system plan the route of a delivery robot through a warehouse.
An undirected graph has these edges: P-Q 7, P-R 3, R-Q 2, R-S 8, Q-S 4, Q-T 9, S-T 2.
Use Dijkstra's algorithm starting at P. Give the order in which the nodes are visited, the final shortest distance to each node, and the shortest route from P to T.
An undirected graph has these edges: S-A 2, S-B 5, A-C 6, A-D 3, B-D 2, C-G 2, D-G 6.
The heuristic values are: h(S) = 8, h(A) = 7, h(B) = 6, h(C) = 2, h(D) = 4, h(G) = 0.
Use the A* algorithm to find the shortest route from S to G. Show g, h and f for each node and the order in which nodes are expanded.
Compare Dijkstra's algorithm with the A* algorithm.
A programmer uses straight-line distance as the heuristic for A* on a road map. A colleague suggests multiplying every heuristic value by 3 so that the search finishes sooner. Discuss this suggestion.
Mark this once you have attempted all six and checked your working. It records a Practiced badge on the topic and adds a one-time bonus. Revealing the solutions alone does not count.