Savanty

Task & resource assignment

Assignment problems map every task to a resource under hard constraints — skills, capacity, exclusivity. Savanty encodes each rule as an ASP integrity constraint and Clingo finds an assignment that satisfies all of them, or proves none exists.

Domain: Assignment

Assignment is a discrete constraint problem in its purest form: a finite set of tasks, a finite set of resources, and a set of rules governing which pairings are legal. Job-to-machine, ticket-to-engineer, order-to-picker — the structure is the same.

The encoding

Each task takes exactly one resource (a choice rule); skill, capacity, and exclusivity requirements become integrity constraints:

1 { assign(T, W) : worker(W) } 1 :- task(T).   % each task to one worker
:- assign(T, W), not skilled(W, T).            % only skilled workers
:- 3 { assign(T, W) : task(T) }, worker(W).    % capacity: max 2 tasks each
#show assign/2.

Why translation-plus-solver wins

The person who knows the assignment rules — a team lead, a dispatcher — usually does not write constraint programs. Savanty’s LLM does that translation, and Clingo guarantees the result: every task lands on a legal, in-capacity worker, or you get a faithful UNSAT when the rules cannot all hold at once. The generated ASP is returned as result.asp_code so the rules are auditable.

For balancing workload rather than just satisfying capacity, describe it as a preference; Savanty turns hard rules into integrity constraints and soft goals into an optimization directive. See how it works for the full pipeline.

Frequently asked questions

Can I balance workload across workers?

Yes. Express balancing as a soft preference (an optimization directive) while keeping skill and capacity as hard integrity constraints. Say which is which in your description.

How large can the assignment be?

ASP handles discrete finite-domain assignment well; the practical ceiling depends on the number of tasks, workers, and the tightness of constraints. Start small, inspect result.asp_code, and scale up.

Related

Try Savanty on your own problem

Open source, MIT licensed. Install from PyPI and solve your first constraint problem.