Graph Algorithms: Single-Source Shortest Path Flashcards

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/11

flashcard set

Earn XP

Description and Tags

A collection of practice questions and answers covering SSSP algorithms including Dijkstra's, Bellman-Ford, and general graph properties based on lecture notes.

Last updated 5:29 PM on 7/9/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

12 Terms

1
New cards

What is the primary objective of the Single-Source Shortest Path (SSSP) problem?

To find the minimum-cost paths from a single source vertex ss to all other vertices vv in a given graph G(V,E)G(V,E).

2
New cards

Define the RELAX operation for an edge (u,v)(u, v) with weight w(u,v)w(u,v).

The operation checks if a shorter path to vv exists through uu: if d[v]>d[u]+w(u,v)d[v] > d[u] + w(u,v), update d[v]=d[u]+w(u,v)d[v] = d[u] + w(u,v) and set the predecessor π[v]=u\pi[v] = u.

3
New cards

What is the core strategy and constraint of Dijkstra's Algorithm?

Dijkstra's uses a greedy strategy and a priority queue to finalize vertices. It only works on graphs with non-negative edge weights (w0w \geq 0).

4
New cards

What is the time complexity of Dijkstra's Algorithm when using a binary heap?

O(ElogV)O(E \log V)

5
New cards

What is the time complexity of Dijkstra's Algorithm when using a Fibonacci heap?

O(E+VlogV)O(E + V \log V)

6
New cards

How many times does the Bellman-Ford Algorithm relax all edges in the graph?

It relaxes every edge (u,v)E(u,v) \in E exactly V1|V|-1 times.

7
New cards

How is a negative-weight cycle detected in the Bellman-Ford Algorithm?

If after V1|V|-1 relaxation passes, any edge still satisfies the condition d[u]+w(u,v)<d[v]d[u] + w(u,v) < d[v], a negative-weight cycle exists.

8
New cards

What are the primary differences between Dijkstra's and Bellman-Ford?

Dijkstra's is greedy, faster (O(ElogV)O(E \log V)), but requires non-negative weights. Bellman-Ford uses dynamic programming principles, is slower (O(VE)O(VE)), but handles negative weights and detects negative cycles.

9
New cards

What is the time complexity of the Floyd-Warshall Algorithm, and what type of problem does it solve?

It solves the All-Pairs Shortest Path problem with a time complexity of O(V3)O(V^3).

10
New cards

What is the fastest algorithm for Shortest Path in Directed Acyclic Graphs (DAGs)?

An algorithm using topological sort followed by relaxation, with a time complexity of O(V+E)O(V+E).

11
New cards

What are the time complexities for Prim's and Kruskal's Minimum Spanning Tree (MST) algorithms?

Prim's Algorithm is O(ElogV)O(E \log V), and Kruskal's Algorithm is O(ElogE)O(E \log E).

12
New cards

What is the initialization step for shortest path algorithms like Dijkstra and Bellman-Ford?

Set d[s]=0d[s] = 0, d[v]=d[v] = \infty for all vsv \neq s, and π[v]=NIL\pi[v] = NIL for all vv.