Question
Consider an undirected graph where self-loops are not allowed. The vertex set of is . There is an edge between and if and . The number of edges in this graph is __________.
Official answer and solution
- Official answer
- 506
- From
- Official GATE 2014 answer key
Solution
Count horizontal, vertical, and diagonal edges in the 12x12 grid graph, or sum vertex degrees and apply the Handshaking Lemma.
The graph consists of vertices for , forming a grid with vertices.
An edge exists between and if and (excluding self-loops).
Let us count edges by category:
-
Horizontal edges:
Each of the 12 rows contains horizontal edges. -
Vertical edges:
Each of the 12 columns contains vertical edges. -
Diagonal edges:
The grid has unit squares.
Each unit square contains 2 diagonal edges:- One leading diagonal (slope )
- One trailing diagonal (slope )
Total number of edges in :
Verification via Handshaking Lemma:
- 4 corner vertices each have degree 3:
- boundary non-corner vertices each have degree 5:
- interior vertices each have degree 8:
506
Omitting the diagonal edges and counting only the grid mesh edges ().
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2014 Computer Science and Information Technology (CS) Session 1
- Question
- 61 of 65, printed as CS Q.51
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.