1

Let say below is a table describing the time it takes 5 people to finish 5 jobs.

      Job1    Job2    Job3    Job4    Job5
Bob    1       2       3       4       5
Joe    2       1       3       4       5
Tom    2       3       1       4       5
May    2       3       1       2       5
Sue    2       3       4       5       1

If the company has enough money to hire all 5 people, then I can see that the minimum time to complete everything is

Bob do Job1
Joe do Job2
Tom do Job3
May do Job4
Sue do Job5

1 + 1 + 1 + 2 + 1 = 6 units

I found the fastest way to solve this is to use Hungary Algorthm (Referenced find the minimum sum of matrix (n x n) that select only one in each row and column)

Also, if company can only hire 1 person, May will be hired because everyone took 15 units to finish, where May took only 13 units.

However, if company has enough budget to hire 3 people. What's the fastest algorithm to find out which 3 people I should hire?

In the above Example, should be Bob (or Joe) + May + Sue, their total will be

Either Bob do Job 1
Either Bob do Job 2
May do Job 3
May do Job 4
Sue do Job 5

1 + 2 + 1 + 2 + 1 = 7 units

Community
  • 1
  • 1
SG2010
  • 33
  • 2
  • 6
  • Actually, Bob or Joe, May, Sue will take 7 units. – gnasher729 Apr 15 '15 at 17:52
  • Tricky. Your example is simple, just (5 over 3) = 10 possibilities, easily checked. You may have restrictions how many work units each employee can do. No good if an employee cannot actually do all the work that he or she is very good at. That would make things interesting. – gnasher729 Apr 15 '15 at 17:56
  • Thx gnasher729. Corrected in the question. Right now quickest way I can think of is 5C3 and run Hungary Algorithm on all of the combination. But as I said, it could be NxM Choose K. i.e. 1000x5000 choose 500 rows. The math could be complicated. Just wondering if it can be optimized. – SG2010 Apr 15 '15 at 18:14

0 Answers0