To start back tracking algorithm, the following pseudocode can be called for i=0; X[1..0] represents the empty tuple.
ALGORITHM Backtrack(X[1..i])
//Gives a template of a generic backtracking algorithm
//Input: X[1..i] specifies first i promising components of a solution.
//Output: Alll the tuples representing the problem's solutions
If X[1..i] is a solution write X[1..i]
else
for each element x belongs to Si+1 consistent with X[1..i] and constraints do
X[i+1] <- x
Backtrack(X[1..i+1])
I am having difficulty in understanding above logic. I have tried to undestand with 4 queen problem with step thorugh but not. Kindly request your help in understanding above logic with steps of 4 queens problem.
Thanks!