# new session-16 - Backtracking BACKTRACKING It is one of the...

• 13

This preview shows page 1 - 7 out of 13 pages.

Backtracking

Subscribe to view the full document.

BACKTRACKING It is one of the most general algorithm design techniques. Many problems which deal with searching for a set of solutions or for a optimal solution satisfying some constraints can be solved using the backtracking formulation. To apply backtracking method, tne desired solution must be expressible as an n-tuple (x1…xn) where xi is chosen from some finite set Si. The problem is to find a vector, which maximizes or minimizes a criterion function P(x1….xn). The major advantage of this method is, once we know that a partial vector (x1,…xi) will not lead to an optimal solution that (m i+1 ………..m n ) possible test vectors may be ignored entirely.

Subscribe to view the full document.

n-Queens Problem A queen that is placed on an n x n chessboard, may attack any piece placed in the same column, row, or diagonal. 8x8 Chessboard

Subscribe to view the full document.

4-Queens Problem Can n queens be placed on an n x n chessboard so that no queen may attack another queen?
• Winter '12
• praveen
• Backtracking, Eight queens puzzle, n-queens problem, possible test vectors

{[ snackBarMessage ]}

###### "Before using Course Hero my grade was at 78%. By the end of the semester my grade was at 90%. I could not have done it without all the class material I found."
— Christopher R., University of Rhode Island '15, Course Hero Intern

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern