When should I use soft vs hard, route vs activity constraints

What is the convention for determining if a problem or constraint that wants to be applied, should be a hard or soft constraint. After that choosing between route or activity constraint? I’ve tried reading the new docs but it’s incomplete and the examples don’t shed much light on this.

Is there some resource about it?

Thanks in advance

Hi @aj1310,

Regarding hard vs. soft constraints, as stated in “Walkthrough Constraints”:

Whereas hard constraints must be met and cannot be broken, soft constraints are always fulfilled but uses penalties to express “good” and “bad” insertions.

Regarding route vs. activity constraints, take hard constraint for example:

hard activity constraint

evaluates whether a new activity can be inserted between an activity segment (prevAct,nextAct).

hard route constraint

evaluates whether a new job (insertionContext.getJob()) can be inserted (into) existing route (insertionContext.getRoute()).

Hopefully this helps.

Best regards,

The activity and route constraints is clearer, thanks.

The hard vs soft, other than the method of determining if they are fulfilled, sound too similar in their definitions. In what cases is it more beneficial one over the other?