edited by
5,184 views
1 1 vote

Consider the multistage graph with $\mathrm{K}=5$ then find out minimum cost from S to T ?

  1. $1 \rightarrow 3 \rightarrow 6 \rightarrow 8 \rightarrow 9$
  2. $1 \rightarrow 2 \rightarrow 6 \rightarrow 8 \rightarrow 9$
  3. $1 \rightarrow 5 \rightarrow 7 \rightarrow 9$
  4. $1 \rightarrow 2 \rightarrow 6 \rightarrow 7 \rightarrow 9$

3 Answers

3 3 votes
This is not a multi-stage graph since, in a multistage graph, edges can only be present between stage i and stage (i+1). Here, we have an edge from 1 to 5 i.e. stage 1 to stage 3 which is not correct.
2 2 votes

Option B

Multi stage graph if we follow greedy strategy answer will not always be optimum . Dynamic Approch is prefered here .


Like @anirudh said  for short-cut

Start  with End vertex and traverse to  start vertex with minmum cost every time


For General Approch . Watch this (https://www.youtube.com/watch?v=m5Y-4TsXsJ0)

Good Read

2 2 votes
In this A and B both are havinng same cost, but if we follow greedy approach it will not give A as answer as till it ll not get less cost it will use previous only and from dynamic both answers are correct so B should be the answer.

In multistage we start from end vertex not from starting vertex if we start from starting vertex then A should be the answer but according to  multistage algo B should be the answer.
Position:
Show:

Related questions

5 5 votes
2 answers 2 answers
1.8k
1.8k views
jenny101 asked Oct 26, 2016
1,771 views
S1: In a weighted graph, assume that the shortest path from a source 's' to a destination 't' is correctly calculated using a shortest path algorithm. Is the following st...
1 1 vote
1 answers 1 answer
1.1k
1.1k views
jenny101 asked Oct 26, 2016
1,058 views
Q43.Given that s is the source vertex, what is the total length of the shortest path tree?
1 1 vote
1 1 answer
224
224 views
GO Classes asked Oct 16, 2024
224 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...
0 0 votes
0 0 answers
702
702 views
Vaishnavi01 asked Nov 19, 2018
702 views