Skip to main content

Assignment Problems

Learn Assignment Problems (Dynamic Programming, Advanced DSA) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Assigning N Workers to N Tasks, Minimizing Total Cost Each worker has a different cost for each task; assign each worker to exactly one task (and vice versa) to minimize total cost. Same bitmask DP shape as TSP: state = (worker index, mask of tasks already assigned) - since workers are processed in a fixed order, only the current worker index and which tasks remain matter.

More lessons in Dynamic Programming