4 Assignment Problems

Operations Research ยท Unit 4

Assignment Problems

Exam-focused notes for Assignment Problems (Operations Research, ORS255): what the TU syllabus asks and how it has actually been tested, with 7 solved past questions from this unit.

Assignment Problems in short

An assignment problem matches workers to jobs, one job per worker. The aim is the lowest total cost or the highest total profit. Examples are giving jobs to machines, drivers to routes, or staff to desks.

Assignment Problems: notes

Formulation of assignment problems

Suppose there are $n$ workers and $n$ jobs, and $c_{ij}$ is the cost when worker $i$ does job $j$. Let $x_{ij} = 1$ if worker $i$ gets job $j$ and $x_{ij} = 0$ otherwise.

$$\begin{aligned} \text{Minimize } Z &= \sum_{i=1}^{n} \sum_{j=1}^{n} c_{ij}x_{ij} \ \text{subject to } \sum_j x_{ij} &= 1 \quad \text{for every worker } i \ \sum_i x_{ij} &= 1 \quad \text{for every job } j \end{aligned}$$

The assignment problem is a special case of the transportation problem. Every supply and every demand is 1. Trying all assignments is not practical, because $n$ workers and $n$ jobs give $n!$ possible plans. For 10 workers that is over 3.6 million.

One-to-one assignment constraints

The two sets of equations above force a one-to-one match. Each worker does exactly one job and each job goes to exactly one worker. A solution is a set of $n$ cells with one cell in every row and every column.

If the number of workers and jobs differs, the problem is unbalanced. Add dummy jobs or dummy workers with cost 0 to make the table square. A worker given a dummy job simply stays unassigned.

Some pairs may be forbidden, for example a machine that cannot do a job. Give that cell a very large cost so it is never chosen.

What this unit covers

  • Formulation of assignment problems
  • Hungarian Assignment Method (HAM)
  • One-to-one assignment constraints
  • Minimization and maximization in assignments
  • Optimal solution finding

Hungarian Assignment Method

2082 ยท 5 marks

Assignment Problem: Least Cost Allocation

A publication employs typists on an hourly basis. There are five typists for service and their charges are different. According to earlier understanding, only one job is given to one typist. Find the least cost allocation for the following data.

$$\begin{array}{|c|ccccc|}\hline \text{Typists/Jobs} & P & Q & R & S & T \ \hline A & 85 & 75 & 65 & 125 & 75 \ \hline B & 90 & 78 & 66 & 132 & 78 \ \hline C & 75 & 66 & 57 & 114 & 69 \ \hline D & 80 & 72 & 60 & 120 & 72 \ \hline E & 76 & 64 & 56 & 112 & 68 \ \hline \end{array}$$

[5]

Show solved answer

Assignment Problem: Least Cost Allocation

Given Data

Cost matrix (typists A-E vs jobs P-T):

TypistsPQRST
A85756512575
B90786613278
C75665711469
D80726012072
E76645611268

Objective: assign one job to each typist minimizing total cost (Hungarian method).

Step 1: Row Reduction

Row minimums: A=65, B=66, C=57, D=60, E=56.

TypistsPQRST
A201006010
B241206612
C18905712
D201206012
E20805612

Step 2: Column Reduction

Column minimums: P=18, Q=8, R=0, S=56, T=10.

TypistsPQRST
A22040
B640102
C01012
D24042
E20002

Step 3: Cover Zeros with Minimum Lines

Zeros are at: A(R,T), B(R), C(P,R), D(R), E(Q,R,S).

Minimum lines to cover all zeros:

  • Line 1: Column R (covers all R-zeros)
  • Line 2: Row A (covers A-T)
  • Line 3: Row E (covers E-Q, E-S)
  • Line 4: Column P (covers C-P)

That is 4 lines < 5 (order n). Not optimal yet.

Step 4: Create Additional Zeros

Uncovered elements (not in row A, E; not in column P, R):

Uncovered cells: B(Q,S,T), C(Q,S,T), D(Q,S,T).

Values:

  • B: Q=4, S=10, T=2
  • C: Q=1, S=1, T=2
  • D: Q=4, S=4, T=2

Minimum uncovered value = 1 (at C-Q or C-S).

Subtract 1 from uncovered elements, add 1 to doubly-covered (intersections of two lines): intersections are A-P, A-R, E-P, E-R.

Revised matrix:

TypistsPQRST
A32140
B63091
C00001
D23031
E30102

Step 5: Check Optimality

Zeros: A(T), B(R), C(P,Q,R,S), D(R), E(Q,S).

Try covering: still need to check line count.

  • Column R covers B, C, D, (A/E have no R-zero after change).
  • Row C covers C(P,Q,S).
  • Row E covers E(Q,S).
  • Row A covers A-T.

Lines: Column R, Row C, Row E, Row A = 4 lines. Still < 5.

Uncovered cells (not row A,C,E; not column R): B(P,Q,S,T), D(P,Q,S,T).

Values:

  • B: P=6, Q=3, S=9, T=1
  • D: P=2, Q=3, S=3, T=1

Minimum uncovered = 1 (B-T, D-T). Subtract 1 from uncovered, add 1 to intersections (A-R, C-R, E-R).

