Answered step by step
Verified Expert Solution
Question
1 Approved Answer
time interval (si, fi). Two activities can be assigned to the same room if their time intervals do not overlap. The task is to find
time interval (si, fi). Two activities can be assigned to the same room if their time intervals do not overlap. The task is to find an assignment of all activities to rooms using minimum number of rooms. (a) Algorithm A (greedy-by-room): Assign as many as possible activities to room 1 (an algorithm from the class can be used, for example), then assign as many as possible activities to room 2, etc. Does Algorithm A always solve the scheduling problem? Justify your answer. (b) Algorithm B (greedy-by-time): Initially R. Process the activities in increasing order of start times. If the current activity can be assigned to one of the rooms in R, then assign it to any such room; otherwise assign it to a new room and add this room to R. Does Algorithm B always solve the scheduling problem? Justify your answer. time interval (si, fi). Two activities can be assigned to the same room if their time intervals do not overlap. The task is to find an assignment of all activities to rooms using minimum number of rooms. (a) Algorithm A (greedy-by-room): Assign as many as possible activities to room 1 (an algorithm from the class can be used, for example), then assign as many as possible activities to room 2, etc. Does Algorithm A always solve the scheduling problem? Justify your answer. (b) Algorithm B (greedy-by-time): Initially R. Process the activities in increasing order of start times. If the current activity can be assigned to one of the rooms in R, then assign it to any such room; otherwise assign it to a new room and add this room to R. Does Algorithm B always solve the scheduling problem? Justify your
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started