Graph Theory

Answer & solution
Official answer: 506
1. Method and setup. The adjacency condition permits horizontal, vertical and diagonal neighboring grid points, like king moves on a chessboard. Count each undirected edge in one direction only. There are eleven gaps per row or column and two diagonals per unit square; longer or wrapping moves are not allowed.
2. Work through the result and its assumptions. Count horizontal and vertical nearest-neighbor edges: 12·11 each. Each of the 11·11 unit squares contributes two diagonals. These are all permitted distinct vertex pairs, so E=132+132+242=506; self-loops are excluded.