• edited by
1,738 views
4 4 votes

The following diagram shows the set of edges (in thick black lines) selected at some intermediate step of an MST algorithm. Lighter edges are not yet in MST.


Assume that we got above the intermediate state using Kruskal’s algorithm.

What would be the maximum value of $x+y-z ?$

  1. $100$
  2. $110$
  3. $120$
  4. $130$

1 Answer

3 3 votes

Please watch this video after 47:16 – https://youtu.be/UbGDzdW7UjY?list=PLIPZ2_p3RNHjUCHdJp-_soSSmhgmO4i0T&t=2836

This video will clarify very important concept regarding finiding missing edge cost in MST.

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

Temporarily we have removed all the light colored edges (except z).


It is easy to see that every vertex is connected except D. 
In the next step Kruskal’s will be choosing one of the edge to connect D. 
One of the edge among $120, 100$ or $z$ will become MST edge and all edges are non MST edges.

Now applying the method discussed in above video.

  • $130$ and $140$ makes  cycle with $x$ hence $x \leq 130$ and $x \leq 140$
  • $130$ and $80$ makes cycle with $y$ hence $y \leq 130$ and $y \leq 80$

Let us determine $z$ now – 

Out of three choices among $120, 110$ and $z,$ Kruskal’s will choose one of them depending on value of $z.$

Kruskal’s algorithm works step by step by traversing edges in their increasing cost value.

Algo has not selected $z$ yet, it means $z$ is greater than equal to all thick edges.

$z \geq max(90, x, y)$.

$\mathrm{x}$ and $\mathrm{y}$ can take any small values too hence  $z \geq 90$.

To maximize $x+y-z, x$ and $y$ should have maximum value and $z$ should have minimum value. Answer is $130+80-90=120.$

• edited by
Answer:
Position:
Show:

Related questions

3 3 votes
2 2 answers
2.4k
2.4k views
GO Classes asked Mar 26, 2023
2,407 views
Suppose that a MST of the following edge-weighted graph contains the edges with weights $x, y$, and $z$.What will be the maximum value of $x+y+z?$$200$$250$$300$$350$
1 1 vote
1 1 answer
781
781 views
GO Classes asked Apr 7, 2023
781 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...
3 3 votes
2 2 answers
1.3k
1.3k views
GO Classes asked Apr 7, 2023
1,327 views
Let $$T(n)=\sqrt{n} \cdot T(\sqrt{n})+n$$What will be asymptotic bound on $T(n) ?$$\Theta(\sqrt{n} \log n)$$\Theta(\log \log n)$$\Theta(n \log \log n)$$\Theta(\sqrt{n} \l...
1 1 vote
1 1 answer
748
748 views
GO Classes asked Apr 7, 2023
748 views
Which of the following statement is/are FALSE? Assume that $\log$ base is $2$ in all options.$8^{\log \left(n^{2}\right)} \in \Theta\left(n^{6}\right)$If $f, g$, and $h$ ...