Question: 4 . A set X = { x 1 , x 2 , . . . , xp } of exams needs to be scheduled
A set X x x xp of exams needs to be scheduled by a university in a set R
r r 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 x x x x x and rooms R r r r
Room r is available between and r is available between and and r is available between and
Exam x must start between and exam x must start between and exam x must start at exam x must start between and and exam x must start between and
The sets of rooms where the exams can be administered are Rr r RRr r Rr r and Rr r r
This is a solution: Schedule x in r at x in r at x in r at x in r at and x in r at
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 FordFulkerson and EdmondsKarp.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
