Productivity and Utilities

Assignment Optimizer

Enter a cost table with people as rows and jobs as columns to find the best matching.

Your numbers

Numbers separated by commas or spaces. Rows are people, columns are jobs. Example data.

Separate with commas. Example data.

Result

Lowest total

140

4 assignments, one per row and one per column.

Lowest total
140
Assignments
4

Best assignment

RowColumnValue
AnaShip69
BenPack37
CleoPrint11
DevLabel23
Total140
How this was calculated
  1. The table has 4 rows and 4 columns. Each row can be matched to one column and each column to one row.
  2. The Hungarian method subtracts a number from each row and column so that zeros appear where the cheapest matches are, then adjusts until a full set of zero matches exists. It finds the best total without trying every arrangement.
  3. The total is the sum of the chosen cells of your table.
  • If several matchings tie for the best total, the tool shows one of them. Real jobs may also depend on skills, schedules and availability that a cost table does not capture.

Calculated using SumPanda.com · https://sumpanda.com/assignment-optimizer/

Results are estimates for general information. Verify important figures before relying on them.

Next step

How to use the assignment optimizer

  1. Choose whether you want the lowest or the highest total.
  2. Paste a table of numbers, one row per line, with one row per person and one column per job. The example shows a 4 by 4 table of costs.
  3. Optionally type row names and column names, separated by commas.
  4. Read the matching, the value of each pair and the total. If the table is not square, some rows or columns are left without a match, and the page lists them.

Formula

choose one cell in each row and each column to minimize the total of the chosen cells

subtract the smallest value from each row, then from each column, to create zeros

cover all zeros with the fewest lines; if that takes fewer lines than rows, adjust and repeat

when n lines are needed, a full set of zero cells gives the best matching

This is the Hungarian method. It finds the best matching in a number of steps that grows with the cube of the table size, instead of trying every one of n! arrangements. To maximize, the values are negated first.

Four people and four jobs

With the costs 82, 83, 69, 92 / 77, 37, 49, 92 / 11, 69, 5, 86 / 8, 9, 98, 23, the lowest total is 140: Ana does Ship at 69, Ben does Pack at 37, Cleo does Print at 11 and Dev does Label at 23. All 24 possible arrangements give a total of 140 or more.

Asking for the highest total instead gives 344, by matching Ana with Pack (83), Ben with Print (77), Cleo with Label (86) and Dev with Ship (98). A table with 2 rows and 3 columns, 4 1 3 / 2 0 5, gives a lowest total of 3 and leaves the third column unmatched.

What the numbers can mean

The values can be costs, times, distances or scores. Use the lowest total for costs and times, and the highest total for scores and profits. Each row can be matched to only one column and each column to only one row, so the model does not suit cases where one person can take several jobs.

When several matchings tie, the tool shows one of them. A table does not capture skills, schedules or preferences beyond the numbers, so treat the answer as a starting point. For other planning problems, try the Linear Programming Solver or the Decision Matrix Calculator.

Tables that are not square

With more rows than columns, the extra rows are left unmatched, and with more columns than rows, the extra columns are. The tool picks the matching that gives the best total for the pairs it makes. To force every row to be matched, add dummy columns with a high cost or a low score.

More planning and optimization tools

For related planning and optimization problems, try the Shortest Route Calculator, Linear Programming Solver and NPK Blend Calculator.

Assumptions and limits

  • Each row is matched to at most one column and each column to at most one row.
  • All entries are numbers below 1,000,000,000 in size, and negative numbers are allowed.
  • Up to 30 rows and 30 columns can be entered.
  • Example data are shown until you replace them.

Formulas reviewed October 10, 2026. See the calculation methodology for how SumPanda rounds, tests and sources its formulas.

Frequently asked questions

What is the assignment problem?

It is matching rows to columns, such as workers to jobs, one each, so that the total cost is lowest or the total score is highest.

What is the Hungarian algorithm?

It is a method that finds the best matching by adjusting row and column values until zeros show where the best pairs are. It avoids trying every arrangement.

Can I maximize instead of minimize?

Yes. Choose the highest total and the tool negates the table, finds the lowest total of that, and converts the answer back.

What happens if the table is not square?

The tool matches as many rows and columns as it can, which is the smaller of the two counts, and lists the rows or columns left over.