Graph Coloring, Covers, Matrices and Special Graphs Short Notes for Gate Cs
Graph Coloring, Covers, Matrices and Special Graphs short notes for GATE CS: 4 study cards covering concepts, formulas, shortcuts and exam traps, plus solved
Graph Coloring Covers Matrices and Special Graphs short notes
Quick Recall: Coloring Rules
Key Takeaways
Proper Coloring: Adjacent vertices ⟹ Different colors.
χ(G)≤2:⟺ Graph is Bipartite ⟺ No Odd Cycles.
χ(Kn)=n.
χ(Tree)=2 (for ∣V∣≥2).
Bounds:ω(G)≤χ(G)≤Δ(G)+1.
Greedy Algorithm: Gives an upper bound, not necessarily optimal.
Quick Revision Cheat Sheet
Summary: Adjacency Matrices
1.Definition: Aij=1 if edge exists, else 0.
2.Symmetry: Undirected ⟹A=AT.
3.Walk Counting: (Ak)ij= # walks of length k from i to j.
4.Triangle Count: #Δ=6Tr(A3).
5.Degrees: ∑jAij=deg(vi).
6.Edge Count: ∑i,jAij=2∣E∣.
Remember:
Ak counts walks, not necessarily simple paths. Be careful with k≥4.
Quick Recap: Degree and Cover Logic
Key Takeaways
1. DefinitionC covers E if every edge has at least one endpoint in C.
2. Mandatory Vertex Test
Assume v∈/C.
Then N(v)⊂C.
If this choice is too "expensive" (total size >k), then v∈C.
3. Heuristics
Leaves → Prefer the parent vertex.
Isolated vertices → Never in the cover.
4. Dualityβ(G)+α(G)=∣V∣
1 more card 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
Let A be the adjacency matrix of a simple undirected graph with 4 vertices. Which of the following pairs (Sum of all elements in A, Trace of A3) are IMPOSSIBLE?
Question 6
Level 1: Warm-up
Let A be the adjacency matrix of a simple undirected graph. If the trace of A3 is 72, what is the exact number of triangles in the graph?
Question 7
Level 1: Warm-up
Let A be the adjacency matrix of a simple undirected graph with exactly 4 vertices. What is the maximum possible value of the trace of A3?
Question 8
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 9
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 10
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.
Free preview ends here
Login to view the complete short 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 Short Notes for GATE CS
Graph Coloring, Covers, Matrices and Special Graphs short notes for GATE CS: 4 study cards covering concepts, formulas, shortcuts and exam traps, plus solved practice questions.
Quick Recall: Coloring Rules
Key Takeaways
Proper Coloring: Adjacent vertices ⟹ Different colors.
χ(G)≤2:⟺ Graph is Bipartite ⟺ No Odd Cycles.
χ(Kn)=n.
χ(Tree)=2 (for ∣V∣≥2).
Bounds:ω(G)≤χ(G)≤Δ(G)+1.
Greedy Algorithm: Gives an upper bound, not necessarily optimal.
Quick Revision Cheat Sheet
Summary: Adjacency Matrices
1.Definition: Aij=1 if edge exists, else 0.
2.Symmetry: Undirected ⟹A=AT.
3.Walk Counting: (Ak)ij= # walks of length k from i to j.
4.Triangle Count: #Δ=6Tr(A3).
5.Degrees: ∑jAij=deg(vi).
6.Edge Count: ∑i,jAij=2∣E∣.
Remember:
Ak counts walks, not necessarily simple paths. Be careful with k≥4.
Quick Recap: Degree and Cover Logic
Key Takeaways
1. DefinitionC covers E if every edge has at least one endpoint in C.
2. Mandatory Vertex Test
Assume v∈/C.
Then N(v)⊂C.
If this choice is too "expensive" (total size >k), then v∈C.
3. Heuristics
Leaves → Prefer the parent vertex.
Isolated vertices → Never in the cover.
4. Dualityβ(G)+α(G)=∣V∣
Rapid Revision: Petersen Graph Cheat Sheet
Petersen Graph Cheat Sheet
Vertices / Edges
10 / 15
Regularity
3 (Cubic)
Girth
5
χ / χ′
3 / 4
Planar?
No
Hamiltonian?
Path: Yes / Cycle: No
Isomorphism Check Order:
∣V∣,∣E∣
Degree Sequence
Cycle Counts (k=3,4)
Girth
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 MathematicsMSQ
Let A be the adjacency matrix of a simple undirected graph with 4 vertices. Which of the following pairs (Sum of all elements in A, Trace of A3) are IMPOSSIBLE?
A.
(6, 6)
B.
(8, 12)
C.
(6, 12)
D.
(12, 24)
Correct Answer:
["B","C"]
Step-by-Step Solution
Key idea: The sum of all elements in A is 2∣E∣. The trace of A3 is 6×(number of triangles).
Step 1: Analyze (6, 6). Sum = 6 ⟹∣E∣=3. Trace = 6 ⟹1 triangle. A graph with 4 vertices, 3 edges, and 1 triangle is K3 plus an isolated vertex. This is possible.
Step 2: Analyze (8, 12). Sum = 8 ⟹∣E∣=4. Trace = 12 ⟹2 triangles. A graph with 4 vertices and 4 edges can have at most 1 triangle (e.g., K3 with a pendant edge). Two triangles require at least 5 edges. This is impossible.
Step 3: Analyze (6, 12). Sum = 6 ⟹∣E∣=3. Trace = 12 ⟹2 triangles. 3 edges cannot form 2 triangles. This is impossible.
Step 4: Analyze (12, 24). Sum = 12 ⟹∣E∣=6. Trace = 24 ⟹4 triangles. This is the complete graph K4, which has exactly 4 triangles. This is possible.
Answer: B, C
Question 6 · Engineering MathematicsNAT
Let A be the adjacency matrix of a simple undirected graph. If the trace of A3 is 72, what is the exact number of triangles in the graph?
Correct Answer:
12.00
Step-by-Step Solution
Key idea: The trace of A3 counts the total number of closed walks of length 3. Each triangle generates exactly 6 such walks.
Step 1: Recall the relationship between the trace of A3 and the number of triangles. A triangle consists of 3 vertices. A closed walk of length 3 can start at any of the 3 vertices and go in 2 directions (clockwise or counter-clockwise).
Step 2: This means each triangle is counted 3×2=6 times in the trace of A3.
Step 3: Calculate the number of triangles by dividing the trace by 6: 72/6=12.
Answer: 12.00
Question 7 · Engineering MathematicsMCQ
Let A be the adjacency matrix of a simple undirected graph with exactly 4 vertices. What is the maximum possible value of the trace of A3?
A.
12
B.
18
C.
24
D.
36
Correct Answer:
C
Step-by-Step Solution
Key idea: The trace of A3 counts 6 times the number of triangles in the graph. To maximize the trace, we must maximize the number of triangles.
Step 1: Recall the formula for counting triangles: Number of Triangles=6Tr(A3).
Step 2: Determine the maximum number of triangles possible in a simple graph with 4 vertices. This occurs in the complete graph K4.
Step 3: Calculate the number of triangles in K4. It is (34)=4.
Step 4: Calculate the maximum trace of A3: Tr(A3)=4×6=24.
Answer: 24
Question 8 · 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 9 · 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 10 · 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.