A soft constraint expresses a desirable condition that may be violated. Unlike a hard constraint, it influences solution quality rather than defining an absolute requirement. Optimization models represent this preference with rewards for satisfaction or penalties for violation. section 1.3.3 section 2.1.3
Typical soft constraints include:
- Scheduling lectures in nearby rooms, avoiding unusually early or late lectures, or giving each teacher at least three teaching days. section 1.3.3
- Preferring routes that avoid busy intersections, rush-hour highways, or school zones while still allowing those routes. section 1.3.3
- Allowing a cargo-bike load to exceed capacity while adding a penalty to discourage overweight solutions. section 1.3.3
Cargo-bike loading
Suppose ten parcels have different weights, profits, and efficiencies. The objective maximizes profit while minimizing weight; exceeding the bike’s capacity remains possible but adds a penalty of 50. Increasing the penalty makes overweight solutions less attractive without making them impossible. section 1.3.3
Figure 1.7 The cargo bike loading problem is an example of a problem with a soft constraint. While the weight of the packages can exceed the bike’s capacity, a penalty will be applied when the bike is overweight.
Use the cargo-bike figure to connect capacity violation, penalty design, and trade-offs between competing objectives. section 1.3.3
