Navigation · Global Planning: Graph Search · M3-L1 · Beginner
Implement Dijkstra
10:15. The pharmacy has a prescription for Ward B and Scout takes the short way, straight through the crowded waiting area. The orderlies shuffle aside, the delivery arrives eight minutes late, and the route log shows a path that was shortest in steps and expensive in everything else.
You will write Dijkstra's algorithm in three steps: the cost of the cheapest route, the route itself, and the nearest of three pharmacy windows from a single search.
Your task
Lab complete: post-mortem
You have passed every stage. Now connect it back to the theory and move on:
Output
What Python can I use?
Plain Python with math and heapq. Your code runs in a background worker: an endless loop is stopped after a few seconds and the page stays usable. It runs in your browser and is never sent anywhere.