Consider the following Job Completion problem: Given n workers and m jobs, such that each worker has a list of jobs that he can do. Decide if there is an assignment such that every job gets assigned to a worker who can do the job, assuming that each worker is given at most one job. Design an efficient algorithm for the problem. Analyze your algorithm.
start
Number of available job=n,
Number of available worker = m
Is it doaable?
if yes
then assign
else repeat step 3 and move next.
end.
So, from the above algorithm, we can say that each worker will be able to see the number of available jobs, if worker are able to do the job then it will be able to assign if not, then check the next available job and repeat the steps.
Comments
Leave a comment