chapter
    Graph Fundamentals, Trees and Connectivity Practice Questions for GATE CS

    Solve 127+ Graph Fundamentals, Trees and Connectivity 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

    Consider a connected simple graph with 10 vertices. If we partition its edges into a spanning tree and a set of extra edges, and the total number of edges is 15, how many edges are in the extra set?

    Question 2
    Level 1: Warm-up

    Assertion (A): For a graph with 6 vertices, the reduced Laplacian matrix used in Kirchhoff's theorem is of size .

    Reason (R): The original Laplacian matrix is of size , and the method requires deleting exactly one row and one column.

    Question 3
    Level 1: Warm-up

    Consider the following:

    Assertion (A): A connected planar graph with 10 vertices and 15 edges has 7 faces.

    Reason (R): Euler's formula for connected planar graphs states .

    Question 4
    Level 1: Warm-up

    The number of spanning trees in a complete graph with 5 labeled vertices is

    Question 5
    Level 1: Warm-up

    Which of the following statements about the row sums of the Laplacian matrix of a simple undirected graph is true?

    Question 6
    Level 1: Warm-up

    If the determinant of the reduced Laplacian matrix of a connected graph is 12, how many spanning trees does the graph have?

    Question 7
    Level 1: Warm-up

    What is the maximum number of edges in a simple disconnected graph with 6 vertices?

    Question 8
    Level 1: Warm-up

    Match the following connected planar graphs with their number of faces (including the outer face):

    \begin{array}{ll}

    \textbf{Graph} & \textbf{Vertices, Edges} \\

    \text{I} & (4, 6) \\

    \text{II} & (6, 9) \\

    \text{III} & (8, 12)

    \end{array}

    \begin{array}{ll}

    \textbf{Faces} \\

    \text{P} & 4 \\

    \text{Q} & 5 \\

    \text{R} & 6

    \end{array}

    Question 9
    Level 1: Warm-up

    Which of the following statements about the number of matchings in a path graph is TRUE?

    Question 10
    Level 1: Warm-up

    How many of the following triples can represent a connected planar graph?

    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 Fundamentals, Trees and Connectivity Practice Questions for GATE CS

    Solve 127+ Graph Fundamentals, Trees and Connectivity practice questions for GATE CS with answers and detailed solutions. Free sample questions below.

    Chapter Roadmap: Graph Fundamentals, Trees and Connectivity

    Chapter Journey

    Graph Fundamentals & Connectivity

    1. Spanning Tree Enumeration

    Counting trees using Cayley’s Formula & Kirchhoff’s Theorem.

    2. Weighted Spanning Trees

    Optimizing tree weight with Kruskal’s & Prim’s Algorithms.

    3. Connectivity & Planarity

    Graph robustness, Euler’s Formula, and edge bounds.

    4. Matchings & Distances

    Pairing vertices, diameter, and graph powers.

    Why start here? Counting structures builds the intuition needed to optimize them and analyze their resilience.

    Hero Concept: What is a Spanning Tree?

    The Spanning Tree

    For a connected undirected graph with , a Spanning Tree is a subgraph that:

    1. Includes all vertices:
    2. Is connected
    3. Is acyclic (No loops)
    Critical Property

    Why Enumerate? Knowing the number of spanning trees, denoted as , tells us how many unique ways we can connect all nodes without loops.

    Graph Fundamentals, Trees and Connectivity: Solved Questions with Step-by-Step Explanations (10 Problems)

    Question 1 · Engineering Mathematics MCQ

    Consider a connected simple graph with 10 vertices. If we partition its edges into a spanning tree and a set of extra edges, and the total number of edges is 15, how many edges are in the extra set?

    1. A.

      6

    2. B.

      5

    3. C.

      4

    4. D.

      9

    Correct Answer:

    A

    Step-by-Step Solution

    Insight: A spanning tree of an -vertex graph always contains exactly edges.

    Exam route: The spanning tree has edges. The extra edges are the total minus the tree edges: .

    Learning route:

    1. Identify the total number of vertices and total edges .
    2. Recall that any spanning tree of a graph with vertices must have exactly edges.
    3. Calculate the number of edges in the spanning tree: .
    4. The extra edges are those not in the spanning tree. Subtract the tree edges from the total: .

    Answer: 6

    Question 2 · Engineering Mathematics MCQ

    Assertion (A): For a graph with 6 vertices, the reduced Laplacian matrix used in Kirchhoff's theorem is of size .

    Reason (R): The original Laplacian matrix is of size , and the method requires deleting exactly one row and one column.

    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

    Insight: Kirchhoff's theorem requires reducing the Laplacian to an matrix by deleting one row and one column.

    Exam route: For , the original matrix is . Deleting one row and one column yields a matrix. R correctly explains why A is true.

    Learning route:

    1. Recall the statement of Kirchhoff's Matrix Tree Theorem.
    2. The theorem states that the number of spanning trees is the determinant of any cofactor of the Laplacian matrix .
    3. A cofactor is obtained by deleting exactly one row and one column (usually ).
    4. For a graph with vertices, is a matrix.
    5. Deleting one row and one column reduces the dimensions by 1, resulting in a matrix.
    6. Thus, both A and R are true, and R is the direct mathematical reason for A.

    Answer: Both A and R are true and R is the correct explanation of A

    Question 3 · Engineering Mathematics MCQ

    Consider the following:

    Assertion (A): A connected planar graph with 10 vertices and 15 edges has 7 faces.

    Reason (R): Euler's formula for connected planar graphs states .

    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: Use Euler's formula to verify the assertion.

    Step 1: Euler's formula states for connected planar graphs. So Reason (R) is true.

    Step 2: Given , , substitute into Euler's formula: .

    Step 3: Solve for : .

    Step 4: The assertion states , which matches our calculation. So Assertion (A) is true.

    Step 5: Reason (R) correctly explains why Assertion (A) is true.

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

    Question 4 · Engineering Mathematics MCQ

    The number of spanning trees in a complete graph with 5 labeled vertices is

    1. A.

      125

    2. B.

      625

    3. C.

      24

    4. D.

      120

    Correct Answer:

    A

    Step-by-Step Solution

    Insight: Direct application of Cayley's formula for complete graphs.

    Exam route: The formula for the number of spanning trees in is . For , this is .

    Learning route:

    1. Identify the graph as a complete graph with labeled vertices.
    2. Recall Cayley's formula: .
    3. Substitute into the formula: .
    4. Calculate .

    Answer: 125

    Question 5 · Engineering Mathematics MCQ

    Which of the following statements about the row sums of the Laplacian matrix of a simple undirected graph is true?

    1. A.

      The sum of elements in any row is always 0

    2. B.

      The sum of elements in any row is equal to the degree of the corresponding vertex

    3. C.

      The sum of elements in any row is always 1

    4. D.

      The sum of elements in any row is equal to the number of vertices

    Correct Answer:

    A

    Step-by-Step Solution

    Insight: The diagonal entry of the Laplacian is the vertex degree, and the off-diagonal entries are -1 for each adjacent vertex.

    Exam route: Row sum = .

    Learning route:

    1. Recall the definition of the Laplacian matrix : and if , else .
    2. The sum of the elements in row is the diagonal entry plus the sum of the off-diagonal entries.
    3. There are exactly off-diagonal entries equal to in row .
    4. Sum = .

    Answer: The sum of elements in any row is always 0

    Question 6 · Engineering Mathematics MCQ

    If the determinant of the reduced Laplacian matrix of a connected graph is 12, how many spanning trees does the graph have?

    1. A.

      6

    2. B.

      12

    3. C.

      24

    4. D.

      144

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: Kirchhoff's Matrix Tree Theorem states that the number of spanning trees equals the determinant of any cofactor of the Laplacian matrix.

    Step 1: According to Kirchhoff's theorem, , where is the reduced Laplacian matrix (obtained by deleting any one row and one column from the Laplacian).

    Step 2: The problem states that .

    Step 3: Therefore, the number of spanning trees is .

    Answer: 12.

    Question 7 · Engineering Mathematics MCQ

    What is the maximum number of edges in a simple disconnected graph with 6 vertices?

    1. A.

      10

    2. B.

      15

    3. C.

      12

    4. D.

      9

    Correct Answer:

    A

    Step-by-Step Solution

    Key idea: To maximize edges in a disconnected graph, make one component as large as possible () and one isolated vertex ().

    Step 1: The formula is .

    Step 2: For : .

    Answer: 10.

    Question 8 · Engineering Mathematics MCQ

    Match the following connected planar graphs with their number of faces (including the outer face):

    \begin{array}{ll}

    \textbf{Graph} & \textbf{Vertices, Edges} \\

    \text{I} & (4, 6) \\

    \text{II} & (6, 9) \\

    \text{III} & (8, 12)

    \end{array}

    \begin{array}{ll}

    \textbf{Faces} \\

    \text{P} & 4 \\

    \text{Q} & 5 \\

    \text{R} & 6

    \end{array}

    1. A.

      I-P, II-Q, III-R

    2. B.

      I-Q, II-R, III-P

    3. C.

      I-P, II-R, III-Q

    4. D.

      I-R, II-Q, III-P

    Correct Answer:

    A

    Step-by-Step Solution

    Key idea: This tests Euler's formula for connected planar graphs.

    Step 1: Apply Euler's formula to each graph:

    Step 2: Graph I:

    → P

    Step 3: Graph II:

    → Q

    Step 4: Graph III:

    → R

    Answer: I-P, II-Q, III-R

    Question 9 · Engineering Mathematics MCQ

    Which of the following statements about the number of matchings in a path graph is TRUE?

    1. A.

    2. B.

      , where is the -th Fibonacci number with

    3. C.

      does not include the empty matching

    4. D.

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: This is a statement truth question on the explicit formula for matchings in a path, recognizable because it tests the exact relationship between and the Fibonacci sequence.

    Step 1: Recall the recurrence for : with base cases and .

    Step 2: Compare this to the Fibonacci sequence where

    Step 3: Check the values:

    Step 4: The pattern is .

    Answer:

    Question 10 · Engineering Mathematics MCQ

    How many of the following triples can represent a connected planar graph?

    1. A.

      1

    2. B.

      2

    3. C.

      3

    4. D.

      4

    Correct Answer:

    C

    Step-by-Step Solution

    Key idea: This tests validation using Euler's formula for connected planar graphs.

    Step 1: Check each triple against :

    Step 2: : ✓ Valid

    Step 3: : ✓ Valid

    Step 4: : ✓ Valid

    Step 5: : ✗ Invalid

    Step 6: Count valid triples: 3

    Answer: 3

    More practice questions in this unit