Skip to content
Official PYQ · 2014

GATE CS 2014 Set 1 Q51 — Graphs: Connectivity, Matching, Colouring

Explain with AI
Consider an undirected graph GG where self-loops are not allowed. The vertex set of GG is {(i,j)∣1≤i≤12,1≤j≤12}\{(i,j) \mid1 \leq i \leq 12, 1 \leq j \leq 12\}. There is an edge between (a,b)(a,b) and (c,d)(c,d) if ∣a−c∣≤1|a-c| \leq 1 and ∣b−d∣≤1|b-d| \leq 1. The number of edges in this graph is______.
View worked solution

Answer: 506

The vertices of the graph GG can be visualized as a 12imes1212 imes 12 grid. An edge exists between (a,b)(a,b) and (c,d)(c,d) if ∣a−c∣≤1|a-c| \leq 1 and ∣b−d∣≤1|b-d| \leq 1 (excluding self-loops). This means two vertices are connected if they are adjacent horizontally, vertically, or diagonally.

We can count the total number of edges by classifying them into four categories:

  • Horizontal edges: Each of the 1212 rows contains 1111 horizontal edges.
    Count=12×11=132\text{Count} = 12 \times 11 = 132
  • Vertical edges: Each of the 1212 columns contains 1111 vertical edges.
    Count=12×11=132\text{Count} = 12 \times 11 = 132
  • Diagonal edges (top-left to bottom-right): Each of the 11×1111 \times 11 grid squares of size 1×11 \times 1 contains exactly one such diagonal.
    Count=112=121\text{Count} = 11^2 = 121
  • Diagonal edges (bottom-left to top-right): Similarly, each of the 11×1111 \times 11 grid squares contains one such diagonal.
    Count=112=121\text{Count} = 11^2 = 121

Summing these up gives the total number of edges:

Total Edges=132+132+121+121=506\text{Total Edges} = 132 + 132 + 121 + 121 = 506

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Graphs: Connectivity, Matching, Colouring questions