The assignment problem asks for the cheapest one-to-one pairing between two equally sized sets — workers on one side, tasks on the other — when every worker-to-task cost is known, and the deterministic Hungarian algorithm solves it exactly in cubic time on any n×n matrix of finite costs. An online assignment problem solver takes a labelled cost matrix you paste into a single text area, runs the Hungarian algorithm locally in your browser, and returns one unique task for every worker along with the exact minimum total cost. Because everything runs client-side, no data leaves your device, which makes the same page suitable for verifying homework, checking a manual Hungarian calculation, or sketching a small machine-to-job allocation before committing it to a spreadsheet. The result is deterministic: identical inputs always produce identical pairings, with natural row and column order used to break ties, so a saved matrix and a saved answer line up cleanly across runs and across users.

What the assignment problem actually models
The classical assignment problem describes a complete weighted bipartite graph. One side lists workers, machines, agents, or other resources; the other side lists tasks, jobs, locations, or choices. Every possible worker-to-task pairing has a numeric cost, written into one cell of a square matrix. A valid solution picks exactly one cell from each row and exactly one cell from each column — one task per worker, one worker per task — and the goal is to minimise the total of the chosen cells.
This structure appears in operations research courses under names like the "linear assignment problem" and the "minimum-cost perfect matching." Google OR-Tools describes it as minimising total assignment cost while preventing two workers from taking the same task, which is the same constraint the browser solver enforces. The defining requirement is that the matrix is square and complete: the same number of workers and tasks, and a finite cost for every pairing, with no forbidden cells left blank.
Paste a matrix and get the minimum-cost pairing
- Type a header line that begins with a comma and then one unique task name per column, for example ,Task A,Task B,Task C.
- Add one row per worker, with the worker name in the first column and exactly one finite cost for every task after it. Worker names must be unique, task names must be unique, and the number of workers must equal the number of tasks.
- Paste the whole block into the Assignment Problem Solver, run the Hungarian solver, inspect each pairing and the total, and use the copy button to export the exact minimum-cost assignment as text.
Three-task example you can paste directly:
,Task A,Task B,Task CWorker 1,4,1,3Worker 2,2,0,5Worker 3,3,2,2
For this matrix the unique minimum assignment is Worker 1 → Task B, Worker 2 → Task A, Worker 3 → Task C, with total cost 1 + 2 + 2 = 5. Costs of 0 and negative numbers are accepted as long as they are finite, so a small bonus, refund, or zero-cost option can sit in a cell without breaking the calculation.
How the Hungarian algorithm reaches the optimum
The page implements the Hungarian algorithm, also called the Kuhn–Munkres method. It maintains a set of row and column potentials and repeatedly augments a minimum reduced-cost matching until every worker row is matched. Once every row is incorporated, each task column points to exactly one worker, which is the optimum assignment for the entered costs.
For an n×n matrix this runs in cubic time, which is why the browser can return an exact answer immediately for classroom-sized inputs. Two consequences matter in practice. First, the answer is exact: it is not a heuristic approximation, and it does not depend on the order in which workers or tasks are listed beyond the deterministic tie-break. Second, ties are resolved in natural row and column order, so if two pairings share the same minimum total, the same input always returns the same pairing — useful when you want to compare an answer key to a student's submission or reproduce a published example months later.
When this solver fits and when it does not
| Scenario | What the solver does | What you actually need |
|---|---|---|
| Square cost matrix, every cell finite | Returns the exact minimum-cost pairing in the browser | — |
| Rectangular matrix or missing costs | Rejected visibly before the solver runs | Pad with dummy rows or columns whose costs correctly encode leaving a worker or task unmatched |
| Profit or score to maximise | Only if you transform values deliberately first | A model that natively maximises, or a justified sign or offset transform on the matrix |
| Skill thresholds, capacity, precedence, or uncertainty | Not represented in the matrix | A validated mixed-integer, constraint-programming, or min-cost-flow solver |
| More than 20 workers or 20 tasks | Outside the current browser bound | A server-side linear assignment library with the same Hungarian guarantee |
Treat the solver's output as a transparent mathematical baseline, not an automatic personnel decision. Real staffing choices involve legal, ethical, and human factors that a cost matrix cannot capture; an optimisation that quietly ignores them is worse than no optimisation at all. For a homework check, a teaching demo, or a draft schedule up to 20 by 20, the matrix is usually the right level of detail.
Reading the result and copying it out
The output lists one task for every worker, the cost of each pairing, and the minimum total. Because the assignment is one-to-one, the task names in the result are all unique and every worker appears exactly once. A visible reject message appears for malformed input: rectangular matrices, duplicate names, blanks, NaN, or infinite costs. The copy button exports the pairing and total as plain text, so the answer drops straight into a lab report, a chat reply, or a note without retyping.
If your data contains profits or scores, do not paste them and assume "best" automatically means the largest number. The solver always minimises the numeric sum; a profit matrix needs an explicit transformation — for example, subtracting every cell from a large constant so that the largest profit becomes the smallest cost — or a different model designed for maximisation, before you can trust the pairing that comes back.
Tested cases and what was checked
Eight matrices were independently checked against full permutation enumeration during development. The set includes 1×1 and 2×2 boundary cases, a standard 3×3 example with minimum total cost 5, complete ties where every pairing shares the same total, and a cyclic 4×4 zero-cost configuration. Each test asserts that returned tasks are unique, that every worker is assigned, and that the reported total matches the brute-force enumeration. Natural row and column order resolves equal-cost choices deterministically, so two runs on the same matrix cannot silently disagree.
The rejection list is also worth knowing: a 20-row, 30-column matrix, a row with a blank cell, a row containing the text "NaN," a worker name that duplicates a task name, and a cell containing "Infinity" are all stopped before the algorithm starts. If you see a rejection, fix the matrix shape or the offending cell and rerun — the solver does not silently average a missing cost, swap an infinite value for zero, or pick an arbitrary default. For larger or more constrained schedules, use a validated mixed-integer, constraint-programming, or min-cost-flow solver that explicitly represents all of the rules, then independently review the final assignment before acting on it.