Exam-style question
Try this first
Explain one practical application of a shortest path algorithm and describe what the vertices, edges and edge weights could represent in that application.
Model answer
What a good answer should say
- A shortest path algorithm could be used in a navigation system to find a route between two locations.
- The vertices could represent locations or junctions, the edges could represent roads connecting them, and the edge weights could represent distances.
- The algorithm can compare possible routes and identify the route with the smallest total weight.
Explanation
Why this works
This answer identifies a relevant application and maps the graph components to meaningful parts of the application. The edge weights provide the values used when comparing routes.
Common mistake
No common mistake is linked to this question yet.