Revised matrix:

TypistsPQRST
A32240
B52080
C00101
D12020
E30202

Step 6: Assignment

Zeros: A(T), B(R,T), C(P,Q,S), D(R,T), E(Q,S).

Make assignments:

  • A โ†’ T (only zero for A) โ†’ T taken.
  • B โ†’ R (T gone) โ†’ R taken.
  • D โ†’ R gone, D โ†’ T gone; D has no zero left. Backtrack.

Retry:

  • B โ†’ T, A โ†’ ? A only zero is T (taken). Conflict.

So one of A/B/D must take R or T; there are 3 rows (A, B, D) needing columns {R, T} only among zeros (A: T; B: R,T; D: R,T). Three rows demand two columns โ†’ infeasible; need another zero.

Only 4 lines cover current zeros; count lines again:

  • Row A (T), Row E (Q,S), Column R (B,D), Column S/Q via C...

Cover: Column T (A,B,D), Column R (B,D), Row C (P,Q,S), Row E (Q,S) = 4 lines. Still 4 < 5.

Uncovered: not row C,E; not column R,T โ†’ A(P,Q,S), B(P,Q,S), D(P,Q,S). Values: A: 3,2,4; B: 5,2,8; D: 1,2,2. Minimum = 1 (D-P).

Subtract 1 from uncovered, add 1 to intersections (C-R, C-T, E-R, E-T):

Revised matrix:

TypistsPQRST
A21230
B41070
C00202
D01010
E30303

Zeros: A(T), B(R,T), C(P,Q,S), D(P,R,T), E(Q,S).

Assignment:

  • A โ†’ T
  • B โ†’ R
  • D โ†’ P
  • E โ†’ Q
  • C โ†’ S

All jobs distinct. Optimal.

Optimal Solution

AssignmentOriginal Cost
A โ†’ T75
B โ†’ R66
C โ†’ S114
D โ†’ P80
E โ†’ Q64

Minimum Total Cost = 75 + 66 + 114 + 80 + 64 = 399

Open this answer on its own page โ†’

2081 ยท 5 marks

Assignment Problem - Hungarian Method

A software company wants to assign its technical support agents to different regions to maximize customer satisfaction. The company has four agents, each with varying effectiveness in different regions. The table below shows the expected satisfaction score if each agent is assigned to a specific region. Use the Hungarian method to assign each technical support agent to a region in a way that maximizes overall customer satisfaction.

$$\begin{array}{|c|cccc|}\hline \text{Regions/Agents} & \text{Sandip} & \text{Sanjay} & \text{Shankar} & \text{Subhash} \ \hline \text{Kathmandu} & 140 & 146 & 148 & 136 \ \hline \text{Biratnagar} & 148 & 132 & 136 & 129 \ \hline \text{Janakpur} & 149 & 135 & 141 & 138 \ \hline \text{Butwal} & 130 & 146 & 149 & 144 \ \hline \end{array}$$

[5]

Satisfaction score matrix (rows = regions, columns = agents): Region\Agent Sandip Sanjay Shankar Subhash --------------- Kathmandu 140 146 148 136 Biratnagar 148 132 136 129 Janakpur 149 135 141 138 Butwal 130 146 149 144 Objective: Maximize total satisfaction. Maximum element = 149. Subtract eac...

Open this answer on its own page โ†’

2080 ยท 5 marks

The ABC Company Job Assignment Problem

The ABC company has three jobs to be done on three machines. Each job must be done on one and only one machine. The cost of each job on each machine is given in the following table. By using Hungarian method, find the job assignments which will minimize the machine cost.

$$\begin{array}{|c|c|c|c|}\hline \text{Jobs\backslash Machine} & X & Y & Z \ \hline A & 4 & 6 & 8 \ B & 2 & 3 & 4 \ C & 4 & 8 & 5 \ \hline \end{array}$$

[5]

Cost matrix (Jobs A, B, C on Machines X, Y, Z): $$\begin{array}{cccc}\hline \text{Job/Machine} & X & Y & Z \ \hline A & 4 & 6 & 8 \ B & 2 & 3 & 4 \ C & 4 & 8 & 5 \ \hline \end{array}$$ Objective: minimize total assignment cost, each job to exactly one machine. Row minimums: A = 4, B = 2, C = ...

Open this answer on its own page โ†’

2079 ยท 10 marks

Assignment Problem - Hungarian Method

Kathmandu Metropolitan is putting up bids for four used motorbikes company. The Metropolitan allows individuals to make bids on all four motorbikes company but will accept only one bid per individual. Four individuals have made the following bids (in thousands Rs.). Make the use of Hungarian method to assign the individuals to different motorbike company in order to maximize the revenue.

$$\begin{array}{|c|c|c|c|c|}\hline \text{Individuals} & \text{Honda} & \text{Hero} & \text{Bajaj} & \text{Yamaha} \ \hline A & 100 & 90 & 110 & 90 \ B & 110 & 100 & 95 & 95 \ C & 105 & 95 & 90 & 105 \ D & 115 & 100 & 95 & 100 \ \hline \end{array}$$

