Knight's tour (Degree of the chessboard)

The given code can find the degree of each node of N x N size
chessboard. Now, once degree's are known one can easily find a knight's
tour using Warnsdorff Rule.
dynamic degree