Given a matrix where row i corresponds to person i, and column j corresponds to task j and cell (i,j) corresponds to the time taken for person i to complete task j. Output an assignment array for the minimal time taken for all tasks.
For example, if presented with the following matrix:
x = [1,3,4,7;
2,3,1,3;
4,2,3,7;
6,4,2,2;]Your output array would be:
a = [1,3,2,4].
Where person one is assigned to task one, person three is assigned to task two , person two is assigned to task three and person four is assigned to task four.
This gives us a total time of 1+1+2+2=6 which is minimal.
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers59
Suggested Problems
-
Remove the small words from a list of words.
1566 Solvers
-
Find the largest value in the 3D matrix
1693 Solvers
-
Rotate input square matrix 90 degrees CCW without rot90
699 Solvers
-
222 Solvers
-
Find the sides of an isosceles triangle when given its area and height from its base to apex
2246 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
In test #1 answer could be [1 4 2 3], couldn't it? It gives tt = 10, same as proposed [1 2 4 3].
You're correct, Jan. Both options give you a minimum time of 10.
Additional test cases have been added.
I think that ones(4) in Test #3 should be eye(4), instead. Also, #1 has to be fixed as Jan pointed out.
The corrections mentioned by Yuichi (and Jan) have been made.
Good problem.
How to proceed with larger matrix (where permutations are too expensive) ?