I've regularly encountered that there are too many constraints to categorize into just hard and soft constraints. For example:
- Physical constraints (very hard), e.g. 1 person can only be at 1 spot at the same time
- Legal constraints (hard), e.g. 1 person can only do 1 shift per day
- Unassigned constraints (less hard), e.g. each shift must be assigned (broken during overconstrained planning)
- Non-disruptive constraints (even less hard), e.g. don't change the schedule unless it's to avoid breaking harder constraints given the input change
- Monetary constraints (soft), e.g. fuel consumption in VRP
- Fairness constraints (very soft or less soft depending on enterprise or government case), e.g. distribution of total workload per employee
Obviously, physical constraints can't be broken. Legal constraints can't be broken either - unless of course you risk people dying (unassigned shifts in intensive care). And the lower hard constraints shouldn't be broken normally either, but it does happen... so I prefer to call those medium constraints. In any case, there's clear priority between these constraint levels - and still each level (such as monetary constraints) might have multiple normally weighted constraints.
One common way I've seen in the literature to deal with such cases is to multiply the priority constraint by a big weight and add it into the fitness function alongside the lower priority constraint.
What is the canonical name of this practice?
I've started calling this practice Score Folding in the OptaPlanner manual, but I've not seen that term used anywhere else, so I am wondering if there's a consensus for it that I should use instead.
Note that I am not a fan of Scoring Folding, to say the least. I've introduced for multi score level support a decade ago, to avoid it, as the big weight can easily cause invalid behavior with the wrong dataset, being too big, or too small, or both (even with 64 bit numbers).
Here's an illustration:
In the example above, we're folding a harder and a softer constraint into the soft score. The harder constraint is the number of CPU too little. The softer constraint is the maintenance price of each computer.