👑 Premium Sign in Sign up

CSE16 · CSE foundations & data structures

Dijkstra Path Quest

Roads have different travel times. Dijkstra finds the quickest route, not just the shortest number of steps.

📶 L300⏱ 30 min🧪 Live lab

🎯 You will learn to

  • Use weights on edges
  • Use a priority queue
  • Read the distance table

🧪 Live environment

Runs entirely in your browser: nothing is installed, no real cloud account is used and your code is never sent to our server.

Loading the lab…

✅ Steps & checkpoints

🗺️ Dijkstra with a priority queue

The closest unvisited city is taken from the priority queue; each road may lower a neighbour’s best-known time.

Dijkstra with a priority queueThe closest unvisited city is taken from the priority queue; each road may lower a neighbour’s best-known time.Sourcedist 0Min-heap(dist, city)TakeclosestRelax roadsd + w < best?BesttimesPreviouscityFastestrouteupdatepushwalk backPerson / clientQueue / eventsComputeData storeApp / UI

The 2D diagram shows the exact flow, ports and trust boundaries. The 3D scene is a concept view of the same parts; packets travel along the same arrows.

🤔 Think about it

Why can Dijkstra not handle negative road times?

🛡️ Safety & cost

Simulations and in-browser runtimes only.

🧹 Cleanup

Nothing to clean up.

📚 Reference documents

Official sources, checked on 5 Nov 2026. Cloud services change often; check the official page before relying on a feature. All references