GATE 2008
185 questions
MCQ 1851-mark 52 · 2-mark 133
Questions 21–25 of 185
Answer: (B)
The chromatic number of a graph is the least number of colors that can color its vertices so that no two adjacent vertices get the same color.
At least colors. The curved edge joins the top-left and bottom-right corners. A path of edges along the grid joins the same two corners (along the top row, then down the right column). Together with the curved edge this gives a cycle of edges. With colors, the colors would have to alternate all the way round the cycle, which an odd cycle cannot do. So an odd cycle needs at least colors (an even cycle needs only ).
colors are enough. The colored figure above uses shades, and no edge joins two vertices of the same shade.
So the chromatic number is .
Answer: (B)
Answer: (C)
- BFS starts at . Its neighbours must all be visited before , which is two steps away. Here comes before and , so this is wrong.
- BFS starts at . Its neighbours are , but is not one of them. So must come before . Here it does not, so this is wrong.
- Start at . Its neighbours go into the queue. Visit : joins the queue. Visit : joins the queue. Visit : nothing new. The queue now gives and then . The order is , which is a valid BFS order.
- Here is visited before , so 's new neighbour is queued before 's new neighbour . So must be visited before , and this order is wrong.
Answer: (C)
Answer: (C)
With adjacency lists, each vertex is visited once, which costs . Each edge is looked at from both of its ends, which costs . So the total time is .
No algorithm can do better in general. It must look at every vertex (for example, isolated vertices give components) and every edge (a single unread edge can join two components). So (A) and (B) are too small, and (D) is larger than needed.
Answer: (C)
Answer: (C)
Why the others are not true for every planar graph:
(A) Two isolated vertices form a planar graph that is not connected.
(B) A path on 3 vertices is planar, but its end vertices have degree 1 (odd), so it has no Euler circuit.
(D) is planar with , but any two of its vertices are adjacent, so its largest independent set has size 1, which is less than .
Answer: (C)
Answer: (A)
We can place red balls into distinct boxes in this many ways:
We can place blue balls into the boxes in this many ways:
Using the product rule, the total number of ways is
So the answer is (A).