Skip to main content
The explanation endpoint provides detailed insights into your solution, including constraint violations and alternative assignment options.

Enable Explanation

Add the explanation option to your request:

Solution Response

The solver assigns shift-1 to Alice since she has the required bar skill:

Unserved Reasons

When explanation is enabled, unassigned shifts also get their blocking hard constraints reported directly on the solve response via unservedReasons:
unservedReasons is only populated when options.explanation.enabled is true.

Explanation Response

Request the explanation from /v2/fill/jobs/{id}/explanation:
conflicts
array
Individual constraint violations contributing to the score
conflicts.description
string
Human-readable description of the violated constraint
conflicts.relation
string
Related shift id, e.g. the second shift of a minimum-rest conflict
unresolved
array
Aggregated constraints that could not be fully satisfied

Alternative Assignments

When explanation is enabled, the solver evaluates all possible employee-shift combinations:
The alternatives show that assigning Bob would violate a hard constraint (skill mismatch), explaining why Alice was chosen.

Explanation Options

options.explanation.enabled
boolean
default:"false"
Enable post-processing to generate alternatives for each assignment
options.explanation.filterHardConstraints
boolean
default:"false"
Exclude alternatives that violate hard constraints from the response
options.explanation.onlyUnassigned
boolean
default:"false"
Compute alternatives only for shifts left unassigned, skipping already-filled shifts to reduce response size and solve time on large problems

Use Cases

Use filterHardConstraints: true to only see viable alternatives, reducing response size for large problems.