• edited by
27,203 views
74 74 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$

11 Answers

Best answer
63 63 votes

Q 54. Answer is B.

$\text{ We observe a pattern in the weight of MST being formed }$

$\text{ For n=3 } (1+2+3)+(1)$
$\text{ For n=4 } (1+2+3+4)+(1+2)$
$\text{ For n=5 } (1+2+3+4+5)+(1+2+3)$
$\text{ These can be obtained by drawing graphs for these graphs. }$
$\therefore \text{ Total weight of MST is } \sum_{i=1}^{n}i+\sum_{i=1}^{n-2}i=n^2-n+1\\$

• edited by
12 12 votes

Start from initial vertex and add each vertex at a time with its minimum weight edge.

6 6 votes

One more way to prove the same thing is as follow --> 

4 4 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

4 4 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).

Answer:
Position:
Show:

Related questions

60 60 votes
7 answers 7 answers
20.8k
20.8k views
go_editor asked Apr 21, 2016
20,774 views
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 ...
75 75 votes
4 answers 4 answers
24.5k
24.5k views
go_editor asked Sep 29, 2014
24,549 views
On a non-pipelined sequential processor, a program segment, which is the part of the interrupt service routine, is given to transfer $500$ bytes from an I/O device to mem...
15 15 votes
3 answers 3 answers
5.1k
5.1k views
Misbah Ghaya asked Oct 24, 2015
5,096 views
Let $G$ be a connected simple graph (no self-loops or parallel edges) on $n\geq 3$ vertices, with distinct edge weights. Let $e_{1}, e_{2},...,e_{m}$ be an ordering of th...
28 28 votes
2 answers 2 answers
9.3k
9.3k views
go_editor asked Apr 21, 2016
9,250 views
Consider the following recursive C function that takes two arguments.unsigned int foo(unsigned int n, unsigned int r) { if (n>0) return ((n%r) + foo(n/r, r)); else return...