Recent questions tagged shortest-path

14 14 votes
5 5 answers
1.8k
1.8k views
Consider two statements $\text{S1}$ and $\text{S2}.$$\text{S1}:$ To find a shortest path for a graph with negative weights, we can eliminate negative edges by adding the ...
11 11 votes
3 3 answers
1.5k
1.5k views
Consider two statements $\text{S1}$ and $\text{S2}$.$\text{S1}:$ To solve the single-source-shortest-paths (SSSP) problem for a graph with no negative-weight edges, it is...
12 12 votes
1 answers 1 answer
1.6k
1.6k views
Consider two statements $\text{S1}$ and $\text{S2}.$The graph is stored in the Adjacency list.$\text{S1}:$ Assume that you are given a magical priority queue data structu...
11 11 votes
1 1 answer
1.8k
1.8k views
Which of the following is/are FALSE?Let $\text{G = (V, E)}$ be a weighted graph and let $\text{M}$ be a minimum spanning tree of $\text{G}$. The path in $\text{M}$ betwee...
10 10 votes
1 1 answer
1.0k
1.0k views
$\text{G}$ is a directed graph with negative weight edges but NO negative weight cycles. Which of the following hold for Dijkstra’s algorithm on $\text{G}:$Dijkstra’s alg...
48 48 votes
3 3 answers
2.1k
2.1k views
Given an undirected, weighted graph $\mathrm{G}$ with positive, integer edge weights, we want to find a path shortest path from $u$ to $v$ with the below condition.The co...
1 1 vote
0 0 answers
1.2k
1.2k views
Consider the directed graph shown in the figure below. There are multiple shortest paths between vertices $\text{S}$ and $\text{T}$. Which one will be reported by Dijkstr...
2 2 votes
0 0 answers
804
804 views
Consider three processes, all arriving at time zero, with total execution time of $10, 20$ and $30\; \text{units,}$ respectively. Each process spends the first $20 \%$ of...
0 0 votes
2 2 answers
781
781 views
Which of the following can be the best algorithm(s) for all pair of the shortest path problem?I. ‘V’ invocations of Dijkstra algorithm ⇒ Ο(VE logV).II. ‘V’ invocations of...
0 0 votes
1 1 answer
1.7k
1.7k views
Consider the following strategy to convert a graph with negative edge weights to one that does not have negative edge weights. Let the maximum magnitude negative edge wei...
0 0 votes
1 answers 1 answer
2.0k
2.0k views
Consider the following strategy to solve the single source shortest path problem with edge weights from source s.1. Replace each edge with weight w by w edges of weight 1...
0 0 votes
1 1 answer
1.1k
1.1k views
Let G be a weighted connected undirected graph with distinct positive edge weights.If every edge weight is increased by the same value, then which of the following statem...
0 0 votes
1 1 answer
729
729 views
1 1 vote
2 2 answers
1.9k
1.9k views
Consider a weighted directed graph. The current shortest distance from source $S$ to node $x$ is represented by $d[x]$. Let $d[v] =29$, $d[u]=15$, $w[u,v]=12$. What is th...
0 0 votes
1 1 answer
1.5k
1.5k views
When using Dijkstra’s algorithm to find shortest path in a graph, which of the following statement is not true?It can find shortest path within the same graph data struct...
0 0 votes
3 3 answers
2.5k
2.5k views
The time required to find the shortest path in a graph with $n$ vertices and $e$ edges is:$O(e)$$O(n)$$O(e^{2})$$O(n^{2})$
26 26 votes
2 answers 2 answers
8.5k
8.5k views
There are multiple routes to reach from node $1$ to node $2$, as shown in the network.The cost of travel on an edge between two nodes is given in rupees. Nodes $\text{‘}a...
93 93 votes
9 answers 9 answers
34.1k
34.1k views
Let $G = (V,E)$ be a directed, weighted graph with weight function $w: E \rightarrow \mathbb{R}$. For some function $f: V \rightarrow \mathbb{R}$, for each edge$(u,v)\in ...
7 7 votes
3 3 answers
1.4k
1.4k views
Let $G=(V, E)$ be an undirected simple graph, and $s$ be a designated vertex in $G.$ For each $v\in V,$ let $d(v)$ be the length of a shortest path between $s$ and $v.$ ...