The assignment problem pairs n workers with n tasks to minimize the sum of the chosen costs, and the Hungarian algorithm solves it exactly in O(n³) time for any square matrix of finite values. In Excel, this is typically handled with the Solver add-in using a binary decision variable for each cell and a sum-of-products objective, while the row-and-column constraints enforce the one-to-one rule. A dedicated web tool called the Assignment Problem Solver runs the same Hungarian method in your browser, so you paste a labelled square matrix, get the minimum-cost pairing, and copy the result — no add-in to enable, no formulas to wire up, no trial-and-error to debug. When the matrix is 10 by 10, there are more than 3.6 million possible pairings, and a brute-force check of every one of them is the only obvious way to be sure you have the minimum — which is why an algorithm that does the same job in a fraction of a second is the standard tool for the job. The result is exact, not approximate, and it returns the proven minimum for whatever costs you enter.

What the assignment problem actually is
The assignment problem is the cleanest special case of a minimum-cost bipartite matching problem. You have two sets of equal size — call them workers and tasks, machines and jobs, or agents and locations — and a known numeric cost for every possible pairing. The goal is to choose exactly one cell from every row and exactly one from every column so that the sum of the chosen cells is as small as possible.
Because every cell can be either chosen or not, the search space of all valid assignments is n! for an n-by-n matrix, which grows fast. A 10-by-10 problem has more than 3.6 million permutations; a 20-by-20 problem has about 2.4 × 10¹⁸. The Hungarian algorithm, also called the Kuhn–Munkres method, was designed by Harold Kuhn in 1955 to solve this exactly in polynomial time, and the primal-dual version used in production solvers returns the optimum in O(n³) time. According to Google's OR-Tools documentation on assignment, the same mathematical model underlies most modern assignment and minimum-cost-flow code, and the optimal value is provably minimal for the numbers you put in.
The model is fully described by a square cost matrix: rows for workers, columns for tasks, one cost per cell. There is no "forbidden" or "missing" pairing in the standard form — every worker is assumed capable of every task, and the cost represents the only difference between pairings. This is the model Excel Solver and the browser tool both implement.
How to solve the assignment problem in Excel
The standard Excel workflow uses the Solver add-in, which is enabled through File → Options → Add-ins → Manage: Excel Add-ins → Solver Add-in. Once Solver is loaded, you set up a small linear program on a worksheet and let Solver find the binary decisions for you. The recipe is the same for any assignment size; only the number of cells scales.
Lay out the cost matrix first. Put unique task names across the top row of a range, unique worker names down the first column, and one finite numeric cost in every cell. The matrix must be square: three workers and three tasks, or four and four, never three and four. In an adjacent range, build a decision matrix of the same shape and fill every cell with 0. These cells are your variables, and Solver will flip them to 1 where the worker is assigned to that task.
Add a total cost cell that uses SUMPRODUCT across the cost matrix and the decision matrix. This is the cell Solver will minimize. Then add the two constraint families. For every worker row, the sum of the row's decision cells must equal exactly 1 — each worker does one task. For every task column, the sum of the column's decision cells must equal exactly 1 — each task is done by one worker. The decision cells themselves must be binary, either 0 or 1. Choose Simplex LP as the solving method and click Solve.
If the cost matrix is well-formed, Solver returns a 0/1 pattern with exactly one 1 in every row and column, and the total cost cell shows the minimum. The pairing for worker i is the column where row i has a 1. For a 3-by-3 example with cost matrix:
,T1,T2,T3W1,9,2,7W2,6,4,3W3,5,8,1
Solver chooses W1→T2 (cost 2), W2→T1 (cost 6), W3→T3 (cost 1), for a minimum total of 2 + 6 + 1 = 9. That single calculation, 2 + 6 + 1 = 9, is the entire output of the model and is the answer you copy into your report.
A faster browser-based alternative
Setting up Solver for a one-off assignment takes a careful hand on the formulas, the binary constraint, and the equality rows and columns. For a single homework problem or a quick draft schedule, the time spent wiring Solver is often longer than the time the Hungarian method itself needs to run. The Assignment Problem Solver skips all of that: you paste a labelled square matrix into a single text box, the deterministic Hungarian solver runs locally in your browser, and you get the pairings, individual costs, and minimum total back as text you can copy.
The web tool uses the same Kuhn–Munkres method under the hood, so the optimum it returns is the exact minimum for the matrix you entered, not an approximation. Eight independent test matrices were verified by enumerating every permutation, including 1-by-1 and 2-by-2 boundaries, a standard 3-by-3 case with total cost 5, complete ties, and a cyclic 4-by-4 zero-cost configuration. If a result did not match the brute-force minimum, the test failed.
How to use the Assignment Problem Solver step by step
- Write a header row that begins with a comma. The first field is empty, then list each unique task name. For a three-task example, the first line is ,Task A,Task B,Task C.
- Add one worker per row. Each subsequent line starts with a unique worker name, followed by exactly one finite numeric cost per task. The number of workers and the number of tasks must match, and every cell must be filled.
- Run the Hungarian solver. Submit the matrix. The solver validates that it is square, that all names are unique, and that every cost is a finite number; malformed input is rejected visibly.
- Inspect each pairing and its cost convention. The result lists one task for every worker, the individual cost of each pairing, and the minimum total. Costs may be positive, zero, or negative, but the solver always minimizes the numeric sum — if your data represents profit or score, transform it deliberately instead of assuming "best" means largest.
- Copy the exact minimum-cost assignment. The full result is available as plain text, so you can paste it into Excel, a report, or a scheduling sheet without retyping the pairings by hand.
The Hungarian algorithm in plain language
The algorithm maintains two numbers for every row and every column, called potentials, and repeatedly grows a matching by selecting the cheapest available augmenting path. At each step, the algorithm looks at reduced costs (each cell cost minus the row potential minus the column potential) and tightens the potentials so that a new zero-reduced-cost edge becomes available. When every row is matched, the algorithm stops, and the row-and-column potentials prove the result is optimal — no other pairing can produce a smaller total.
The exact mechanics are not what you need to use the tool, but the guarantee is what makes the method useful: the cubic-time bound means even a 20-by-20 problem solves in a small fraction of a second, and natural row-and-column order resolves ties deterministically, so the same matrix always produces the same pairing. For an expanded walkthrough of the method, the guide Solve Assignment Problem by Hungarian Method covers the same model with worked line-by-line reductions.
Limits of the cost-matrix model
The matrix model covers a complete weighted bipartite graph, which is exactly one slice of real-world scheduling. The Assignment Problem Solver does not handle forbidden pairings (blank cells), worker capacity beyond one task, skill thresholds, team dependencies, fairness, travel-time changes, precedence, partial availability, or uncertainty unless those effects are already represented correctly in the numbers. A negative cost is allowed but should genuinely mean a benefit under a minimization convention — pasting raw scores and assuming "best" means largest will give you a wrong answer.
If your problem has any of those real-world wrinkles, the right move is a validated mixed-integer, constraint-programming, or min-cost-flow solver that explicitly represents all the rules, and an independent human review of the final assignment before any staffing decision. Treat the matrix result as a transparent mathematical baseline, not an automatic personnel decision — real staffing also involves legal, ethical, and human considerations that no cost matrix can capture.
Excel Solver vs. a dedicated web tool
| Aspect | Excel Solver workflow | Assignment Problem Solver (web) |
|---|---|---|
| Setup time | Manual: build cost matrix, decision matrix, SUMPRODUCT, two constraint families, binary constraint | Paste a labelled square matrix; no formulas to wire |
| Add-in required | Yes — Solver must be enabled in Excel options | No — runs locally in the browser |
| Algorithm | Simplex LP on a binary 0/1 model | Deterministic Hungarian (Kuhn–Munkres) |
| Maximum size | Limited by Solver's variable and constraint count in your version | 20 by 20 in the current browser build |
| Output | A 0/1 decision matrix left on the worksheet | Pairing list, per-pairing cost, minimum total, copyable as text |
| Validation | You check the input shape and constraints yourself | Rejects malformed or rectangular matrices, duplicate names, blanks, NaN, infinite costs visibly |
For homework, a manual Hungarian calculation you want to verify, or a small machine-to-job allocation, the web tool is the shortest path. For larger or constrained schedules, the right move is a validated mixed-integer or constraint-programming solver that explicitly represents all your rules, not a single cost matrix.