• edited by
393 views
2 2 votes

Consider a directed graph $G$ with a source vertex $s, a$ destination $t$, and nonnegative edge lengths. Under what conditions is the shortest $s-t$ path guaranteed to be unique?

  1. When all edge lengths are distinct positive integers.
  2. When all edges lengths are distinct positive integers and the graph $G$ contains no directed cycles.
  3. When all edge lengths are distinct powers of $2.$
  4. None of the other options are correct.

1 Answer

8 8 votes
Consider a graph $G$ with edges
$$s \stackrel{1}{\longrightarrow} v, v \stackrel{2}{\longrightarrow} t, s \stackrel{3}{\longrightarrow} t.$$
Even though all edge lengths are distinct positive integers, there exist two shortest paths, $s \rightarrow v \rightarrow t$, and $s \rightarrow t$; thus, option A is incorrect. $G$ doesn't contain a directed cycle, and yet, it doesn't have a unique shortest path; thus, option B is incorrect.

Now observe that two sums of distinct powers of two cannot be the same (imagine the numbers are written in binary); thus, option C is correct, and option D is incorrect.
Answer:
Position:
Show:

Related questions

0 0 votes
2 2 answers
266
266 views
GO Classes asked Oct 16, 2024
266 views
Which of the following is/are TRUE ?If we perform DFS on an undirected graph, there are no cross edges.If the DFS tree has no back edges, then there are no cycles in the ...
1 1 vote
1 1 answer
340
340 views
GO Classes asked Oct 16, 2024
340 views
Which of the following is correct option about $\mathrm{S} 1$ and $\mathrm{S} 2?$$\mathrm{S} 1:$ If $\text{G}$ is a weighted graph with $n$ vertices and $m$ edges that do...
1 1 vote
1 1 answer
284
284 views
GO Classes asked Oct 16, 2024
284 views
Each of the figures below represents a partial spanning tree with bold edges. Determine whether it could possibly be obtained from (a prematurely stopped) Prim’s algorith...
1 1 vote
1 1 answer
246
246 views
GO Classes asked Oct 16, 2024
246 views
Let $\text{G = (V, E)}$ be a weighted directed graph. The shortest path from a node $s \in \text{V}$ to a node $t \in \text{V}$ will remain unchanged if: (Multiple option...