GATE 2005
203 questions
MCQ 2031-mark 203
Questions 121–125 of 203
Let s and t be two vertices in a undirected graph G=(V, E) having distinct positive edge weights. Let [X, Y] be a partition of V such that sX and tY. Consider the edge e having the minimum weight amongst all those edges that have one vertex in X and one vertex in Y.
The edge e must definitely belong to:
The edge e must definitely belong to:
Answer: (A)
(A) True (cut property). Suppose an MST does not contain . Adding to makes a cycle, and the cycle must cross between and again at another edge . Weights are distinct and is the lightest crossing edge, so is heavier. Then is a lighter spanning tree, which is impossible. So is in the MST.
The others can fail:
The others can fail:
Let , , , , . The crossing edges are AC (1) and AB (4), so .
(B) The shortest path from A to B is the direct edge AB (4); the other path A-C-D-B costs 6. It does not contain AC.
(C) The path AB is a path from s to t without AC.
(D) Take a triangle with , , . Then , but the longest path s-u-t (weight 5) does not contain it.
Answer: (A)
An undirected graph G has n nodes. Its adjacency matrix is given by an nxn square matrix whose
(i) diagonal elements are 0's and
(ii) non-diagonal elements are 1's.
which one of the following is TRUE?
(i) diagonal elements are 0's and
(ii) non-diagonal elements are 1's.
which one of the following is TRUE?
Answer: (C)
Graph has many different MSTs, and each one has cost .
The given graph is a complete graph, and every edge has weight . An MST has edges. So the weight of the MST is .
The graph has more than one MST. In fact, every spanning tree of this graph is also an MST, because all the edge weights are equal.
Answer: (C)
The given graph is a complete graph, and every edge has weight . An MST has edges. So the weight of the MST is .
The graph has more than one MST. In fact, every spanning tree of this graph is also an MST, because all the edge weights are equal.
Answer: (C)
Let be a directed graph whose vertex set is the set of numbers from 1 to 100. There is an edge from a vertex to a vertex iff either or . The minimum number of edges in a path in G from vertex 1 to vertex 100 is
Answer: (B)
Searching from 1 forward has many branches, so search backward from 100. The predecessors of are , and also when 3 divides . Number the sets by distance from 100:
- 0: 100
- 1: 99
- 2: 98, 33
- 3: 97, 32, 11
- 4: 96, 31, 10
- 5: 95, 30, 9
- 6: 94, 29, 8, 3
- 7: contains 1 (from 3)
1 first appears at distance 7, so no path has fewer than 7 edges. The forward path is , with 7 edges.
Answer: (B)
- 0: 100
- 1: 99
- 2: 98, 33
- 3: 97, 32, 11
- 4: 96, 31, 10
- 5: 95, 30, 9
- 6: 94, 29, 8, 3
- 7: contains 1 (from 3)
1 first appears at distance 7, so no path has fewer than 7 edges. The forward path is , with 7 edges.
Answer: (B)
Let s and t be two vertices in a undirected graph G=(V, E) having distinct positive edge weights. Let [X, Y] be a partition of V such that sX and tY. Consider the edge e having the minimum weight amongst all those edges that have one vertex in X and one vertex in Y.
Let the weight of an edge e denote the congestion on that edge. The congestion on a path is defined to be the maximum of the congestions on the edges of the path. We wish to find the path from s to t having minimum congestion. Which one of the following paths is always such a path of minimum congestion?
Let the weight of an edge e denote the congestion on that edge. The congestion on a path is defined to be the maximum of the congestions on the edges of the path. We wish to find the path from s to t having minimum congestion. Which one of the following paths is always such a path of minimum congestion?
Answer: (A)
The congestion of a path is its largest edge weight, so we want a path whose largest edge is as small as possible.
Why the MST path works. Take the path from to in the minimum spanning tree and let be its heaviest edge, with weight . Remove from the tree. The tree splits into two parts, with in one and in the other. By the cut property, is the lightest edge crossing this cut (otherwise swapping it for a lighter crossing edge would give a lighter tree). Every path from to must cross the cut, so it uses an edge of weight at least . So no path has congestion below , and the MST path has exactly .
Other options. In the figure, the shortest weighted path is the direct edge with weight 6, and its congestion is 6. The MST has edges 2, 3 and 4, and its path has congestion . So option B can fail (the path has total weight 7, which is longer, but congestion is the only thing that counts here). An Euler walk uses every edge, so its congestion is the heaviest edge in the whole graph (6 here). A Hamiltonian path must visit every vertex, so it can be forced onto heavy edges, and it may not exist at all.
Answer: (A)
Let G(V,E) be an undirected graph with positive edge weights. Dijkstra's single source shortest path algorithm can be implemented using the binary heap data structure with time complexity:
Answer: (D)
Option : Uses a binary heap. There are decrease key operations, and each takes time. There are extract-min operations, and each takes .
Option : Uses a Fibonacci heap. There are decrease key operations, and each takes time. There are extract-min operations, and each takes .
Option : Uses an array. Finding the min-vertex in each iteration takes . This is done times.
A Binomial Heap works the same as a Binary heap here, because the main operations are decrease key and extract-min.
Correct Answer:
Option : Uses a Fibonacci heap. There are decrease key operations, and each takes time. There are extract-min operations, and each takes .
Option : Uses an array. Finding the min-vertex in each iteration takes . This is done times.
A Binomial Heap works the same as a Binary heap here, because the main operations are decrease key and extract-min.
Correct Answer: