Tools — Build it yourself
Hungarian Assignment Solver
Every coach faces the same quiet puzzle: five players, five rotation roles, and a cost for every pairing — how tired each player gets at each spot, how strongly they prefer it, how badly the matchup fits. Pick the cheapest role for one player and you may strand a teammate with a terrible one. The assignment problem asks for the pairing that makes the total cheapest, with every player used exactly once and every role filled exactly once.
The solution is older than the computer it usually runs on. Harold Kuhn published the algorithm in 1955, building directly on work by the Hungarian mathematicians Dénes König and Jenő Egerváry — which is where the name comes from — and James Munkres gave the polynomial-time form in 1957. It works by reduction: subtract each row’s smallest entry from that row, then each column’s smallest entry from that column. Those subtractions cannot change which assignment is best, because they lower every possible total by the same constant. What remains is a hunt for a complete matching among the zeros, guided by dual potentials that manufacture new zeros exactly where they are needed until the matching exists.
Edit any cell below — the defaults frame five players against five roles, and the grid can grow to eight by eight — then solve. The solver on this page is a genuine implementation of the algorithm, running the O(n³) potentials method, not a brute-force search through every permutation. Eight players would mean 40,320 permutations to check by force; the Hungarian method settles the same question in a few hundred operations, and it settles it exactly: the assignment it returns is provably the cheapest one that exists.
Loading the solver…
Where this earns its keep
Roster spots are the friendly version. The same mathematics assigns referees to matches, delivery drivers to routes, workers to shifts, and bidders to lots — anywhere a set of agents meets a set of tasks with a price on every pairing and a rule that nobody does two jobs. Costs here must be zero or more, which fits fatigue and preference scores naturally. Everything runs on your device: the numbers you type never leave this page, and there is nothing to download — the answer is simply shown.