edited by
17,226 views
52 votes
52 votes

An undirected graph $G(V,E)$ contains $n \: (n>2)$ nodes named $v_1,v_2, \dots, v_n$. Two nodes $v_i, v_j$  are connected if and only if $ 0 < \mid i-j\mid \leq 2$. Each edge $(v_i,v_j)$ is assigned a weight $i+j$. A sample graph with $n=4$ is shown below.

What will be the cost of the minimum spanning tree (MST) of such a graph with $n$ nodes?

  1. $\frac{1}{12} (11n^2 - 5 n)$
  2. $n^2-n+1$
  3. $6n-11$
  4. $2n+1$
edited by

10 Answers

3 votes
3 votes

ANSWER is B:

The pattern that goes with the solution:.

 For n=3 (1+2+3)+(1) 
 For n=4 (1+2+3+4)+(1+2)
 For n=5 (1+2+3+4+5)+(1+2+3) 


For n=  {n(n+1)/2 } + {(n-2)(n-2+1)/2}

         ={(n2+n)/2} + {(n2-3n+2)/2}

         =(n2-3n+2+n2+n)/2

         =n2-n+1

2 votes
2 votes

Try putting n=4, MST 13, every option satisfies except D.

Try n=3. MST 7, the subgraph {v1 v2 v3} will tell you the MST in the given graph. It satisfies all the options.

So seeing no other way, add v5, connect it to v4, v3, We connect only v3 and v4 with v5 bcs of the condition given 0< ∣i−j∣ ≤2. 

The v4-v5 edge weight is 5+4 = 9 and v3-v5 edge wight is 8.

The MST cost of the graph = 21.

now only option B satisfies.

Ans (B).

0 votes
0 votes
I drew a graph for n=10 and found answer for Q54) as B and answer for Q55) as C

BUT that is a messy and time consuming procedure ... does anyone have a better approach to the given problem ?
0 votes
0 votes

$Cost = (v_1 +(v_1+ vertex_d=1))+[\{v_1+(v_1+vertex_d=\color{Red}2)\}+\{v_2+(v_2+vertex_d=\color{Red}2)\}+\{v_3+(v_3+vertex_d=\color{Red}2)\}+\{v_4+(v_4+vertex_d=\color{Red}2)\}+......+\{v_{n-2}+(v_{n-2}+vertex_d=\color{Red}2)\}]$

$= (1 +(1+1))+[\{1+(1+\color{Red}2)\}+\{2+(2+\color{Red}2)\}+\{3+(3+\color{Red}2)\}+\{4+(4+\color{Red}2)\}+......+\{(n-2)+((n-2)+\color{Red}2)\}]$

$= 3+ [2*\{1+2+3+4+....+(n-2)\} + \color{Red}2*(n-2)] $

$= 3 + 2*[(n-2)(n-1)/2] + \color{Red}2*(n-2)$

$= 3 + (n-2)[n-1+2]$

$= n^2 -n +1$

where, $vertex_d$ = distance from current vertex

$Explanation:$

Here with the given conditions, you have to pick "ALL THE EDGES" from least labelled vertex (as they will be the one with least weights) such that you don't end up in a cycle.

Hence, from vertex $v_1$ possible edges are $v_1$$v_{2(1+1)}$ and $v_1$$v_{3(1+2)}$, from vertex $v_2$ edges are $v_2$$v_3$ and $v_2$$v_4$ but since vertex $v_3$ is already covered by edge $v_1$$v_3$ you need not pick $v_2$$v_3$. You will soon realize that vertex only with distance 2 from current vertex are taken (except for vertex $v_1$ which has the base case edge $v_1v_2$).The last term in the series will be for $v_{n-2}$ as it will cover the last vertex $v_n$.

Answer:

Related questions

26 votes
26 votes
1 answer
2
Kathleen asked Oct 9, 2014
5,182 views
A complete, undirected, weighted graph $G$ is given on the vertex $\{0, 1,\dots, n -1\}$ for any fixed ‘n’. Draw the minimum spanning tree of $G$ ifthe weight of the ...