Shortest Path Algorithms and Graph Complexities

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/12

flashcard set

Earn XP

Description and Tags

This flashcard set covers SSSP algorithms like Dijkstra's and Bellman-Ford, their various implementation complexities based on data structures (Binary Heap, Sorted/Unsorted Lists), and Minimum Spanning Trees (MST).

Last updated 6:47 AM on 8/5/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

13 Terms

1
New cards

Dijkstra's Algorithm

A greedy Single Source Shortest Path (SSSP) algorithm that does not allow negative weights.

2
New cards

Edge Relaxation

A process where if the next edge is smaller, the path is relaxed and replaced with the smaller value to check if it offers a better path.

3
New cards

Dijkstra's Complexity (Adjacency List + Binary Heap)

Building PQ: O(V)O(V); Popping all V: O(V×log(V))O(V \times \text{log}(V)); Relaxing all E: O(E×log(V))O(E \times \text{log}(V)); Total: O((V+E)×log(V))O((V + E) \times \text{log}(V)).

4
New cards

Dijkstra's Complexity (Adjacency List + Sorted List)

Building PQ: O(V)O(V); Popping all V: O(V)O(V) (Total O(V×V)O(V \times V), transcript implies VV^*); Relaxing all E: O(E)O(E) (Total O(E×V)O(E \times V), transcript implies EE^*); Total: O(EV)O(EV).

5
New cards

Dijkstra's Complexity (Adjacency List + Unsorted List)

Building PQ: O(V)O(V); Popping all V: O(V×V)O(V \times V); Relaxing all E: O(E×1)O(E \times 1); Total: O(V2)O(V^2).

6
New cards

Dijkstra's Complexity (Adjacency Matrix + Binary Heap)

Building PQ: O(V)O(V); Popping all V: O(V×log(V))O(V \times \text{log}(V)); Relaxing all E: O(V2×log(V))O(V^2 \times \text{log}(V)); Total: O(V2×log(V))O(V^2 \times \text{log}(V)).

7
New cards

Dijkstra's Complexity (Adjacency Matrix + Sorted List)

Building PQ: O(V)O(V); Popping all V: O(V)O(V); Relaxing all E: O(V2×V)O(V^2 \times V); Total: O(V3)O(V^3).

8
New cards

Dijkstra's Complexity (Adjacency Matrix + Unsorted List)

Building PQ: O(V)O(V); Popping all V: O(V×V)O(V \times V); Relaxing all E: O(V×V)O(V \times V); Total: O(V3)O(V^3).

9
New cards

Bellman Ford

A shortest path algorithm that works with negative weights but cannot be used with negative cycles; it produces up to N1N - 1 passes.

10
New cards

BFS Complexity

O(V+E)O(V + E)

11
New cards

DFS Complexity

O((V+E)×log(V))O((V + E) \times \text{log}(V))

12
New cards

Bellman-Ford Complexity

O(V×E)O(V \times E)

13
New cards

MST (Minimum Spanning Tree)

A graph objective that is not a shortest path, but aims to minimize the total sum of ALL edges; implemented via the Prim Algorithm.