If we sort lectures by finish time in descending order, that is, we would process the last lecture first, that is a symmetric of the above greedy algorithm, I believe it definitely works. What if we change step 1, sort lectures by finish time, and keep other steps the same? Does it still work? If none of rooms in the queue is available, add a new room, and insert the lecture into the new room. A room is available if the finish time of last lecture scheduled in the room is less than the start time of the current lecture (no overlap). ESFD has three phases: priority processing, task scheduling and task duplication. In this paper, we propose a new scheduling algorithm called earliest starting and finishing time duplication based (ESFD). The priority of a room is based on the finish time of last lecture scheduled in the room.Īssign each lecture to the first available room in the queue. Optimal task scheduling of a direct acyclic graph (DAG) onto distributed environments is a NP-hard problem. Place all the used rooms in a priority queue. Sort all the lectures by start time in ascending order What if we process lectures by their finish time? Does the greedy algorithm still work? I tried a few examples, and did not find a counter example yet. It is easy to design a greedy algorithm that sorts lectures by start time to minimize the number of rooms used. Given n lectures, each with start time and finish time, the problem is to assign all the lectures to rooms such that no two lectures occur at the same time in the same room.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |