Assignment Problem Solver
Find the exact minimum-cost one-to-one pairing between equally sized worker and task sets with the deterministic Hungarian algorithm.
Privacy: your files never leave your device. All processing happens locally in your browser.
How to use
- 1.Write a header beginning with a comma followed by unique task names.
- 2.Add one worker per row with exactly one finite cost for every task, keeping worker and task counts equal.
- 3.Run the Hungarian solver, inspect each pairing and cost convention, then copy the exact minimum-cost assignment.
About Assignment Problem Solver
Assignment Problem Solver finds a minimum-cost one-to-one pairing between workers and tasks. Paste a square comma-separated matrix whose first row names the tasks and whose remaining rows name workers followed by their costs. The result lists one task for every worker, the cost of each pairing, and the minimum total. Everything runs locally in the browser and the assignment can be copied as text.
The assignment problem models a complete weighted bipartite graph. One side contains workers, machines, agents, or other resources; the other contains tasks, jobs, locations, or choices. Every matrix cell is the cost of one possible pairing. A valid solution selects exactly one cell from every row and exactly one from every column. Google OR-Tools describes this as minimizing total assignment cost while preventing two workers from taking the same task.
This implementation uses the Hungarian algorithm, also known as the Kuhn–Munkres method. It maintains row and column potentials and repeatedly augments a minimum reduced-cost matching. After all rows are incorporated, every task column points to exactly one worker. The method runs in cubic time for an n by n matrix and returns an exact optimum for the stated complete, square, finite-cost model. Natural row and column order resolves equal-cost choices deterministically.
Enter the matrix with an empty top-left field. A three-task example begins “,Task A,Task B,Task C”; each following line begins with a unique worker name and then exactly three numeric costs. Worker and task counts must match. The current browser bound is 20 by 20, which is small enough for immediate interaction while covering classroom examples and modest scheduling drafts. Costs may be positive, zero, or negative, provided they are finite and within the stated range.
A negative cost can represent a benefit only if that sign convention genuinely fits your model. The solver always minimizes the numeric sum. If your data contains profits or scores to maximize, transform them deliberately or use a maximization model; do not paste scores and assume that “best” automatically means largest. Similarly, blank or forbidden pairings are not supported as missing cells. This version assumes every worker can take every task.
The exact optimum covers only the costs entered. It does not account for skill thresholds, workload capacity, team dependencies, fairness, travel time changes, precedence, multiple tasks per worker, worker availability, or uncertainty unless those effects are already represented correctly. Real staffing decisions may also involve legal, ethical, and human considerations that cannot be reduced to a cost matrix. Treat the result as a transparent mathematical baseline, not an automatic personnel decision.
Eight matrices were independently checked by enumerating every permutation, including 1×1 and 2×2 boundaries, a standard 3×3 example with total cost 5, complete ties, and a cyclic 4×4 zero-cost solution. Tests assert that returned tasks are unique and every worker is assigned. Malformed or rectangular matrices, duplicate names, blanks, NaN, and infinite costs are rejected visibly.
Use this page to verify homework, compare a manual Hungarian calculation, allocate a small set of machines to jobs, or build a reproducible minimum-cost baseline. For larger or constrained schedules, use a validated mixed-integer, constraint-programming, or min-cost-flow solver that explicitly represents all rules, then independently review the final assignment before acting.
Methodology & sources
Parse a complete square matrix of 1–20 uniquely named workers and tasks, validate finite costs, then run the primal-dual Hungarian algorithm with deterministic row/column tie order. Return one unique task per worker, one unique worker per task, and the exact minimum total for the entered matrix.
Frequently asked questions
- Does this always find the minimum total cost?
- Yes for a complete square matrix of finite costs with exactly one task per worker and one worker per task.
- Can I have more workers than tasks?
- Not in this version. Add meaningful dummy rows or columns yourself only if their costs correctly represent leaving a worker or task unmatched.
- Can I maximize profit instead?
- The solver minimizes numbers. Convert profits using a justified transformation or use a model designed for maximization.
- Can a cell be forbidden?
- There is no blank forbidden-cell feature; every matrix cell must contain a finite cost.
Related tools
- Knapsack Problem CalculatorChoose the maximum-value subset of indivisible items under a whole-number capacity with an exact, inspectable 0/1 dynamic program.
- Traveling Salesman SolverBuild a closed Euclidean tour through 3–50 coordinates using nearest neighbor plus deterministic 2-opt improvement.
- Bin Packing CalculatorPack labelled item sizes into equal-capacity bins with deterministic FFD placement, utilization, and a size lower bound.
- Minimum Spanning Tree SolverFind an exact minimum-weight tree connecting every named node with deterministic Kruskal selection and explicit disconnected-graph errors.
- Absolute Value CalculatorInstantly find |x| — the absolute value of any number, free.
- Age CalculatorYour exact age in years, months, and days — updated live
Calculators guides
View all- How to Calculate Business Days Between Dates in Excel
- Calculate Brinell Hardness from Load, Ball and Indent Diameter
- How to Calculate Bra Size From Two Measurements
- How to Calculate Body Fat and Muscle Mass Percentage
- How to Calculate BMR Accurately with Two Proven Formulas
- How to Calculate BMI for Kids Accurately in Minutes
- How to Calculate Online Percentage in Your Browser
- How to Calculate BAC: Widmark Formula, Drinks & Time
- How to Determine Baby Eye Color with a Free Online Calculator
- How to Calculate Average Atomic Mass in Minutes
- How to Convert Area to Acres with a Free Online Tool
- Calculate Annular Area of a Cylinder in Seconds
- Convert Angle Measure to Decimal Degree Form in Seconds
- How to Calculate Age from Birthdate in Excel (Quick Formula)
- Convert Percentage to Absolute Value in One Step
- Get Any Number of Pi Digits Instantly – Up to 10,000
- How Is the Periodic Table Useful: Browse All 118 Elements
- How to Calculate Percentage Increase or Decrease Fast
- How to Calculate the Area of a Parallelogram
- How to Set Paper Thickness on Brother Printer Using GSM and lb