in reply to Re: Efficient Assignment of Many People To Many Locations?
in thread Efficient Assignment of Many People To Many Locations?
You have n people and m jobs and each person can do only one job and each job can be done by exactly one person. You can also (intuitively or by some other policy) assign a cost c(i,j) of person j doing job i. Now, we make an integer linear program (ILP) out of this problem formulation.
Let x(i,j) denote the event that person j does job i. x(i,j) is a binary variable - it can either be zero or 1. We have the following constraints for x(i,j):
minimize: sum_{i=1..m} sum_{j=1..n} c(i,j) x(i,j)
What you obtained (a set of variables, a set of constraints applied to the variables and an objective function to minimize) constitutes an integer linear program. So, here is again a perfect chance for me to advertise my module, which I coded and maintain (unfortunately, out of CPAN) to solve ILPs: Math::GLPK . Math::GLPK is an object-oriented Perl wrapper module for the GNU Linear Programming Toolkit (GLPK). Just feed the ILP to Math::GLPK as a matrix (it is pretty easy to do and the documentation is extensive) and leave the job of solving it to GLPK...
Good luck with OR!
Update: correct typos
rg0now
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Efficient Assignment of Many People To Many Locations?
by SmugX (Beadle) on Feb 25, 2005 at 17:09 UTC |