Skip to content

Soft constraints

Soft constraints are preferences. Violating them does not make a roster invalid, but each violation adds a weighted penalty to the roster's score. The engine selects the roster with the lowest total penalty from among all valid rosters.

Each soft constraint has a weight. A higher weight means the engine treats that preference as more important relative to others. When two preferences conflict, the one with the higher weight tends to win.

How penalty scoring works

The total penalty is the sum of all individual penalty contributions:

total_penalty = sum of (weight × deviation) for each soft constraint

The penalty value in the output represents this total. Lower is better. A penalty of zero would mean every soft preference was fully met, which is rarely achievable in practice.

Shift preferences

Off-day preferences

Coverage preferences

Leave preferences

Weight summary

Preference Weight
Even shift distribution 10
Untyped leave preference 7
Shift block stability 8
Weekend off balance 6
Prior-month history bias 5
Paired weekend offs 4
Target coverage shortfall 3