• S
    SwaseekhGATE Preparation
General
  • Dashboard
  • Syllabus
  • Questions
  • Aptitude
  • Mock Tests
  • TCS NQT 2026
Account
  • Pricing
  • Contact
  1. GATE CS
  2. PYQs
  3. Discrete Mathematics

Consider an undirected graph G where self-loops are not allowed. The vertex set of G is {(i, j) : 1 <= i <= 12, 1 <= j <= 12}. There is an edge between (a, b) and (c, d) if |a - c| <= 1 and |b - d| <= 1. The number of edges in this graph is ______.

GATE 2014 · Discrete Mathematics · Graph Connectivity · medium

Answer: 506

  1. Count horizontal edges: Each of the 12 rows has 11 adjacent pairs (columns 1-2, 2-3, ..., 11-12). Horizontal edges = 12 * 11 = 132.
  2. Count vertical edges: Each of the 12 columns has 11 adjacent pairs. Vertical edges = 12 * 11 = 132.
  3. Count diagonal edges (both directions): Each 2x2 sub-square (there are 11*11 = 121 of them) contributes 2 diagonal edges: one going down-right and one going down-left. Diagonal edges = 2 * 11 * 11 = 242.
  4. Sum all edges: Total = 132 + 132 + 242 = 506.