Graph Theory · Discrete Mathematics
86 questions · asked in 25 of 27 years (2000–2026)
MCQ 59 · MSQ 9 · NAT 181-mark 55 · 2-mark 31
2000Questions per year2026
Questions 76–80 of 86
Let G = (V,E) be a directed graph with n vertices. A path from to in G is a sequence of vertices (,,....., ) such that (,)E for all k in i through j - 1. A simple path is a path in which no vertex appears more than once.
Let A be an n x n array initialized as follows.
Consider the following algorithm
Let A be an n x n array initialized as follows.
Consider the following algorithm
for i = 1 to n
for j = 1 to n
for k = 1 to n
A [j , k] = max (A[j, k], A[j, i] + A [i, k]); Which of the following statements is necessarily true for all j and k after termination of the above algorithm?Answer: (D)
The loop is a Floyd-Warshall style update with sums: . Values only grow.
Why D holds. Claim: after iteration i, is at least the number of edges of every simple path from j to k whose middle vertices are among . For , the paths are single edges, and those have . A simple path that uses i only once splits at i into a path from j to i and a path from i to k, both with middle vertices below i. By the claim for the earlier iteration, and are at least their lengths, so the update gives the length of the whole path. After the last iteration the claim covers every simple path. So every simple path from j to k has at most edges.
Why A, B, C fail.
- Graph with one edge 1 to 2: the final array is . but there is no Hamiltonian cycle, so B fails. The longest path from 1 to 2 has length 1 but , so C fails.
- Graph with edges 1 to 2 and 2 to 1: the final array is . , so A fails.
Answer: (D)
Why D holds. Claim: after iteration i, is at least the number of edges of every simple path from j to k whose middle vertices are among . For , the paths are single edges, and those have . A simple path that uses i only once splits at i into a path from j to i and a path from i to k, both with middle vertices below i. By the claim for the earlier iteration, and are at least their lengths, so the update gives the length of the whole path. After the last iteration the claim covers every simple path. So every simple path from j to k has at most edges.
Why A, B, C fail.
- Graph with one edge 1 to 2: the final array is . but there is no Hamiltonian cycle, so B fails. The longest path from 1 to 2 has length 1 but , so C fails.
- Graph with edges 1 to 2 and 2 to 1: the final array is . , so A fails.
Answer: (D)
A graph G = (V, E) satisfies |E| 3|V|-6. The min-degree of G is defined as .
Therefore, min-degree of G cannot be
Therefore, min-degree of G cannot be
Answer: (D)
Say every vertex has the minimum degree. Then, by the handshaking lemma, the least number of edges the graph can have is
But the question gives the most edges such a graph can have as
So we put the least number of edges from the handshaking lemma into the given inequality, and we get:
This is clearly not possible, since it is inconsistent.
So the answer is option (D)
How many perfect matching are there in a complete graph of 6 vertices?
Answer: (A)
A perfect matching is a set of edges where every vertex is used exactly once. So a graph with vertices has a perfect matching with edges. If is odd, there is no perfect matching.
Here . The first edge can be picked in ways. The second edge can be picked in ways. The third edge can be picked in way. So the total number of ways . But a perfect matching is a set, so the order of the edges does not matter. All orderings of the edges give the same matching. So the number of perfect matchings .
Another way: think of identical buckets that are to be filled with vertices, with vertices going into each bucket. The first vertex can pair with any of the other vertices and go into a bucket, so there are ways. Now only vertices and buckets are left. Take one vertex. It can pick its partner in ways and go into the second bucket, so ways. Now one bucket and vertices are left. So there is only way to fill the last bucket. Total ways:
Answer: (A)
Here . The first edge can be picked in ways. The second edge can be picked in ways. The third edge can be picked in way. So the total number of ways . But a perfect matching is a set, so the order of the edges does not matter. All orderings of the edges give the same matching. So the number of perfect matchings .
Another way: think of identical buckets that are to be filled with vertices, with vertices going into each bucket. The first vertex can pair with any of the other vertices and go into a bucket, so there are ways. Now only vertices and buckets are left. Take one vertex. It can pick its partner in ways and go into the second bucket, so ways. Now one bucket and vertices are left. So there is only way to fill the last bucket. Total ways:
Answer: (A)
Consider the following graph
Among the following sequences
(I) a b e g h f
(II) a b f e h g
(III) a b f h g e
(IV) a f g h b e
Which are depth first traversals of the above graph?
Among the following sequences
(I) a b e g h f
(II) a b f e h g
(III) a b f h g e
(IV) a f g h b e
Which are depth first traversals of the above graph?
Answer: (D)
Edges of the graph: .
DFS moves from the current vertex to an unvisited neighbour. It goes back (backtracks) only when the current vertex has no unvisited neighbour left.
I : , , , , are all edges to new vertices. Valid.
II : and are not joined by an edge. Also still has unvisited neighbours and , so DFS cannot leave by backtracking. Not valid.
III : , , , , are all edges to new vertices. Valid.
IV : , , , , are all edges to new vertices. Valid.
So I, III and IV are DFS traversals. Options (A) and (C) include II, and (B) leaves out III.
Answer: (D)
DFS moves from the current vertex to an unvisited neighbour. It goes back (backtracks) only when the current vertex has no unvisited neighbour left.
I : , , , , are all edges to new vertices. Valid.
II : and are not joined by an edge. Also still has unvisited neighbours and , so DFS cannot leave by backtracking. Not valid.
III : , , , , are all edges to new vertices. Valid.
IV : , , , , are all edges to new vertices. Valid.
So I, III and IV are DFS traversals. Options (A) and (C) include II, and (B) leaves out III.
Answer: (D)
Let G be an arbitrary graph with n nodes and k components. If a vertex is removed from G, the number of components in the resultant graph must necessarily lie between.
Answer: (C)
Removing one vertex from leaves vertices.
Lower bound: the number of components can drop to . This happens when is an isolated vertex that formed a component by itself. It cannot drop further, since removing one vertex can remove at most one whole component. If is not isolated, the count stays the same or goes up.
Upper bound: only vertices remain, so there can be at most components. This can be reached. Take a component where one vertex is joined to all the other vertices, as in a star. Let all the vertices outside this component be isolated. Now remove that one vertex. All the other vertices become isolated, which gives components.
So the number of components lies between and , and both ends can occur. Option (B) is too narrow, since a star's centre gives more than components. Options (A) and (D) have a wrong lower end, since can occur.
Answer: (C)
Lower bound: the number of components can drop to . This happens when is an isolated vertex that formed a component by itself. It cannot drop further, since removing one vertex can remove at most one whole component. If is not isolated, the count stays the same or goes up.
Upper bound: only vertices remain, so there can be at most components. This can be reached. Take a component where one vertex is joined to all the other vertices, as in a star. Let all the vertices outside this component be isolated. Now remove that one vertex. All the other vertices become isolated, which gives components.
So the number of components lies between and , and both ends can occur. Option (B) is too narrow, since a star's centre gives more than components. Options (A) and (D) have a wrong lower end, since can occur.
Answer: (C)
Keep practising