Network Flow - Bipartite Matching

In summary, the problem at hand involves a medical consulting firm, Doctors Without Weekends, seeking help with hospital scheduling issues. The firm has determined the number of doctors needed for each of the next n days, and each doctor has provided a list of days they are willing to work. The goal is to create a system that assigns doctors to days in a way that satisfies two properties - (A) each doctor only works on days they find acceptable, and (B) the total number of doctors present on each day is equal to the predetermined value. A polynomial-time algorithm is needed to implement this system.If the doctors' lists are too restrictive and a schedule cannot be found, the firm relaxes the requirements by adding a new parameter c and
  • #1
nrobidoux
25
0

Homework Statement


You've periodically helped the medical consulting firm Doctors Without Weekends on various hospital scheduling issues, and they've just come to you with a new problem. For each of the next n days, the hospital has determined the number of doctors they want on hand; thus, on day i, they have a requirement that exactly p_i doctors be present.

There are k doctors, and each is asked to provide a list of days on which he or she is willing to work. Thus doctor j provides a set L_j of days on which he or she is willing to work.

The system produced by the consulting firm should take these lists and try to return to each doctor j a list L_j' with the following properties:

(A) L_j' is a subset of L_j , so that doctor j only works on days he or she finds acceptable.

(B) If we consider the whole set of lists L_1' ... L_k', it causes exactly p_i doctors to be present on day i, for i = 1, 2 ...n. (a) Describe a polynomial-time algorithm that implements this system.

Specifically, give a polynomial-time algorithm that takes the numbers p_1, ... p_n, and the lists L_1 ... L_k, and does one of the following two things.

  • Return lists L_1' ... L_k', satisfying properties (A) and (B); or
  • Report (correctly) that there is no set of lists L_1' ... L_k' that satisfies both properties (A) and (B).
(b) The hospital finds that the doctors tend to submit lists that are much too restrictive, and so it often happens that the system reports (correctly, but unfortunately) that no acceptable set of lists L_1' ... L_k' exists.

Thus the hospital relaxes the requirements as follows. They add a new parameter c > 0, and the system now should try to return to each doctor j a list L_j' with the following properties.

(A*) L_j' contains at most c days that do not appear on the list L_j.

(B) (Same as before) If we consider the whole set of lists L_1' ... L_k', it causes exactly p_idoctors to be present on day i, for i = 1, 2 ... n.

Describe a polynomial-time algorithm that implements this revised system. It should take the numbers p_1 ... p_n the lists L_1 ... L_k, and the parameter c > 0, and do one of the following two things.

  • Return lists L_1' ... L_k' satisfying properties (A*) and (B); or
  • Report (correctly) that there is no set of lists L_1' ... L_k' satisfies both properties (A*) and (B).

The Attempt at a Solution


Thank you for any guidance. This is an online class and unfortunately by the time I begin this there is little opportunity for teacher/student interaction... and I only post after looking on Google.

I appears to be a pretty straight forward bipartite matching network flow problem. My issue really arises from in either case that a schedule cannot be found.

To setup the graph place an edge from the source to each doctor with a flow [capacity] of 0[n]. This indicates that each doctor can participate in the Doctors W/O Weekends Program up to all the n days scheduling is needed for.

Adjacent to this setup will be all days in another column connected to the sink, with flow [capacity] of 0 [p_i].

The edges from doctors to days are spelled out in the respective set of available days submitted by each doctor (L_j). All are set to 0 [1].

Once max flow / Ford-Fulkerson (or whatever name the algorithm goes by) is run we will have a potential schedule.

Difficulty

For me it seems that the optimal schedule can be achieved... sometimes. Just not all the time, for both cases. I'm struggling to determine how neither case is correct... to say there is "no set of lists"...

The mathematical definition of a subset seems to indicate any set where all elements are contained within another set is a subset. It did not say the size had to be smaller (i.e. set A == B).

The only thing I can see is that the problem does not state p_i <= k is a requirement.

If p_i > k on any link to the sink then a schedule can never be found.

Is there something else I'm missing? I mean c can be set to n... at that point the only reason a schedule can't be found is because p_i > k. ... ... ... Right?
 
  • #3
Thanks Greg. Apparently the problem was the wording in the original problem. I received full credit for my answer... well almost. Apparently I needed some widget nodes in my graph and not handle c with any other code besides max-flow used on that graph.
 

1. What is Network Flow - Bipartite Matching?

Network Flow - Bipartite Matching is a graph matching algorithm used to solve optimization problems in which two sets of vertices are connected by edges, and each edge has a certain capacity. The goal is to find the maximum flow that can be transferred from one set of vertices to the other, while satisfying the capacity constraints of the edges.

2. How is Network Flow - Bipartite Matching different from other graph matching algorithms?

Network Flow - Bipartite Matching is different from other graph matching algorithms in that it involves finding the maximum flow rather than just matching vertices based on certain criteria. It also takes into account the capacity constraints of the edges, making it a more complex and efficient algorithm.

3. What are some applications of Network Flow - Bipartite Matching?

Network Flow - Bipartite Matching has various applications in computer science, such as in job scheduling, resource allocation, and task assignment problems. It is also used in real-world scenarios like matching organ donors with recipients and matching students with their preferred schools.

4. How does Network Flow - Bipartite Matching work?

Network Flow - Bipartite Matching works by finding the maximum flow from the source vertices to the sink vertices in a given graph. It uses the Ford-Fulkerson algorithm, which iteratively updates the flow by finding augmenting paths and adding the maximum flow possible along those paths. This process is repeated until no more augmenting paths can be found, and the maximum flow is reached.

5. What are the time and space complexities of Network Flow - Bipartite Matching?

The time complexity of Network Flow - Bipartite Matching depends on the size of the graph and the chosen algorithm. In the worst case, it can have a time complexity of O(|V||E|), where V is the set of vertices and E is the set of edges. The space complexity is also dependent on the size of the graph and can be up to O(|V|^2).

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
3
Views
942
Replies
11
Views
470
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
10
Views
1K
Replies
1
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
2K
  • Calculus
Replies
3
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
638
Back
Top