My problem is very similar to the Assignment problem (http://en.wikipedia.org/wiki/Assignment_problem), with three exceptions:
The real world story behind this is a fire department running on volunteers. Throughout the day volunteers can say they are available or not and we have to re-evaluate if every task is sufficiently filled. If not someone needs to be notified that there is a problem. We already want to notify if we only have the minimum amount. Generally, a small fire department usually needs to have a leader, a driver, and 4 regular firemen available at all times.
Translating this to the assignment problem, we say that the leader, driver, fireman are tasks and every fireman is an agent. What we want to do is find out if there is a problem (i.e. we don't have 2 possible leaders, 2 possible drivers, and 5 regular firemen), how big the problem is (i.e. we have the minimum amount, or we are in trouble) and where the problem is (i.e. we need another fireman or we need another leader, where needing another leader is more important than needing another fireman).
So what we want to do is given a set of tasks and a set of agents that each can perform a variable set of tasks, divide the agents so that every task is fulfilled OR the most important tasks are fulfilled.
Where the algorithms that solve the assignment problem that I've checked out end up going wrong is in the situation where you don't have enough people to fulfill all tasks. They then seem to get assigned to the lower priority tasks, where it would have been 'better' to have them on higher priority task.
Does this sound familiar to anyone? Is there maybe a name for this problem that I have missed in all the different variations I've looked at? Or does someone maybe have a brilliant idea on how to solve this efficiently?
You can basically use a greedy algorithm that schedules the highest priority tasks first. I would do something like:
So for a specific example, suppose you have 5 agents as follows:
A - leader, fireman
B - leader, driver
C - driver, fireman
D - fireman
E - fireman
Your highest priority task is leader, so select agents A and B. A can also do "fireman" which is duplicated by 3 others, and B can also do "driver" which is duplicated by 1 other. So the agent with the most duplicated tasks is A, and A gets assigned to leader.
Next highest task is driver. B can only do "driver" because leader has already been assigned, so B gets driver.
Etc.
This is a bit brute force and I'm sure there are edge cases it doesn't catch, but at least it's an approach that is usable...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With