Answered step by step
Verified Expert Solution
Question
1 Approved Answer
3. (15, Flows) Suppose you have m hospitals numbered 1,2,,m that are looking for doctors. Some hospitals may be looking for many doctors. You are
3. (15, Flows) Suppose you have m hospitals numbered 1,2,,m that are looking for doctors. Some hospitals may be looking for many doctors. You are given an array H of length m, where for every i,H[i] indicates the number of doctors hospital i wants to recruit. Note that this implies that all entries of this array are at least 1, as every hospital is looking for at least 1 doctor. There are also n students fresh out of Med School in the job market. However, these students are selective, and each student has a list of hospitals where this student is willing to go to. Formally, for each i in {1,,n}, you are given a list Li{1,,m}, which is the list of hospitals student i is willing to go to. Your job is to decide if things can be arranged so that every student gets a job at a hospital that they are willing to go to, and no hospital gets more students than it needs. There may be hospitals that don't fill all their openings, but that is okay. Give a polynomial time algorithm that decides if such an arrangement is possible. You can use any algorithm we developed in class as a black-box
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started