Graph Minimum Spanning Tree


123
Question 1
An undirected graph G(V, E) contains n ( n > 2 ) nodes named v1 , v2 ,….vn. Two nodes vi , vj are connected if and only if 0 < |i – j| <= 2. Each edge (vi, vj ) 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? (GATE CS 2011) gate_2011_4
A
1/12(11n^2 – 5n)
B
n^2 – n + 1
C
6n – 11
D
2n + 1
Graph Minimum Spanning Tree    
Discuss it


Question 1 Explanation: 
Question 2
The length of the path from v5 to v6 in the MST of previous question with n = 10 is
A
11
B
25
C
31
D
41
Graph Minimum Spanning Tree    
Discuss it


Question 2 Explanation: 
Question 3
Consider a complete undirected graph with vertex set {0, 1, 2, 3, 4}. Entry Wij in the matrix W below is the weight of the edge {i, j}. What is the minimum possible weight of a spanning tree T in this graph such that vertex 0 is a leaf node in the tree T? (GATE CS 2010) 2010
A
7
B
8
C
9
D
10
Graph Minimum Spanning Tree    
Discuss it


Question 3 Explanation: 
To get the minimum spanning tree with vertex 0 as leaf, first remove 0th row and 0th column and then get the minimum spanning tree (MST) of the remaining graph. Once we have MST of the remaining graph, connect the MST to vertex 0 with the edge with minimum weight (we have two options as there are two 1s in 0th row).
Question 4
In the graph given in above question question, what is the minimum possible weight of a path P from vertex 1 to vertex 2 in this graph such that P contains at most 3 edges?
A
7
B
8
C
9
D
10
Graph Minimum Spanning Tree    
Discuss it


Question 4 Explanation: 
Path: 1 -> 0 -> 4 -> 2 Weight: 1 + 4 + 3
Question 5
An undirected graph G has n nodes. Its adjacency matrix is given by an n × n square matrix whose (i) diagonal elements are 0‘s and (ii) non-diagonal elements are 1‘s. which one of the following is TRUE?
A
Graph G has no minimum spanning tree (MST)
B
Graph G has a unique MST of cost n-1
C
Graph G has multiple distinct MSTs, each of cost n-1
D
Graph G has multiple spanning trees of different costs
Graph Minimum Spanning Tree    
Discuss it


Question 6
Consider the following graph: gate_2006 Which one of the following cannot be the sequence of edges added, in that order, to a minimum spanning tree using Kruskal’s algorithm?
A
(a—b),(d—f),(b—f),(d—c),(d—e)
B
(a—b),(d—f),(d—c),(b—f),(d—e)
C
(d—f),(a—b),(d—c),(b—f),(d—e)
D
(d—f),(a—b),(b—f),(d—e),(d—c)
Graph Minimum Spanning Tree    
Discuss it


Question 6 Explanation: 
The edge (d-e) cannot be considered before (d-c) in Kruskal's minimum spanning tree algorithm because Kruskal’s algorithm picks the edge with minimum weight from the current set of edges at each step.
Question 7
Let G be an undirected connected graph with distinct edge weight. Let emax be the edge with maximum weight and emin the edge with minimum weight. Which of the following statements is false? (GATE CS 2000)
A
Every minimum spanning tree of G must contain emin
B
If emax is in a minimum spanning tree, then its removal must disconnect G
C
No minimum spanning tree contains emax
D
G has a unique minimum spanning tree
Graph Minimum Spanning Tree    
Discuss it


Question 7 Explanation: 
(a) and (b) are always true. (c) is false because (b) is true. (d) is true because all edge weights are distinct for G.
Question 8
Consider a weighted complete graph G on the vertex set {v1,v2 ,v} such that the weight of the edge (v,,v) is 2|i-j|. The weight of a minimum spanning tree of G is: (GATE CS 2006)
A
n — 1
B
2n — 2
C
nC2
D
2
Graph Minimum Spanning Tree    
Discuss it


Question 8 Explanation: 
Minimum spanning tree of such a graph is
v1
  \
    v2
      \
       v3
         \
          v4
            .
              .
                .
                 vn
 
Weight of the minimum spanning tree = 2|2 - 1| + 2|3 - 2| + 2|4 - 3| + 2|5 - 4| .... + 2| n - (n-1) | = 2n - 2
Question 9
Let G be a weighted graph with edge weights greater than one and G'be the graph constructed by squaring the weights of edges in G. Let T and T' be the minimum spanning trees of G and G', respectively, with total weights t and t'. Which of the following statements is TRUE?
A
T' = T with total weight t' = t2
B
T' = T with total weight t' < t2
C
T' != T but total weight t' = t2
D
None of the above
GATE CS 2012    Graph Minimum Spanning Tree    
Discuss it


Question 9 Explanation: 
Squaring the weights of the edges in a weighted graph will not change the minimum spanning tree. Assume the opposite to obtain a contradiction. If the minimum spanning tree changes then at least one edge from the old graph G in the old minimum spanning tree T must be replaced by a new edge in tree T' from the graph G' with squared edge weights. The new edge from G' must have a lower weight than the edge from G. This implies that there exists some weights C1 and C2 such that C1 < C2 and C12 >= C22. This is a contradiction. Source: http://www.cs.nyu.edu/courses/spring06/V22.0310-001/hw3.htm Sums of squares of two or more numbers is always smaller than square of sum. Example: 2^2 + 2^2 < (4)^2 But
there is one counter example when the graph has only one edge.  
         In that case, the two values are same. 
Question 10
Consider the following graph: CSE_2009_38 Which one of the following is NOT the sequence of edges added to the minimum spanning tree using Kruskal's algorithm?
A
(b,e)(e,f)(a,c)(b,c)(f,g)(c,d)
B
(b,e)(e,f)(a,c)(f,g)(b,c)(c,d)
C
(b,e)(a,c)(e,f)(b,c)(f,g)(c,d)
D
(b,e)(e,f)(b,c)(a,c)(f,g)(c,d)
Graph Minimum Spanning Tree    GATE-CS-2009    
Discuss it


Question 10 Explanation: 
In the sequence (b, e) (e, f) (b, c) (a, c) (f, g) (c, d) given option D, the edge (a, c) of weight 4 comes after (b, c) of weight 3. In Kruskal's Minimum Spanning Tree Algorithm, we first sort all edges, then consider edges in sorted order, so a higher weight edge cannot come before a lower weight edge.
There are 21 questions to complete.
123

Company Wise Coding Practice    Topic Wise Coding Practice