דלג לתוכן

Labs · 9618 18.1 · graphs, Dijkstra, A*

Find the Shortest Route: Dijkstra and A*

Run Dijkstra's algorithm by hand with the exam table, read the route back, let A* guess its way and see when a guess goes wrong. Then solve real 9618 exam graphs.

10 levelsFree bench

In the exam

9618/31 May/June 2023 · Question 2(b) · 2 marks

Describe the purpose of both the A* algorithm and Dijkstra's algorithm.

Points that gain marks

  • Both find the best (shortest or cheapest) route between two nodes in a graph.
  • The best route is measured by distance, cost or time on the edges.

In this lab: Dijkstra always takes the nearest unvisited node; A* adds a guess h of the distance still to go, so it looks at fewer nodes on the way to the end.

More real experiments

All labs →

היכנס או צור חשבון

IGCSE, A-Level & AP