chapter
    Graph Coloring, Covers, Matrices and Special Graphs Practice Questions for GATE CS

    Solve 126+ Graph Coloring, Covers, Matrices and Special Graphs practice questions for GATE CS with answers and detailed solutions. Free sample questions below

    Try a question

    Answer it here to see how it works. Nothing is recorded until you sign in.

    Question 1
    Level 1: Warm-up

    Let be the adjacency matrix of a simple undirected graph. Which of the following statements is ALWAYS TRUE regarding the matrix for any integer ?

    Question 2
    Level 1: Warm-up

    In a simple undirected graph, the entry represents the number of walks of length 3 from vertex to itself. What is the minimum number of distinct triangles containing if ?

    Question 3
    Level 1: Warm-up

    Match the graph property in List I with its corresponding mathematical value or formula in List II for a simple undirected graph with adjacency matrix .

    List I

    P. Number of triangles in

    Q. The entry

    R. The trace of

    List II

    1. Total number of closed walks of length 3 in
    2. Number of closed walks of length 3 from to

    Select the correct matching from the options below.

    Question 4
    Level 1: Warm-up

    Let be the adjacency matrix of a simple undirected graph . If the trace of is 42, how many triangles does the graph contain?

    Question 5
    Level 1: Warm-up

    A proper -coloring of a graph assigns colors such that for all . For a star graph (1 center, 3 leaves), the number of proper -colorings is calculated by considering the center and leaves separately. If , what is the total number of proper 3-colorings?

    Question 6
    Level 1: Warm-up

    A graph is bipartite if and only if it contains no odd-length cycles. What is the minimum number of edges that must be removed from a complete graph to make it bipartite?

    Question 7
    Level 1: Warm-up

    By considering whether the first and third vertices of a cycle graph have the same or different colors, calculate the number of proper 3-colorings of .

    Question 8
    Level 1: Warm-up

    A graph consists of three disjoint triangles (). What is the minimum number of edges that must be removed from to make it bipartite?

    Question 9
    Level 1: Warm-up

    Let be the adjacency matrix of a simple undirected graph. What does the entry in the matrix represent, where is a positive integer?

    Question 10
    Level 1: Warm-up

    Consider the following two statements about a simple undirected graph with edges and adjacency matrix :

    Assertion (A): The sum of all diagonal entries of is .

    Reason (R): The diagonal entry counts the number of walks of length 2 from to , which equals the degree of , and the sum of degrees of all vertices is .

    Which of the following is correct?

    Free preview ends here

    Login to view the complete practice questions and solutions

    Creating an account is free. You get the rest of this chapter, step-by-step solutions, and a study plan built around the topics you are actually weak at.

    Why MastersUp

    Personalised first. High quality throughout.

    Most platforms hand everyone the same content. Here the content moves with your performance, topic by topic.

    Built around you, not around a syllabus PDF

    Every answer you give moves your topic-level intelligence rate. The next question, the next revision card and tomorrow's plan all change with it.

    Revision that hits your weak spots

    We only revise topics you have actually attempted and are still below the safe bar on — never the same chapter on repeat.

    Questions calibrated to the real exam

    Each question carries a measured toughness. You are served a rung above your current level, so practice keeps stretching you.

    Notes written for recall, not for volume

    Full lesson cards for first study, curated short-note cards for the last mile — with derivations, traps and exam patterns marked.

    One place for everything

    Notes, chapter practice, previous-year questions, test series and full-length papers — all feeding one picture of your preparation.

    Honest progress

    No vanity streaks. Progress here means chapters mastered and accuracy that held up on harder questions.

    Unlock the whole course

    Full notes and short notes, the complete question bank with worked solutions, mock tests, full-length papers, and an adaptive plan that rebuilds itself as you improve.

    Graph Coloring, Covers, Matrices and Special Graphs Practice Questions for GATE CS

    Solve 126+ Graph Coloring, Covers, Matrices and Special Graphs practice questions for GATE CS with answers and detailed solutions. Free sample questions below.

    Chapter Roadmap: Discrete Mathematics Graph Theory

    Chapter Journey: Graph Structures & Algorithms

    1
    Graph Coloring & Bipartite Graphs Current Topic
    • Focus: Chromatic number, proper coloring, bipartiteness.
    • Goal: Determine minimum colors needed; identify 2-colorable graphs.
    • Weight: High frequency in logic-based questions.
    2
    Adjacency Matrices & Walk Counting
    • Focus: Matrix representation, matrix powers for paths, trace for cycles.
    • Goal: Link algebraic properties to graph topology.
    3
    Minimum Vertex Covers
    • Focus: Covering all edges with a minimal set of vertices.
    • Goal: Understand structural constraints and approximation bounds.
    4
    Special Graphs & Isomorphism
    • Focus: Petersen graph properties, Hamiltonian and Eulerian paths.
    • Goal: Recognize standard counter-examples and structural equivalence.

    Hero Concept: Proper Graph Coloring

    What is Graph Coloring?

    A proper coloring of a graph is an assignment of colors to vertices such that no two adjacent vertices share the same color.

    Formally, a function is a proper -coloring if:

    Chromatic Number

    The smallest integer for which has a proper -coloring.

    • If , the graph is -chromatic.
    • If , the graph is -colorable.
    Intuition: Think of colors as "resources" or "time slots." Adjacent vertices compete for resources. tells you the minimum resource pool size required to satisfy all constraints simultaneously.

    Graph Coloring, Covers, Matrices and Special Graphs: Solved Questions with Step-by-Step Explanations (10 Problems)

    Question 1 · Engineering Mathematics MCQ

    Let be the adjacency matrix of a simple undirected graph. Which of the following statements is ALWAYS TRUE regarding the matrix for any integer ?

    1. A.

      The entry gives the number of simple paths of length from to .

    2. B.

      The trace of gives the total number of closed walks of length in the graph.

    3. C.

      The sum of all elements in is equal to the total number of cycles of length .

    4. D.

      The diagonal entries of are always zero for all .

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: This is a bounding/statement truth question that tests the fundamental properties of matrix powers and the constraints of graph traversals.

    Step 1: Evaluate Option A. counts all walks, not just simple paths. Walks allow repeated vertices. Thus, A is false.

    Step 2: Evaluate Option B. The trace of a matrix is the sum of its diagonal entries. The diagonal entry is the number of closed walks of length starting and ending at . Summing over all gives the total number of closed walks of length in the graph. Thus, B is true.

    Step 3: Evaluate Option C. The sum of all elements counts all walks of length , not just cycles. Cycles are simple closed paths. Thus, C is false.

    Step 4: Evaluate Option D. For even , there are closed walks (e.g., for ). Thus, diagonal entries are non-zero for even . D is false.

    Answer: B

    Question 2 · Engineering Mathematics MCQ

    In a simple undirected graph, the entry represents the number of walks of length 3 from vertex to itself. What is the minimum number of distinct triangles containing if ?

    1. A.

      1

    2. B.

      2

    3. C.

      3

    4. D.

      4

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: This is a contradiction/minimum question that tests the distinction between walks and simple cycles, specifically how triangles contribute to the diagonal of .

    Step 1: Recall that a walk of length 3 from to must be of the form .

    Step 2: In a simple graph, to return in exactly 3 steps without immediately backtracking (which would require an even length), the vertices must be distinct.

    Step 3: Thus, every walk of length 3 from to corresponds to a triangle containing .

    Step 4: For any specific triangle containing , there are exactly 2 distinct walks of length 3: one in clockwise order and one in counter-clockwise order.

    Step 5: If , and each triangle contributes exactly 2 walks, the number of triangles is .

    Answer: B

    Question 3 · Engineering Mathematics MCQ

    Match the graph property in List I with its corresponding mathematical value or formula in List II for a simple undirected graph with adjacency matrix .

    List I

    P. Number of triangles in

    Q. The entry

    R. The trace of

    List II

    1. Total number of closed walks of length 3 in
    2. Number of closed walks of length 3 from to

    Select the correct matching from the options below.

    1. A.

      P-2, Q-3, R-1

    2. B.

      P-1, Q-3, R-2

    3. C.

      P-2, Q-1, R-3

    4. D.

      P-3, Q-2, R-1

    Correct Answer:

    A

    Step-by-Step Solution

    Key idea: This question tests the exact definitions of matrix powers and the specific formula for counting triangles.

    Step 1: The entry gives the number of walks of length from to . Therefore, is the number of closed walks of length 3 starting and ending at . This matches Q with 3.

    Step 2: The trace of a matrix is the sum of its diagonal entries. Thus, , which is the total number of closed walks of length 3 in the entire graph . This matches R with 1.

    Step 3: A triangle is a simple cycle of length 3. Each triangle generates exactly 6 closed walks of length 3 (3 starting vertices 2 directions). To get the number of triangles, we divide the total closed walks of length 3 by 6. This matches P with 2.

    Answer: P-2, Q-3, R-1 (Option A)

    Question 4 · Engineering Mathematics MCQ

    Let be the adjacency matrix of a simple undirected graph . If the trace of is 42, how many triangles does the graph contain?

    1. A.

      14

    2. B.

      21

    3. C.

      7

    4. D.

      42

    Correct Answer:

    C

    Step-by-Step Solution

    Key idea: The trace of counts all closed walks of length 3, but each triangle is counted multiple times.

    Step 1: Recall that the trace of , denoted , gives the total number of closed walks of length 3 in the graph.

    Step 2: In a simple graph, any closed walk of length 3 must be a triangle (since you can't repeat edges or vertices without immediately closing a cycle of length < 3, which isn't allowed in simple graphs).

    Step 3: Each triangle can be traversed as a closed walk of length 3 in exactly 6 ways:

    • Starting at : and
    • Starting at : and
    • Starting at : and

    Step 4: Therefore, the number of triangles is .

    Step 5: Given , the number of triangles is .

    Answer: 7

    Question 5 · Engineering Mathematics MCQ

    A proper -coloring of a graph assigns colors such that for all . For a star graph (1 center, 3 leaves), the number of proper -colorings is calculated by considering the center and leaves separately. If , what is the total number of proper 3-colorings?

    1. A.

      6

    2. B.

      12

    3. C.

      24

    4. D.

      32

    Correct Answer:

    C

    Step-by-Step Solution

    Key idea: This is a direct application of the proper coloring definition to a specific graph structure (star graph) using casework for the center and leaves.

    Step 1: Identify the structure of . It has 1 center vertex connected to 3 leaf vertices.

    Step 2: Calculate the number of choices for the center vertex. Since there are colors available, the center can be colored in 3 ways.

    Step 3: Calculate the number of choices for the leaf vertices. Each leaf is connected only to the center. Since the center has used 1 color, each leaf can be colored with any of the remaining colors.

    Step 4: Since there are 3 leaves, and each has 2 independent choices, the number of ways to color the leaves is .

    Step 5: Multiply the choices for the center and the leaves: .

    Answer: C

    Question 6 · Engineering Mathematics MCQ

    A graph is bipartite if and only if it contains no odd-length cycles. What is the minimum number of edges that must be removed from a complete graph to make it bipartite?

    1. A.

      3

    2. B.

      4

    3. C.

      5

    4. D.

      6

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: This is a contradiction-based question. We know the target state (bipartite) has a strict upper bound on edges, and we must find the minimum removals to satisfy this bound.

    Step 1: Calculate the total number of edges in the initial graph . The formula is edges.

    Step 2: Determine the maximum number of edges a bipartite graph on 5 vertices can have. From the previous concept, this is edges (the graph ).

    Step 3: To make bipartite, we must reduce its edge count to at most 6.

    Step 4: Calculate the minimum number of edges to remove: edges.

    Step 5: Verify that removing 4 edges can indeed leave a bipartite graph. Yes, removing the edges within the partitions of (which are edges) leaves exactly , which is bipartite.

    Answer: B

    Question 7 · Engineering Mathematics MCQ

    By considering whether the first and third vertices of a cycle graph have the same or different colors, calculate the number of proper 3-colorings of .

    1. A.

      14

    2. B.

      16

    3. C.

      18

    4. D.

      24

    Correct Answer:

    C

    Step-by-Step Solution

    Key idea: This is a casework question on the chromatic polynomial of , requiring careful tracking of color choices based on vertex adjacency.

    Step 1: Identify the structure of . It has 4 vertices in a cycle. We have colors.

    Step 2: Assign colors to and . has 3 choices. is adjacent to , so it has choices.

    Step 3: Casework on . is adjacent to .

    Step 4: Case 1: has the same color as . There is 1 choice for . Since is adjacent to and (which are the same color), has choices. Total for Case 1: .

    Step 5: Case 2: has a different color from . Since must differ from , and differs from , there is exactly 1 choice for (the third color). Now is adjacent to and , which have different colors. So has choice. Total for Case 2: .

    Step 6: Add the cases: .

    Answer: C

    Question 8 · Engineering Mathematics MCQ

    A graph consists of three disjoint triangles (). What is the minimum number of edges that must be removed from to make it bipartite?

    1. A.

      1

    2. B.

      2

    3. C.

      3

    4. D.

      6

    Correct Answer:

    C

    Step-by-Step Solution

    Key idea: This is a contradiction-based question. A graph is bipartite if and only if it contains no odd cycles. We must break all odd cycles with the minimum number of edge removals.

    Step 1: Identify the odd cycles in . The graph consists of three disjoint triangles ( or ). Each triangle is an odd cycle.

    Step 2: To make a triangle bipartite, we must break the cycle. Removing any 1 edge from a triangle converts it into a path of 3 vertices (), which is a tree and therefore bipartite.

    Step 3: Since there are three disjoint triangles, we must remove at least 1 edge from each triangle to destroy all odd cycles.

    Step 4: Calculate the minimum total edges to remove: edges.

    Answer: C

    Question 9 · Engineering Mathematics MCQ

    Let be the adjacency matrix of a simple undirected graph. What does the entry in the matrix represent, where is a positive integer?

    1. A.

      The number of simple paths of length from vertex to vertex .

    2. B.

      The number of walks of length from vertex to vertex .

    3. C.

      The number of cycles of length that contain both vertex and vertex .

    4. D.

      The number of edges between vertex and vertex raised to the power .

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: This is a direct formula recall question about the fundamental theorem of adjacency matrices and walk counting.

    Step 1: Recall the definition of the adjacency matrix and the meaning of matrix powers in graph theory.

    Step 2: The entry is calculated by summing the products of entries along all possible intermediate sequences of steps.

    Step 3: This mathematical operation counts every valid sequence of edges from to , which is the exact definition of a walk.

    Step 4: Note that walks allow repeated vertices and edges, unlike simple paths or cycles. Therefore, counts walks, not simple paths.

    Answer: B

    Question 10 · Engineering Mathematics MCQ

    Consider the following two statements about a simple undirected graph with edges and adjacency matrix :

    Assertion (A): The sum of all diagonal entries of is .

    Reason (R): The diagonal entry counts the number of walks of length 2 from to , which equals the degree of , and the sum of degrees of all vertices is .

    Which of the following is correct?

    1. A.

      Both A and R are true and R is the correct explanation of A.

    2. B.

      Both A and R are true but R is NOT the correct explanation of A.

    3. C.

      A is true but R is false.

    4. D.

      A is false but R is true.

    Correct Answer:

    A

    Step-by-Step Solution

    Key idea: This is a direct application of the walk-counting property of adjacency matrices combined with the handshaking lemma.

    Step 1: By the power rule, is the number of walks of length 2 from to . In a simple graph, a walk of length 2 from to must go to a neighbor and back. Thus, . This makes Reason (R) true.

    Step 2: The sum of all diagonal entries of is .

    Step 3: By the handshaking lemma, the sum of degrees of all vertices in a graph with edges is . This makes Assertion (A) true.

    Step 4: Since (R) correctly explains why the sum is (by linking the matrix entries to degrees, and degrees to ), R is the correct explanation of A.

    Answer: A

    More practice questions in this unit