## 23.6 Case Study: Dijkstra's Algorithm

- A (min) PQ is used to represent the list of possible destinations with the relative cost of traveling to them
- Build a resultant map `shortest` of names and distances
- Place the source on the queue, w/distance 0
- Loop while the PQ is not empty:
  1. Pop element
  2. If city already visited (in `shortest`), goto 1
  3. Place city and cost in `shortest`
  4. For each adjacent node in `cities` (loop from `lower_bound` to `upper_bound`:
     - Add current distance to relative distance, add new entry to PQ

prev |top |next