General
Backtracking is an algorithm for finding all possible solutions to some computational problems. The solutions are found by incrementally building candidates for possible solutions and checking The solutions are found by incrementally building candidates for possible solutions and checking for its validity. If it determines that the candidate cannot be part of a valid solution, it abandons that configuration. Backtracking can be applied to problems that allows for partial solutions, meaning part of a configuration can be used to determine if it is a member the full solution. Backtracking allows the possibility of eliminating large number of solutions in a single test; this makes backtracking, often much faster than a brute force approach.
Backtracking for 8 Queens
Place the queens on one column at a time starting in the first column. Every time a queen is placed in a square, there are eight possible places to place a queen in the next column. If a queen cannot be placed in a column safely and it runs out of rows to check, the program must backtrack to the previous column and continue to the next row. If a queen is safely placed in the last column, it means that is one possible solution to the 8 Queens problem.