Example : for $V = \left \{ \left ( i,j \right ) \; | \; 1\leq i\leq 4,1\leq j\leq 4 \right \}$
with the condition for edge is $|\text{x co-ordinate difference} | \leq 1 \or |\text{y co-ordinate difference} | \leq 1$ between any two vertices.
In QS: $12*12$ grid,
- $4*10$ = $40$ vertices with degree $5$
- $4$ corner vertices with degree $3$
- $10*10$ = $100$ vertices with degree $8$
- $\sum (\text{degree}) = 40*5+4*3+100*8 = 1012$
- $n(E) = \frac{\sum(\text{degree})}{2} = 506$