Assigning 2 Tasks to each Agent w/ Hungarian Algorithm?

638 Views Asked by At

Suppose I have 4 agents and 8 tasks and I would like to assign each agent 2 tasks each. Is there a way to use the Hungarian Algorithm to solve this problem?

I worked it out with 2 agents and 4 tasks by hand by creating 2 additional dummy rows. I think I arrived at an optimal solution but I'm not entirely sure. Is it simply as easy as just adding dummy rows and then running the algorithm normally?

If the Hungarian Algorithm does not work, what's another algorithm that can guarantee me an optimal solution where there are n agents and k*n tasks and each agent gets assigned k tasks?

1

There are 1 best solutions below

2
On BEST ANSWER

You can duplicate the agents (split each agent into two). Of course another approach would be to use an LP (Linear Programming) solver. Then you could write more directly:

$$\begin{align} \min & \sum_{i,j} c_{i,j} x_{i,j}\\ & \sum_j x_{i,j} = 2 \> \> \forall i \\ & \sum_i x_{i,j} = 1 \> \> \forall j \\ & 0 \le x_{i,j} \le 1 \end{align} $$

I once did an (unfair) comparison between a simple Hungarian Algorithm and an advanced LP solver.