In the Backtracking approach for the 8-Queens problem, once a feasible…
2025
In the Backtracking approach for the 8-Queens problem, once a feasible solution is found, the algorithm:
Answer: B. Continues searching for more solutions — Concept Backtracking builds a candidate arrangement piece by piece (one queen per row) and abandons any partial placement that breaks a constraint. Whether…
- A.
Stops and returns the solution
- B.
Continues searching for more solutions
- C.
Iterates through all possibilities
- D.
Rearranges the queens to optimize the solution
Attempted by 59 students.
Show answer & explanation
Correct answer: B
Concept
Backtracking builds a candidate arrangement piece by piece (one queen per row) and abandons any partial placement that breaks a constraint. Whether the search stops the instant one complete, conflict-free arrangement is found, or keeps going, depends entirely on what the routine is written to do: a routine built to return a single answer exits as soon as it reaches one valid full placement; a routine built to enumerate every answer instead records that placement as one more result, undoes it, and resumes exploring the remaining branches.
Application
Queens are placed one row at a time, checking at every step that the new queen shares no row, column, or diagonal with any queen already on the board.
When the 8th queen is placed without any conflict, the current arrangement is a complete, feasible placement.
The backtracking routine associated with the 8-Queens problem is the classic demonstration that the puzzle admits 92 distinct arrangements, so it is written to find every one of them rather than stop at the first.
To do that, once a feasible arrangement is recorded, the routine removes the last-placed queen (backtracks) and resumes trying the remaining candidate squares in the current and earlier rows, exactly as it would after hitting a dead end.
This repeats until every branch of the search tree has been explored, at which point every valid arrangement has been found.
Cross-check
If the goal were only to report any one workable placement, the search would indeed stop there — that is a legitimate design for a general constraint search. But the well-known 8-Queens backtracking routine is the all-solutions demonstration, so a feasible placement is treated as one recorded result, not a stopping condition.
Result
The algorithm continues searching for more solutions after a feasible placement is found.
Explore the full course: Bihar Stet Paper Ii Computer Science