Recent questions tagged dijkstras-algorithm

1 1 vote
1 1 answer
120
120 views
Consider Dijkstra's algorithm on a graph having $V$ vertices and $E$ edges.Suppose an indexed priority queue is not used.Instead, the tentative distances are stored only ...
0 0 votes
1 1 answer
118
118 views
Let $G=(V,E)$ be a directed graph with positive edge weights.Given vertices $s,w,t$ we want the length of the shortest path from $s$ to $t$ that must pass through $w$.Con...
2 2 votes
1 1 answer
101
101 views
What is the primary reason to use Floyd's algorithm for the all-pairs shortest-path problem instead of Dijkstra's algorithm?Faster for dense graphs. Faster for sparse gra...
1 1 vote
1 1 answer
137
137 views
Let $G$ be a directed graph with nonnegative edge weights.Run Dijkstra's algorithm from source $s$. After the algorithm terminates, use the $\text{prev}$ pointers to cons...
0 0 votes
1 1 answer
77
77 views
Suppose every edge weight of a graph is either:a positive integer, or exactly $-1$.Consider the statement:Dijkstra's algorithm will always compute the correct shortest-pa...
3 3 votes
1 1 answer
163
163 views
Consider the following code executed while processing vertex $v$:for each edge e in G.adj(v): w = e.to() if dist[w] dist[v] + e.weight(): dist[w] = dist[v] + e.weight() ...
1 1 vote
1 1 answer
92
92 views
1 1 vote
3 3 answers
574
574 views
Which of the following algorithms use Greedy strategy?Dijkstra's algorithmKruskal's algorithmHuffman codingBellman-Ford algorithmChoose the correct answer from the option...
0 0 votes
1 1 answer
468
468 views
What is the Time Complexity of the Dijkstra when it is using Adjacency list + Array (sorted or unsorted ) ? If it is O( V^2 + E ) then ,According to the General form of A...
0 0 votes
2 2 answers
174
174 views
Consider the below weighted graph where weight of the edge $e$ is written as $w(e).$If we run Dijkstra's algorithm with $s=0$, in which order will the vertices be deleted...
0 0 votes
1 1 answer
232
232 views
Consider the following directed, weighted graph:Even though the graph has negative weight edges, we use Dijkstra’s algorithm to calculate supposedly shortest paths from A...
0 0 votes
0 0 answers
377
377 views
3 3 votes
1 1 answer
2.3k
2.3k views
Match the following:(A) Floyd Warshall(i) shortest path between two vertices(B) Dijkstra(ii) single source shortest path(C) Kruskal's(iii) Minimum spanning tree(D) Bellma...
0 0 votes
0 0 answers
480
480 views
Match $\text{List I}$ with $\text{List II}$$\text{List I}$$\text{List II}$$\text{A}$. Dijkstra's Algorithm$\text{I}$. Calculates path matrix$\text{B}$. Prim's Algorithm$\...