In
computer science, brute-force search or exhaustive search is a trivial but very general problem-solving technique, that consists of systematically enumerating all possible candidates for the solution and checking whether each candidate satisfies the problem's statement.It should not be confused with
backtracking, where large sets of solutions can be discarded, without being explicitly searched. For example, consider the popular
eight queens problem, which asks to place eight
queens on a standard
chessboard so that no queen attacks any other. A brute-force approach would examine all the possible placements in order to find the ones where no queen attacks any other. A backtracking approach is much faster, because it can use the fact that, if two queens attack each other, it is pointless to place the remaining queens on the board.
See more at Wikipedia.org...