Assignment Method (Hungarian Method)

Assignment Method (Hungarian Method)

The Assignment Method is an Operations Management tool typically used for minimizing the amount of cost, time or effort by assigning tasks to the proper person. It can also be used for maximization problems, but it requires an extra step. The Hungarian Method for solving this type of problem has you set up a problem into a matrix of values that we will work with until we find the optimal solution. This type of optimization has been pretty much made moot by software, but this will still demonstrate the logic behind this process.

In this example, we are going to have 5 team members stating about how much time they would estimate the 4 available projects should take them. Everyone provided a time in hours with a few team members stating that they wouldn't be able to work on a few of the projects. If you are using computations and need a way to represent the "impossible" projects, assign it an obnoxiously high value.

Article content

Step 1. Balancing the matrix

With the Hungarian Method, the first step would be to balance the matrix. The number of rows must equal the number of columns. Since we have 5 team members, we have to have 5 projects. To do this, we will add a Dummy column with all of the values being 0.

Article content

Step 2. Reduce Rows

Find the minimum value in each row and subtract the row by that minimum value. Each row is done separately. In this example, the 0s in the Dummy row are the smallest value, so there will be no change for this step.

Step 3. Reduce Columns

Similar to the previous step, you will need to find the smallest value in each column. Subtract all the values in that column by that smallest value. Those would be the 16 for GraphDB, 18 for Python, 25 for SQL, 14 for Tableau, and 0 for Dummy. When complete, you new matrix should look like the following.

Article content

Step 4. Cover 0s with Fewest Lines

You will be complete modifying the matrix when you are able to cover all the 0s with the fewest number of lines and that number is equal to the number of rows you have. The best way to do that is to find the rows or columns with the most exposed 0s and put a line there. If the lines match the number of rows, then skip to Step 6.

In this example, the Dummy column has 5 exposed 0s. Then Danielle has 2 exposed 0s to cover. Then that leaves the Amy row and the SQL column both with single 0s to cover. If you have only a single 0, it does not matter if you cover the row or column. It is your choice.

Article content

Step 5. Adjust the Matrix

In this step, you will search for the smallest number that is currently uncovered in the matrix. Then, you will subtract that value from all of the uncovered values and add it to values that have an intersection of the lines. For the values that are covered by a line, but not at an intersection, you will leave those alone. Once this is complete, you will jump back to Step 4.

For this example, 2 is the smallest one. The modified matrix will now appear as below.

Article content

These steps are repeated iterations since the first pass did not provide the condition we were looking for.

Article content

Now we are back at Step 4 to find the fewest lines. We see that the Dummy column has 3 exposed 0s, so that will be the first line. Danielle has 2 exposed 0s, then Python has 2 exposed 0s, leaving Brian and Edward with a single exposed 0 to cover. That gives us 5 lines which matches the 5 columns. We can now proceed to Step 6.

Article content

Step 6. Find unique 0s

Look at the matrix again without any lines on it. You will want to find the unique zeros. The easiest way is to find a row or column with a single 0 in it. Then, mark out all of the other values in that row and column associated with that 0.

For this example, we start with a clean matrix. We see that Amy has a single 0 in her row. So we lock that task down to her.

Article content
Article content

You now can see that Charles has a single 0 in the Dummy column. that task will be locked to him.

Article content

Brian now has a single 0 in his row in the GraphDB project since the other 0 in the Dummy column was eliminated.

Article content

The next single 0 you will run across will be Danielle for Tableau.

Article content

And that leaves Edward with the SQL project.

Article content

You are now complete.

If you want to see the total time your team will need to complete the projects, just overlay the results over the original matrix.

For this example, we will see that Charles should sit out this round of projects and the other 4 people will need about 75 man-hours to complete everything.

Article content


Note: It is possible for some problems to have multiple solutions. This will only provide one of the results, but the effective "cost" will still be the same.


what if I have that number of coverlines that equal the number of raws and the fewest lines but it covers all cells and still can not assign ,can I ingore that rule to be able to adjst the matrix and choose any other number of lines more than equal ?

Like
Reply

so what can I do if I have 3 persons and 5 projects and I need to Assign3 projects for only one of them,while the other two person only one for each ?How many colmns and raws do I need to make it balced and solve it

Like
Reply

To view or add a comment, sign in

More articles by John Pates

  • Playing with ChatGPT

    Over the past couple months, I have been using ChatGPT to provide me with insight on how to do things. One of which is…

  • Visualization Considerations for Accessibility

    Today at work, there was someone complaining about a chart we receive from outside our company. The chart in question…

  • Graph Databases for Personal Education (World of Warcraft)

    I was working on something with both learning GraphDB and thought I could apply it to a problem in World of Warcraft…

  • Wrapping up the first step of my Machine Learning journey

    I can't believe I have finally finished this step of my Machine Learning journey. A couple months ago, I had a notice…

  • Continuing My Machine Learning Journey

    I am continuing this class in Machine Learning(ML). It is a topic I have found really interesting, but it is hard to…

  • GraphDB day 2

    I've been continuing playing around with GraphDB using Neo4j. It is going slower as if I make a mistake, it takes me a…

  • Adventures with GraphDB day 1

    As part of my desire to keep learning, despite not having a work "use case" to try to learn GraphDB, I am actually…

    1 Comment
  • Playing with Python and Tableau

    For my personal education, I was playing around with Python. My long term goal is to create a way to have Python scrub…

  • SQL Fundamentals - Caution When Using Division

    This is not only a SQL item, but also applies to quite a few programming languages too. When using division, you have…

  • Excel - Drag Filling

    Sometimes, the little tricks of Excel get overlooked, especially if you use it a lot. But not everyone has seen these…

Others also viewed

Explore content categories