[10]

Show solved answer

Hungarian Method - Assignment Problem (Maximization)

Given

Profit matrix (bids in thousands Rs.), one bid accepted per individual:

IndividualHondaHeroBajajYamaha
A1009011090
B1101009595
C1059590105
D11510095100

Objective: maximize total revenue via one-to-one assignment.


Solution

Convert Maximization to Minimization

Maximum element = 115. Subtract each element from 115 to get the cost matrix.

HondaHeroBajajYamaha
A1525525
B5152020
C10202510
D0152015

Row Reduction

Row minimums: A = 5, B = 5, C = 10, D = 0.

HondaHeroBajajYamaha
A1020020
B0101515
C010150
D0152015

Column Reduction

Column minimums: Honda = 0, Hero = 10, Bajaj = 0, Yamaha = 0.

HondaHeroBajajYamaha
A1010020
B001515
C00150
D052015

Cover Zeros with Minimum Lines

Zeros locations:

  • A: Bajaj
  • B: Honda, Hero
  • C: Honda, Hero, Yamaha
  • D: Honda

Minimum lines to cover all zeros:

  • Line 1: Column Honda (covers B, C, D zeros in Honda)
  • Line 2: Column Bajaj (covers A)
  • Line 3: Row C (covers Hero, Yamaha zeros of C)
  • Line 4: Row B (covers Hero zero of B)

That is 4 lines. Since number of lines (4) = order of matrix (4), an optimal assignment exists.

Make Optimal Assignment

Assign row by row using unique zeros:

  • Row A: only zero at Bajaj โ†’ A โ†’ Bajaj. Strike column Bajaj.
  • Row D: only zero at Honda โ†’ D โ†’ Honda. Strike column Honda.
  • Row B: zeros at Honda (gone), Hero. โ†’ B โ†’ Hero. Strike column Hero.
  • Row C: zeros at Honda (gone), Hero (gone), Yamaha. โ†’ C โ†’ Yamaha.

Assignment:

  • A โ†’ Bajaj
  • B โ†’ Hero
  • C โ†’ Yamaha
  • D โ†’ Honda

Compute Maximum Revenue

Using original bids:

  • A โ†’ Bajaj = 110
  • B โ†’ Hero = 100
  • C โ†’ Yamaha = 105
  • D โ†’ Honda = 115

$$\text{Total} = 110 + 100 + 105 + 115 = 430$$

Maximum Revenue = Rs. 430,000 (Rs. 430 thousand).


Final Answer

IndividualCompanyBid (Rs. thousands)
ABajaj110
BHero100
CYamaha105
DHonda115

Maximum Revenue = Rs. 430,000

Open this answer on its own page โ†’

2080.2 ยท 5 marks

Describe Hungarian Assignment Method (HAM) used for finding the optimal solution of assignment problem. [5]

The Hungarian Assignment Method is an algorithm used to solve the assignment problem optimally, where the objective is to assign n jobs to n workers (or resources to tasks) such that the total cost is minimized (or profit maximized) with each job assigned to exactly one worker and each worker ass...

Open this answer on its own page โ†’

0 ยท 5 marks

Assignment Problem - Hungarian Method

A marketing manager has four salesmen and four sales districts. Considering the capabilities of the salesmen and nature of districts, the marketing manager estimates that sales per month in hundreds of rupees for each salesman in each district would be as follows:

$$\begin{array}{|c|c|c|c|c|}\hline \text{Sales} & A & B & C & D \ \hline P & 32 & 38 & 40 & 28 \ Q & 40 & 24 & 28 & 21 \ R & 41 & 27 & 33 & 30 \ S & 22 & 38 & 41 & 36 \ \hline \end{array}$$

Make the use of Hungarian method to assign the salesmen in different districts in such a way that total sales would be maximized. [5]

Sales matrix (hundreds of rupees), salesmen P, Q, R, S vs districts A, B, C, D: Sales A B C D ------------------- P 32 38 40 28 Q 40 24 28 21 R 41 27 33 30 S 22 38 41 36 Objective: Maximize total sales. Subtract every element from the maximum value $41$ (regret/opportunity-loss matrix): A B C D -...

Open this answer on its own page โ†’

Formulation of assignment problems

2080.2 ยท 5 marks

There are three jobs P, Q and R to be completed on four machines A, B, C and D. The costs of performing the different jobs on machines are given below. Assign the jobs to different machines to minimize the total cost of performing the jobs on machines.

$$\begin{array}{|c|c|c|c|c|}\hline \text{Jobs/Machines} & A & B & C & D \ \hline P & 90 & 120 & 140 & 160 \ Q & 40 & 65 & 85 & 95 \ R & 50 & 75 & 95 & 110 \ \hline \end{array}$$

[5]

Cost matrix (3 jobs ร— 4 machines): Jobs/Machines A B C D --------------- P 90 120 140 160 Q 40 65 85 95 R 50 75 95 110 - 3 jobs (P, Q, R), 4 machines (A, B, C, D) - Objective: minimize total cost. More machines than jobs, so add a dummy job S with all zero costs: A B C D --------------- P 90 120 ...

Open this answer on its own page โ†’