Skip to content

Unserved penalty / job importance

Unserved penalty factor

The optimiser tries to serve every Job. When that is impossible — not enough Driver hours, not enough capacity, or a stop that is simply too far — some Jobs have to be left unserved.

If you do not set unserved_penalty_factor, every Job is treated as equally important. The optimiser then drops whichever Jobs are hardest to fit, which is usually the furthest or most awkward ones, so that it can keep as many others as possible.

unserved_penalty_factor lets you say that some Jobs matter more than others. It is a multiplier on how bad it is to leave this Job unserved. Omit it, or set it to 1, for the default “all Jobs are equal” behaviour.

Examples

  • Factor 2 on Job A: the optimiser would rather serve A and leave two ordinary Jobs (factor 1) unserved than the other way around. A is worth two default Jobs.
  • Factor 10 on two distant deliveries: even if those stops take a long detour, the optimiser will keep them and drop cheaper nearby work instead. Without the factor it would have skipped the distant pair.

The factor must be a number greater than zero. A factor of 0 is rejected: the optimiser would never choose to serve that Job.

The factor cannot break hard limits. A Job that cannot fit in any Driver's Shift stays unserved no matter how high you set it.

Pickup Delivery groups are skipped together: if one connected Job is left unserved, the rest of that group is unserved too. Later Than does not work that way — each Job is decided on its own.

In a multi-shift request the factor still applies across the whole planning horizon. Raising it does not force a Job onto a particular day.

{
  "uid": "urgent_customer",
  "duration": 10,
  "unserved_penalty_factor": 3,
  "location": {"lat": -33.849489, "lon": 151.127482}
}