# Assignment Problem Solver (Hungarian Algorithm)

Textbook Hungarian algorithm for 2–8 × 2–8 assignment problems: row/column reductions, augmenting-path zero matching, König line covers, and substitution-verified optimal assignments.

> Canonical page: https://elysiatools.com/en/tools/assignment-problem-solver

- **Category:** Math & Numbers

- **Keywords:** assignment problem, hungarian algorithm, kuhn-munkres, optimal assignment, cost matrix, matching, operations research, job assignment, worker task, combinatorial optimization

## Overview

Solve linear assignment problems using the textbook Hungarian algorithm (Kuhn-Munkres method). Input a 2×2 to 8×8 cost or benefit matrix to calculate the optimal one-to-one assignment that minimizes total expenses or maximizes total yield, complete with row and column reduction steps, König line covers, and substitution-verified totals.

## Inputs

- **Cost matrix (one row per line)** (textarea): Cost (or benefit) matrix, one row per worker, one column per task. 2–8 rows × 2–8 columns; rectangular matrices are padded with zero-cost dummies.
- **Goal** (select)
- **Decimal Places** (number)

## When to use

- Assigning staff, contractors, or machines to distinct tasks to minimize overall operational expenses or completion times.
- Allocating leads, territories, or projects among team members to maximize total projected revenue or score.
- Verifying Operations Research coursework and homework problems requiring step-by-step Hungarian algorithm reductions and line covers.

## How it works

- Enter your 2–8 × 2–8 matrix into the text area with one row per line, separating cell values with commas or spaces.
- Select your optimization goal: minimize total cost or maximize total benefit, and configure decimal places if using fractions.
- The solver executes row and column reductions, applies augmenting paths to match zeros, performs König minimum line covers if needed, and outputs the optimal matching pairs and total cost.

## Use cases

- Resource-to-job allocation: Pairing field engineers with service tickets based on travel time and skill-specific labor costs.
- Factory line scheduling: Matching industrial machines to specialized manufacturing runs based on changeover and tooling expenses.
- Fleet dispatching: Assigning delivery vehicles to regional routes to achieve minimum aggregate fuel consumption and transit time.

## Frequently asked questions

### Can this tool solve rectangular (unbalanced) assignment problems?

Yes, rectangular matrices with unequal rows and columns are automatically padded with zero-cost dummy entries to create a balanced square matrix.

### How does the solver handle benefit maximization?

For maximization, the solver internally negates the matrix values, applies the standard Hungarian minimization steps, and converts the resulting assignment back to original total benefit.

### What is the matrix size limit?

The solver accommodates matrix dimensions between 2×2 and 8×8.

### Can I input decimal numbers in the matrix?

Yes, standard integer and decimal values are supported, with precision configurable up to 8 decimal places.

### What does the step-by-step breakdown include?

The output details row and column reduction minima, zero-matching rounds, minimum line cover adjustments when matching is incomplete, and the final paired assignment.

## Related tools

- [Graph Shortest Path (Dijkstra Step-By-Step)](https://elysiatools.com/en/tools/graph-shortest-path): Dijkstra with a full per-iteration trace: settled nodes, relaxations, distance table, and the final path; undirected or directed, negative weights rejected, unreachable targets reported.
- [Upside-Down Text](https://elysiatools.com/en/tools/upside-down-text): Flip text upside-down (ɥǝllo) with per-letter rotations, plus optional toggles to keep reading order and protect URLs/emails. Plain Unicode text, no font needed.
- [Podcast Chapter Marker Builder](https://elysiatools.com/en/tools/podcast-chapter-marker-builder): Build every podcast chapter format from one timecoded list: Podcasting 2.0 JSON + RSS tag, ID3v2.4 CHAP+CTOC burned into an MP3, Vorbis comments, mp4chaps, YouTube timestamps and SRT, with a per-player support matrix.
- [STEM Physics — Kinematics Velocity-Time Graph Tutor](https://elysiatools.com/en/tools/education-stem-physics-kinematics-velocity-time-graph): Kinematics visualisation tutor: velocity-time curve (constant-acceleration SUVAT solver with displacement-area shading), projectile parabola (adjustable g + air-resistance toggle), and free-fall timing
- [Indented List to ASCII Tree](https://elysiatools.com/en/tools/ascii-tree-from-indented-list): Convert a 2-space / 4-space / Tab indented hierarchical list (Markdown bullets, -, *, 1. prefixes optional) into a copyable ASCII directory tree. Two styles: Unicode box-drawing (├──└──│) for GitHub/Discord and classic ASCII (|--\--|) for plain text. Toggles for full guide lines, trailing spaces, and bracketed leaf nodes like docs/\[api.md\].
- [Day of Week Calculator](https://elysiatools.com/en/tools/day-of-week-calculator): Calculate what day of the week a given date falls on
- [Audio to Text Transcriber (AI)](https://elysiatools.com/en/tools/audio-to-text-transcriber): Transcribe speech from audio (wav/mp3/m4a/flac/ogg/webm/aac) to text, SRT, VTT or JSON using the grok-stt AI model. Up to 10 minutes.
- [FFmpeg Audio Noise Reduction](https://elysiatools.com/en/tools/ffmpeg-audio-noise-reduction): Professional audio noise reduction using FFmpeg advanced filters (highpass, afftdn, loudnorm) for optimal audio cleaning

## Samples

- [ELK Stack Log Analysis Samples](https://elysiatools.com/en/samples/elk-stack-samples): Comprehensive ELK Stack (Elasticsearch, Logstash, Kibana) samples for log aggregation, processing, and visualization in distributed systems
- [Copyright-Free MP3 Audio Samples](https://elysiatools.com/en/samples/mp3-samples): Collection of royalty-free audio samples for testing and development purposes including nature sounds, meditation music, and ambient audio
- [Regex Named Capture Groups](https://elysiatools.com/en/samples/regex-named-groups): Collection of regex patterns using named capture groups for extracting structured data from text. Named groups make patterns more readable and maintainable by assigning meaningful names to captured portions.
- [Environment Variables (.env) Samples](https://elysiatools.com/en/samples/env-samples): Environment variables configuration examples for different application types and environments
