Assume there are N people and M tasks are there and there is a cost matrix which tells when a task is assigned to a person how much it cost.
Assume we can assign more than one task to a person.
It means we can assign all of the tasks to a person if it leads to minimum cost. I know this problem can be solved using various techniques. Some of them are below.
- Bit Masking
- Hungarian Algorithm
- Min Cost Max Flow
- Brute Force( All permutations M!)
Question: But what if we put a constraint like only consecutive tasks can be assigned to a person.
T1 T2 T3
P1 2 2 2
P2 3 1 4
Answer: 6 rather than 5
Explanation:
We might think that , P1->T1, P2->T2, P1->T3 = 2+1+2 =5 can be answer but it is not because (T1 and T3 are consecutive so can not be assigned to P1)
P1->T1, P1->T2, P1-T3 = 2+2+2 = 6
How to approach solving this problem?