Hill Climbing Search - 8 queens
5 - Horizontal attacks
9 - Diagonal attacks of slope -1
3 - Diagonal attacks of slope +1
-
Total 17 pairs of queens attacking each other.


And yes, the numbers in each square correspond to number of attacking pairs of the queen if the queen in the corresponding column is moves to that location.