Backtracking rat in the maze n-queens problem m-coloring problem hamiltonian cycle permutation of numbers such that the sum of two consecutive numbers is a prefect square