Pruning in Complete Search

Making brute force faster.

Even in brute force, pruning helps.

Bound checking: If the current partial solution already exceeds a limit, stop.

// Subset sum: if current sum exceeds target, prune
if currentSum > target:
    return

Ordering: Try more promising options first. If you find a solution early, you can potentially stop or prune more aggressively.

Symmetry elimination: If problem has symmetry, only explore canonical representatives.

Example: Placing identical items. Instead of permuting them, only consider sorted placements.

Pruning doesn't change worst-case complexity but often dramatically reduces average case.