Data structures & algorithmsLesson 3 of 4 in the course Graph algorithms

Dijkstra's Algorithm: Correctness, Implementations, and Variants

5 flashcards · 5 quiz questions · 5 match pairs · 4 fill-in sentences · English

Lesson progress
0 / 5

Your progress is kept in this browser only.Sign up to save it

Summary

This lesson introduces the shortest-path problem, the graph model used to represent it, and the purpose and history of Dijkstra’s algorithm.

A graph consists of vertices (or nodes) and edges connecting pairs of vertices. In a weighted graph, each edge has a cost, such as distance, travel time, or network delay. A path is a sequence of connected edges, and its total cost is the sum of their weights.

All flashcards

Weighted graph
A graph whose edges have costs, such as distance, travel time, or network delay.
Shortest path
A path whose total edge cost is minimal among paths between the same endpoints.
Relaxation
Testing whether a route through a vertex improves a neighbor's tentative distance.
Decrease-key
A priority-queue operation that lowers an item's priority after a better route is found.
Uniform-cost search
A search method closely related to Dijkstra's algorithm.

Quiz questions

  1. Given a source vertex, what does Dijkstra's algorithm compute?Answer: Shortest distances from the source to every reachable vertex.
  2. During Dijkstra's algorithm, what happens when relaxation finds a route to a neighbor that is shorter than its current estimate?Answer: The neighbor's distance estimate and predecessor are updated.
  3. When can a standard Dijkstra search for one destination safely stop?Answer: When the destination is selected as the unvisited vertex with the smallest tentative distance.
  4. With adjacency lists and a binary heap, what is a standard time bound for Dijkstra's algorithm?Answer: O((∣V∣+∣E∣)log⁡∣V∣)O((|V|+|E|)\log |V|)
  5. What problem does Prim's algorithm solve, unlike Dijkstra's algorithm?Answer: Finding a minimum spanning tree.

Based on the Wikipedia article Dijkstra's algorithm, licensed CC BY-SA 4.0. Adapted into a summary, flashcards and quizzes.

All Data structures & algorithms lessons