Differences between hard and soft constraints

If a hard constraint is violated, there is no solution. Breaking a soft constraint incurs a penalty of the value multiplied by the weights, which increases the objective function value.

Constraints Violation Solution Space Search Space Solution Time No solution risk
Hard If a hard constraint is violated, there is no solution. They decrease the solution space They reduce the search space Faster/Slower There is a potential risk of no solution
Soft Breaking a soft constraint incurs a penalty of the value multiplied by the weights, which increases the objective function value. Same Same Slower No risk