chapter

    Graph Fundamentals, Trees and Connectivity Practice Questions for Gate Cs

    Solve 231+ 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

    A connected graph has 4 vertices. The Laplacian matrix is:

    If deleting row 4 and column 4 gives determinant 8, what determinant is obtained by deleting row 1 and column 1?

    Question 5
    Level 1: Warm-up

    Consider the following assertion and reason:

    Assertion (A): For a connected graph with 4 vertices, if the determinant of the reduced Laplacian matrix (obtained by deleting row 4 and column 4) is 8, then the determinant obtained by deleting row 1 and column 1 is also 8.

    Reason (R): According to Kirchhoff's Matrix Tree Theorem, all cofactors of the Laplacian matrix (obtained by deleting row and column for any ) are equal.

    Which of the following statements are CORRECT?

    Question 6
    Level 1: Warm-up
    Consider a directed graph with 5 vertices labeled . A directed edge exists from vertex to vertex if and only if .
    Assertion (A): The number of directed spanning trees rooted at vertex 5 is 24.
    Reason (R): In such a graph, every vertex except the root must choose exactly one incoming edge from a vertex with a higher index, and the number of choices for vertex is .
    Which of the following is correct?
    Question 7
    Level 1: Warm-up

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

    Question 8
    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 9
    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 10
    Level 1: Warm-up

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

    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.

    Explore complete test series, official past papers, and chapter-wise study tools.

    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 231+ 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 NAT

    A connected graph has 4 vertices. The Laplacian matrix is:

    If deleting row 4 and column 4 gives determinant 8, what determinant is obtained by deleting row 1 and column 1?

    Correct Answer:

    8

    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. All cofactors (obtained by deleting row and column for any ) give the same value.

    Step 1: Recognize that the problem gives us when we delete row 4 and column 4.

    Step 2: By Kirchhoff's theorem, deleting any row and column (for ) gives the same determinant, which equals the number of spanning trees.

    Step 3: Therefore, deleting row 1 and column 1 also gives determinant 8.

    Answer: 8

    Question 5 · Engineering Mathematics MSQ

    Consider the following assertion and reason:

    Assertion (A): For a connected graph with 4 vertices, if the determinant of the reduced Laplacian matrix (obtained by deleting row 4 and column 4) is 8, then the determinant obtained by deleting row 1 and column 1 is also 8.

    Reason (R): According to Kirchhoff's Matrix Tree Theorem, all cofactors of the Laplacian matrix (obtained by deleting row and column for any ) are equal.

    Which of the following statements are CORRECT?

    1. A.

      Assertion (A) is TRUE

    2. B.

      Reason (R) is TRUE

    3. C.

      Reason (R) is the correct explanation of Assertion (A)

    4. D.

      Assertion (A) is FALSE

    Correct Answer:

    ["A","B","C"]

    Step-by-Step Solution

    Key idea: This is an assertion-reason question testing Kirchhoff's Matrix Tree Theorem and the property that all cofactors of the Laplacian are equal.

    Step 1: Analyze Assertion (A):

    • Kirchhoff's theorem states that the number of spanning trees equals the determinant of any cofactor of the Laplacian.
    • All cofactors (obtained by deleting row and column ) give the same value.
    • If deleting row 4 and column 4 gives determinant 8, then deleting row 1 and column 1 also gives 8.
    • Therefore, (A) is TRUE.

    Step 2: Analyze Reason (R):

    • This is a direct statement of Kirchhoff's theorem: all cofactors are equal.
    • Therefore, (R) is TRUE.

    Step 3: Check if (R) explains (A):

    • (A) claims that two specific cofactors are equal.
    • (R) states that ALL cofactors are equal.
    • (R) directly explains why (A) is true.
    • Therefore, (R) IS the correct explanation of (A).

    Step 4: Evaluate options:

    • (A) Assertion is TRUE: ✓
    • (B) Reason is TRUE: ✓
    • (C) Reason explains Assertion: ✓
    • (D) Assertion is FALSE: ✗

    Answer: A, B, C

    Question 6 · Engineering Mathematics MCQ
    Consider a directed graph with 5 vertices labeled . A directed edge exists from vertex to vertex if and only if .
    Assertion (A): The number of directed spanning trees rooted at vertex 5 is 24.
    Reason (R): In such a graph, every vertex except the root must choose exactly one incoming edge from a vertex with a higher index, and the number of choices for vertex 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 an assertion-reason question about directed spanning trees. We need to verify both statements and check if R explains A.

    Step 1: Understand the graph structure.

    • Vertices: 1, 2, 3, 4, 5
    • Edge from to exists iff
    • So edges point from higher to lower indices
    • Examples:

    Step 2: Verify Assertion (A).

    • A directed spanning tree rooted at 5 requires directed paths from 5 to all other vertices
    • Since edges go from higher to lower, the root must be 5 (highest index)
    • Each vertex must have exactly one incoming edge in the tree
    • Vertex 4: can receive from {5} → 1 choice
    • Vertex 3: can receive from {4, 5} → 2 choices
    • Vertex 2: can receive from {3, 4, 5} → 3 choices
    • Vertex 1: can receive from {2, 3, 4, 5} → 4 choices
    • Total trees =
    • Assertion (A) is TRUE.

    Step 3: Verify Reason (R).

    • R states: vertex has choices
    • Check: vertex 4 has choice ✓
    • Vertex 3 has choices ✓
    • Vertex 2 has choices ✓
    • Vertex 1 has choices ✓
    • Reason (R) is TRUE.

    Step 4: Check if R explains A.

    • R correctly describes why the count is
    • R is the correct explanation of A.

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

    Question 7 · 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 8 · 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 $0$.
    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 9 · 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 10 · 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.

    More practice questions in this unit