Per the lecture's guidance, choose Kruskal over Prim when
- the graph has negative edge weights
- the source vertex is fixed in advance
- you need shortest paths from a single source
- the graph is sparse and the edge list is natural
Show answer and solution
Correct answer: D. the graph is sparse and the edge list is natural
On sparse graphs Kruskal's O(E log V) wins because sorting a small edge list is cheap.
On dense graphs (E close to V²) Prim with a Fibonacci heap gives O(V²), beating Kruskal's O(V² log V).
Negative weights and source vertices are irrelevant for MST
shortest-path-from-source is Dijkstra, a different algorithm.