algorithm - Job assignment with NO cost, would Hungarian method work? -
so have job assignment problem doesn't have traditional cost hungarian method requires.
for example:
i have 3 workers - a, b , c have 5 jobs - 1, 2, 3, 4 , 5 each worker has list of jobs can perform, so:
worker can work on job 1, 2, 5 worker b can work on job 1, 2 worker c can work on job 1 the end result (since there's no cost) maximum number of assignments can achieve. in example, can achieve maximum of 3 assignments:
worker on job 5 worker b on job 2 worker c on job 1 is hungarian method way solve this? should use "dummy" costs? thinking maybe using index of job preference cost; idea?
assign cost -1 job can, , others zero.
then run hungarian algorithm , give answer(it returns -answer,in fact).
don't large numbers, may cause overflow(unless implement hungarian carefully).
indeed, it's maximum matchings in bipartite graphs, , there many ways solve problem, see wiki pages:
http://en.wikipedia.org/wiki/matching_(graph_theory)#maximum_matchings_in_bipartite_graphs
ps:hopcroft–karp algorithm faster hungarian , more simple also. worth try. compulicated method faster these two, it's not recommanded learn these algorithms @ first.
pss: id in stackoverflow method solve problem. it's network flow way. it's called shortest argument path(sap). see:http://coral.ie.lehigh.edu/~ted/files/ie411/lectures/lecture11.pdf
Comments
Post a Comment