Calculator
Set the matrix size, define the objective, customize labels, enter values, then solve. The page supports balanced and unbalanced assignment models.
Formula Used
Objective function: Minimize or maximize Σ Σ valueij × xij.
Row constraint: For every agent i, Σ xij = 1 in the balanced model.
Column constraint: For every task j, Σ xij = 1 in the balanced model.
Binary rule: xij is 1 when agent i is assigned to task j, otherwise 0.
Maximization conversion: transformed cost = M − valueij, where M is the largest balanced entry.
The page applies the Hungarian method. It balances unequal matrices with dummy rows or columns, performs the required minimization steps, then reports the chosen assignments using the original values.
How to Use This Calculator
- Choose the number of agents and tasks.
- Select minimization for costs or maximization for profits.
- Set a dummy value if the matrix is unbalanced.
- Enter labels for rows and columns if needed.
- Fill the matrix with numeric values.
- Click Solve assignment problem to calculate the best pairing.
- Review the totals, assignments, unmatched items, and chart.
- Use the CSV or PDF buttons to export the result.
Example Data Table
This sample is a standard minimization case. Its optimal assignment is Agent A → Task 2, Agent B → Task 1, Agent C → Task 3, Agent D → Task 4.
| Agent / Task | Task 1 | Task 2 | Task 3 | Task 4 |
|---|---|---|---|---|
| Agent A | 9 | 2 | 7 | 8 |
| Agent B | 6 | 4 | 3 | 7 |
| Agent C | 5 | 8 | 1 | 8 |
| Agent D | 7 | 6 | 9 | 4 |
FAQs
1. What does this assignment problem solver calculate?
It finds the best one-to-one matching between agents and tasks. Depending on your selected objective, it either minimizes total cost or maximizes total profit.
2. Can I solve unbalanced assignment problems here?
Yes. When rows and columns differ, the calculator adds dummy rows or columns using your chosen dummy value, then solves the balanced model.
3. How does maximization work in this solver?
The page converts profit entries into equivalent minimization costs by subtracting each value from the balanced matrix maximum. The reported answer still uses original input values.
4. What dummy value should I choose?
Use a value that reflects the cost or profit of leaving an agent or task unmatched. Zero is common, but penalties or missed-opportunity values are often better.
5. Does the calculator support decimals and negative values?
Yes. Every matrix cell accepts decimal numbers and negative values, which is useful for rebates, gains, penalties, or adjusted scoring models.
6. What does the chart show after solving?
The bar chart plots the original input values for each real assignment pair, helping you compare selected costs or profits across the final solution.
7. What is included in the CSV and PDF downloads?
Both exports include the summary metrics and assignment table. They are useful for reports, documentation, classroom review, and operations research analysis.
8. Is this useful for teaching and exam practice?
Yes. The balanced matrix, transformation details, formulas, and worked results make it suitable for learning assignment models and checking manual solutions quickly.