Assignment Problem (Hungarian) Calculator
Enter the 3×3 cost matrix to find the minimum-cost assignment.
Result
How it is calculated
The tool solves a fixed 3×3 problem: three agents A, B and C, three tasks 1, 2 and 3, and nine costs cij where i is the agent and j the task. Each agent gets exactly one task and each task goes to exactly one agent, which gives 3! = 6 possible matchings. The tool adds up the three costs of every matching, total = cA,p(A) + cB,p(B) + cC,p(C), and returns the smallest. It tries every case, so the answer matches what the Hungarian method gives for this size. If two matchings tie, the first in the tool's fixed order is shown. It always minimises, and all nine cells must be filled. Costs can be any numbers, including negative ones or decimals.
Worked example
Costs for agents A, B, C across tasks 1, 2, 3: A is 14, 9, 11; B is 8, 12, 10; C is 13, 7, 15. The six matchings cost 41 (A1 B2 C3), 31 (A1 B3 C2), 32 (A2 B1 C3), 32 (A2 B3 C1), 26 (A3 B1 C2) and 36 (A3 B2 C1). The lowest is 26. The tool shows a total of 26.00 with the assignment A→3, B→1, C→2: 11 + 8 + 7 = 26. A takes task 3 although its cheapest cell is task 2, because C needs task 2 more.
Common mistakes
- Taking each agent's cheapest task independently. In this example A would pick task 2 and C would also want task 2, so the choices clash; the true optimum accepts a higher cost for A.
- Entering profits and expecting the best match. The tool minimises; to maximise, enter each profit as a negative number, or subtract each from the largest value.
- Trying a 4×4 or a rectangular matrix. This tool is fixed at 3 agents and 3 tasks.
- Leaving a cell blank for a forbidden pair. All nine cells are required; use a very large cost to make a pair practically impossible.
- Reading the A→3 notation as a time or a count. It means agent A is assigned to task 3.
About this calculator
The assignment problem asks: given a set of agents and a set of tasks, each with a different cost depending on who does what, how do you match every agent to exactly one task so the total cost is as small as possible? For a 3×3 cost matrix, this calculator finds the optimal answer by evaluating all 6 possible permutations of assignments — the same optimal result the more scalable Hungarian algorithm (developed by Harold Kuhn in 1955, building on work by Hungarian mathematicians König and Egerváry) would produce for larger matrices in polynomial time.
This is a foundational problem in operations research and combinatorial optimization, with direct applications in assigning workers to jobs, machines to production orders, delivery drivers to routes, or students to project teams so as to minimize total cost or maximize total efficiency. Logistics planners, HR schedulers, and computer scientists studying bipartite matching all encounter this exact problem.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments (1)
If you have fewer agents than tasks, pad the matrix with a dummy agent whose costs are all zero. Whichever task the dummy lands on is simply left undone, and the real agents get the cheapest feasible split. With more agents than tasks, add a dummy task column of zeros instead. The tool stays limited to three by three. What kind of assignment problem are you working on?