Quiz Shortest Paths - Dijkstra's algorithm
Dijkstra's algorithm and ______________ algorithm are essentially the same. The main difference is the rule that is used to select the next vertex for the tree. ______________ algorithm chooses the closest vertex to the source via a directed path. ______________ algorithm chooses the closest vertex to the tree via an undirected edge
Prim's Dijkstra's Prim's
Dijkstra's algorithm, Prim's algorithms, Kruskal's algorithm, DFS, and BFS all compute a graph's spanning tree.
True
Which of the following best describes Dijkstra's algorithm? A) Consider edges in increasing order of their weights Add edge to tree and relax all edges that are part of the tree B) Consider edges in increasing order of their weights Add edge to tree and relax all edges pointing from that vertex C) Consider vertices in increasing order of distance from s Add vertex to tree and relax all edges that are part of the tree D) Consider vertices in increasing order of distance from s Add vertex to tree and relax all edges pointing from that vertex
D
One of the statements describing Dijkstra's algorithm is wrong. Find the incorrect statement. -Dijkstra's algorithm computes a spanning tree -In Dijkstra's algorithms each edge e = v -> w is relaxed exactly once (when v is relaxed) -Dijkstra's algorithm computes a shortest paths from all vertices to a given destination vertex -Dijkstra's algorithm computes a shortest paths tree in any edge-weighted digraph with non-negative weights
Dijkstra's algorithm computes a shortest paths from all vertices to a given destination vertex
The performance of Dijkstra's alrogithm depends on the implementation of the priority queue. In practice most people use for large, sparse graphs ______________ .
a binary heap or 4-way heap
To implement Dijkstra's algorithm Prof. Sedgewick uses _________________ .
an IndexMinPQ<Double>
Dijkstra's algorithm computes a shortest paths tree (SPT) in any _________________ that has _________________
edge-weighted digraph no negative weights