Question: 4 . A set X = { x 1 , x 2 , . . . , xp } of exams needs to be scheduled

4. A set X ={x1, x2,..., xp} of exams needs to be scheduled by a university in a set R =
{r1, r2,..., rq} of rooms. Each exam has a duration of one hour. The exam schedule must satisfy the following constraints:
For each exam xi there is a set Ri R of rooms that can be used for it.
Exam xi must start no earlier than time si and no later than time ei.
Each room ri can be used for only one exam at a time.
Room ri is available only from time bi to time fi.
For example, consider the set of exams X ={x1, x2, x3, x4, x5} and rooms R ={r1, r2, r3}.
Room r1 is available between 2 and 4, r2 is available between 3 and 5, and r3 is available between 4 and 5.
Exam x1 must start between 2 and 4, exam x2 must start between 1 and 5, exam x3 must start at 3, exam x4 must start between 3 and 5, and exam x5 must start between 1 and 4.
The sets of rooms where the exams can be administered are R1={r1, r2}, R2={3},R3={r1, r3}, R4={r2, r3}, and R5={r1, r2, r3}.
This is a solution: Schedule x1 in r1 at 2, x2 in r3 at 4, x3 in r1 at 3, x4 in r2 at 3, and x5 in r2 at 4.
Question:
Write an algorithm for solving this problem by reducing it to a maximum flow, minimum cut, or maximum matching problem. If there is a way of scheduling the exams the algorithm must return the value true, otherwise it must return the value false. Draw a figure illustrating how you model the problem using the example above.
Prove that your algorithm correctly solves the above problem.
Compute the worst case time complexity of your algorithm. If you need to compute a maximum flow, use the faster between the algorithms of Ford-Fulkerson and Edmonds-Karp.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!