Suppose we have a group of proposed talks with preset start and end times. Students of CSE340 were asked to design an algorithm to schedule as many of these talks as possible in a lecture hall, under the assumptions that once a talk starts, it continues until it ends, no two talks can proceed at the same time, and a talk can begin at the same time another one ends. Assume that talk j begins at time sj (where s stands for start) and ends at time ej (where e stands for end). One student proposed the algorithm shown in Algorithm 1 on the next page, which simply adds talks in order of earliest start time (smallest sj ). (a) Prove, using a counter example, that the proposed algorithm does not always produce an optimal schedule (i.e., a schedule with most possible talks). (b) Another student proposed adding talks in order of shortest duration (ej - sj ). Prove, using a counter example, that even with this new criteria, the algorithm does not always produce an optimal schedule.
Suppose we have a group of proposed talks with preset start and end times. Students of CSE340 were asked to design an
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images