A hexagonal when drawn will have 6 sides and 9 diagonals
Thus, we see that;
When n = 4, d = 2
When n = 5, d = 5
When n = 6, d = 9
Using combination, we will find number of pairs of 2 vertices that can possibly be formed from n-vertices. Thereafter we will subtract n from that since it's neighboring vertices can't combine with the current one.