Graph Coloring, Covers, Matrices and Special Graphs Notes for GATE CS
Graph Coloring, Covers, Matrices and Special Graphs notes for GATE CS: 31 study cards covering concepts, formulas, shortcuts and exam traps, plus solved pract
graph coloring covers matrices and special graphs notes
Chapter Roadmap: Discrete Mathematics Graph Theory
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 G=(V,E) is an assignment of colors to vertices such that no two adjacent vertices share the same color.
Formally, a function c:V→{1,2,…,k} is a proper k-coloring if:
∀(u,v)∈E,c(u)=c(v)
Chromatic Number χ(G)
The smallest integer k for which G has a proper k-coloring.
If χ(G)=k, the graph is k-chromatic.
If χ(G)≤k, the graph is k-colorable.
Intuition: Think of colors as "resources" or "time slots." Adjacent vertices compete for resources. χ(G) tells you the minimum resource pool size required to satisfy all constraints simultaneously.
Bipartite Graphs are 2-Colorable
Bipartite Graphs ⟺ 2-Colorable
Definition: A graph G is bipartite if its vertex set V can be partitioned into two disjoint sets V1 and V2 such that every edge connects a vertex in V1 to one in V2.
Key Theorem:G is bipartite⟺χ(G)≤2
Why?
If G is bipartite, assign Color 1 to all v∈V1 and Color 2 to all v∈V2. No conflicts exist because there are no edges within V1 or within V2.
If G is 2-colorable, let V1 be vertices with Color 1 and V2 be vertices with Color 2. By definition of proper coloring, no edge exists within V1 or V2. Thus, G is bipartite.
Note: An empty graph (no edges) has χ(G)=1 and is technically bipartite (one set can be empty).
28 more cards in this chapter
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 A be the adjacency matrix of a simple undirected graph. Which of the following statements is ALWAYS TRUE regarding the matrix Ak for any integer k≥1?
Question 2
Level 1: Warm-up
In a simple undirected graph, the entry (A3)ii represents the number of walks of length 3 from vertex vi to itself. What is the minimum number of distinct triangles containing vi if (A3)ii=4?
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 A.
List I
P. Number of triangles in G
Q. The entry (A3)ii
R. The trace of A3
List II
Total number of closed walks of length 3 in G
Tr(A3)/6
Number of closed walks of length 3 from vi to vi
Select the correct matching from the options below.
Question 4
Level 1: Warm-up
Let A be the adjacency matrix of a simple undirected graph G. If the trace of A3 is 42, how many triangles does the graph G contain?
Question 5
Level 1: Warm-up
A proper k-coloring of a graph G=(V,E) assigns colors such that c(u)=c(v) for all (u,v)∈E. For a star graph S3 (1 center, 3 leaves), the number of proper k-colorings is calculated by considering the center and leaves separately. If k=3, 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 K5 to make it bipartite?
Question 7
Level 1: Warm-up
By considering whether the first and third vertices of a cycle graph C4 have the same or different colors, calculate the number of proper 3-colorings of C4.
Question 8
Level 1: Warm-up
A graph G consists of three disjoint triangles (K3). What is the minimum number of edges that must be removed from G to make it bipartite?
Question 9
Level 1: Warm-up
Let A be the adjacency matrix of a simple undirected graph. What does the entry (i,j) in the matrix Ak represent, where k is a positive integer?
Question 10
Level 1: Warm-up
Consider the following two statements about a simple undirected graph G with m edges and adjacency matrix A:
Assertion (A): The sum of all diagonal entries of A2 is 2m.
Reason (R): The diagonal entry (A2)ii counts the number of walks of length 2 from vi to vi, which equals the degree of vi, and the sum of degrees of all vertices is 2m.
Which of the following is correct?
Free preview ends here
Login to view the complete notes
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.
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 Notes for GATE CS
Graph Coloring, Covers, Matrices and Special Graphs notes for GATE CS: 31 study cards covering concepts, formulas, shortcuts and exam traps, plus solved practice questions.
Chapter Roadmap: Discrete Mathematics Graph Theory
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 G=(V,E) is an assignment of colors to vertices such that no two adjacent vertices share the same color.
Formally, a function c:V→{1,2,…,k} is a proper k-coloring if:
∀(u,v)∈E,c(u)=c(v)
Chromatic Number χ(G)
The smallest integer k for which G has a proper k-coloring.
If χ(G)=k, the graph is k-chromatic.
If χ(G)≤k, the graph is k-colorable.
Intuition: Think of colors as "resources" or "time slots." Adjacent vertices compete for resources. χ(G) tells you the minimum resource pool size required to satisfy all constraints simultaneously.
Bipartite Graphs are 2-Colorable
Bipartite Graphs ⟺ 2-Colorable
Definition: A graph G is bipartite if its vertex set V can be partitioned into two disjoint sets V1 and V2 such that every edge connects a vertex in V1 to one in V2.
Key Theorem:G is bipartite⟺χ(G)≤2
Why?
If G is bipartite, assign Color 1 to all v∈V1 and Color 2 to all v∈V2. No conflicts exist because there are no edges within V1 or within V2.
If G is 2-colorable, let V1 be vertices with Color 1 and V2 be vertices with Color 2. By definition of proper coloring, no edge exists within V1 or V2. Thus, G is bipartite.
Note: An empty graph (no edges) has χ(G)=1 and is technically bipartite (one set can be empty).
Odd Cycles Break Bipartiteness
Characterization via Cycles
Theorem: A graph is bipartite if and only if it contains no odd-length cycles.
Logical Deduction
Consider a cycle Cn.
If n is even, you can alternate colors 1,2,1,2… and close the loop consistently.
If n is odd, alternating 1,2,1,2… leads to a conflict at the last edge (the start and end vertices would require different colors but are adjacent).
Odd cycle C5 showing color clash at the final edge.
Implication for Chromatic Number
If G contains a triangle (C3), then χ(G)≥3.
If G contains a C5, then χ(G)≥3.
Presence of any odd cycle implies χ(G)>2.
Graph Coloring, Covers, Matrices and Special Graphs: Solved Questions with Step-by-Step Explanations (10 Problems)
Question 1 · Engineering MathematicsMCQ
Let A be the adjacency matrix of a simple undirected graph. Which of the following statements is ALWAYS TRUE regarding the matrix Ak for any integer k≥1?
A.
The entry (Ak)ij gives the number of simple paths of length k from vi to vj.
B.
The trace of Ak gives the total number of closed walks of length k in the graph.
C.
The sum of all elements in Ak is equal to the total number of cycles of length k.
D.
The diagonal entries of Ak are always zero for all k.
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. Ak 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 (Ak)ii is the number of closed walks of length k starting and ending at vi. Summing over all i gives the total number of closed walks of length k in the graph. Thus, B is true.
Step 3: Evaluate Option C. The sum of all elements counts all walks of length k, not just cycles. Cycles are simple closed paths. Thus, C is false.
Step 4: Evaluate Option D. For even k, there are closed walks (e.g., vi→vj→vi for k=2). Thus, diagonal entries are non-zero for even k. D is false.
Answer: B
Question 2 · Engineering MathematicsMCQ
In a simple undirected graph, the entry (A3)ii represents the number of walks of length 3 from vertex vi to itself. What is the minimum number of distinct triangles containing vi if (A3)ii=4?
A.
1
B.
2
C.
3
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 A3.
Step 1: Recall that a walk of length 3 from vi to vi must be of the form vi→vj→vk→vi.
Step 2: In a simple graph, to return in exactly 3 steps without immediately backtracking (which would require an even length), the vertices vi,vj,vk must be distinct.
Step 3: Thus, every walk of length 3 from vi to vi corresponds to a triangle containing vi.
Step 4: For any specific triangle containing vi, there are exactly 2 distinct walks of length 3: one in clockwise order and one in counter-clockwise order.
Step 5: If (A3)ii=4, and each triangle contributes exactly 2 walks, the number of triangles is 4/2=2.
Answer: B
Question 3 · Engineering MathematicsMCQ
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 A.
List I
P. Number of triangles in G
Q. The entry (A3)ii
R. The trace of A3
List II
Total number of closed walks of length 3 in G
Tr(A3)/6
Number of closed walks of length 3 from vi to vi
Select the correct matching from the options below.
A.
P-2, Q-3, R-1
B.
P-1, Q-3, R-2
C.
P-2, Q-1, R-3
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 (Ak)ij gives the number of walks of length k from vi to vj. Therefore, (A3)ii is the number of closed walks of length 3 starting and ending at vi. This matches Q with 3.
Step 2: The trace of a matrix is the sum of its diagonal entries. Thus, Tr(A3)=∑i=1n(A3)ii, which is the total number of closed walks of length 3 in the entire graph G. 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 MathematicsMCQ
Let A be the adjacency matrix of a simple undirected graph G. If the trace of A3 is 42, how many triangles does the graph G contain?
A.
14
B.
21
C.
7
D.
42
Correct Answer:
C
Step-by-Step Solution
Key idea: The trace of A3 counts all closed walks of length 3, but each triangle is counted multiple times.
Step 1: Recall that the trace of A3, denoted Tr(A3), 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 {u,v,w} can be traversed as a closed walk of length 3 in exactly 6 ways:
Starting at u: u→v→w→u and u→w→v→u
Starting at v: v→w→u→v and v→u→w→v
Starting at w: w→u→v→w and w→v→u→w
Step 4: Therefore, the number of triangles is Tr(A3)/6.
Step 5: Given Tr(A3)=42, the number of triangles is 42/6=7.
Answer: 7
Question 5 · Engineering MathematicsMCQ
A proper k-coloring of a graph G=(V,E) assigns colors such that c(u)=c(v) for all (u,v)∈E. For a star graph S3 (1 center, 3 leaves), the number of proper k-colorings is calculated by considering the center and leaves separately. If k=3, what is the total number of proper 3-colorings?
A.
6
B.
12
C.
24
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 S3. It has 1 center vertex connected to 3 leaf vertices.
Step 2: Calculate the number of choices for the center vertex. Since there are k=3 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 k−1=2 colors.
Step 4: Since there are 3 leaves, and each has 2 independent choices, the number of ways to color the leaves is 2×2×2=23=8.
Step 5: Multiply the choices for the center and the leaves: 3×8=24.
Answer: C
Question 6 · Engineering MathematicsMCQ
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 K5 to make it bipartite?
A.
3
B.
4
C.
5
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 K5. The formula is 2n(n−1)=25×4=10 edges.
Step 2: Determine the maximum number of edges a bipartite graph on 5 vertices can have. From the previous concept, this is ⌊5/2⌋×⌈5/2⌉=2×3=6 edges (the graph K2,3).
Step 3: To make K5 bipartite, we must reduce its edge count to at most 6.
Step 4: Calculate the minimum number of edges to remove: 10−6=4 edges.
Step 5: Verify that removing 4 edges can indeed leave a bipartite graph. Yes, removing the edges within the partitions of K2,3 (which are (22)+(23)=1+3=4 edges) leaves exactly K2,3, which is bipartite.
Answer: B
Question 7 · Engineering MathematicsMCQ
By considering whether the first and third vertices of a cycle graph C4 have the same or different colors, calculate the number of proper 3-colorings of C4.
A.
14
B.
16
C.
18
D.
24
Correct Answer:
C
Step-by-Step Solution
Key idea: This is a casework question on the chromatic polynomial of C4, requiring careful tracking of color choices based on vertex adjacency.
Step 1: Identify the structure of C4. It has 4 vertices v1,v2,v3,v4 in a cycle. We have k=3 colors.
Step 2: Assign colors to v1 and v2. v1 has 3 choices. v2 is adjacent to v1, so it has 3−1=2 choices.
Step 3: Casework on v3. v3 is adjacent to v2.
Step 4: Case 1: v3 has the same color as v1. There is 1 choice for v3. Since v4 is adjacent to v3 and v1 (which are the same color), v4 has 3−1=2 choices. Total for Case 1: 3×2×1×2=12.
Step 5: Case 2: v3 has a different color from v1. Since v3 must differ from v2, and v2 differs from v1, there is exactly 1 choice for v3 (the third color). Now v4 is adjacent to v3 and v1, which have different colors. So v4 has 3−2=1 choice. Total for Case 2: 3×2×1×1=6.
Step 6: Add the cases: 12+6=18.
Answer: C
Question 8 · Engineering MathematicsMCQ
A graph G consists of three disjoint triangles (K3). What is the minimum number of edges that must be removed from G to make it bipartite?
A.
1
B.
2
C.
3
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 G. The graph consists of three disjoint triangles (K3 or C3). 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 (P3), 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: 1×3=3 edges.
Answer: C
Question 9 · Engineering MathematicsMCQ
Let A be the adjacency matrix of a simple undirected graph. What does the entry (i,j) in the matrix Ak represent, where k is a positive integer?
A.
The number of simple paths of length k from vertex vi to vertex vj.
B.
The number of walks of length k from vertex vi to vertex vj.
C.
The number of cycles of length k that contain both vertex vi and vertex vj.
D.
The number of edges between vertex vi and vertex vj raised to the power k.
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 A and the meaning of matrix powers in graph theory.
Step 2: The entry (Ak)ij is calculated by summing the products of entries along all possible intermediate sequences of k steps.
Step 3: This mathematical operation counts every valid sequence of k edges from vi to vj, which is the exact definition of a walk.
Step 4: Note that walks allow repeated vertices and edges, unlike simple paths or cycles. Therefore, Ak counts walks, not simple paths.
Answer: B
Question 10 · Engineering MathematicsMCQ
Consider the following two statements about a simple undirected graph G with m edges and adjacency matrix A:
Assertion (A): The sum of all diagonal entries of A2 is 2m.
Reason (R): The diagonal entry (A2)ii counts the number of walks of length 2 from vi to vi, which equals the degree of vi, and the sum of degrees of all vertices is 2m.
Which of the following is correct?
A.
Both A and R are true and R is the correct explanation of A.
B.
Both A and R are true but R is NOT the correct explanation of A.
C.
A is true but R is false.
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, (A2)ii is the number of walks of length 2 from vi to vi. In a simple graph, a walk of length 2 from vi to vi must go to a neighbor and back. Thus, (A2)ii=deg(vi). This makes Reason (R) true.
Step 2: The sum of all diagonal entries of A2 is ∑i=1n(A2)ii=∑i=1ndeg(vi).
Step 3: By the handshaking lemma, the sum of degrees of all vertices in a graph with m edges is 2m. This makes Assertion (A) true.
Step 4: Since (R) correctly explains why the sum is 2m (by linking the matrix entries to degrees, and degrees to 2m), R is the correct explanation of A.