Question & Answer: Consider the (non-weighted) Interval Scheduling Problem that was discussed in class. (a) Illustrate the greedy algorithm on the in…..

3. Consider the (non-weighted) Interval Scheduling Problem that was discussed in class. (a) Illustrate the greedy algorithm on the input (5,7), (3,8), (2, 4), (6,8), (6,9), (3,6), (7,8). (3 marks) (b) Explain, in general, how one can enumerate all of the optimal answers. How efficient is your (2 marks) algorithm?

Consider the (non-weighted) Interval Scheduling Problem that was discussed in class. (a) Illustrate the greedy algorithm on the input (5,7), (3,8), (2,4), (6,8), (6,9), (3,6), (7,8). (b) Explain, in general, how one can enumerate all of the optimal answers. How efficient is your algorithm?

Expert Answer

 

a. (2, 4) (5,7) (7,8)

In case of greedy algorithm we just choose the one with lowest finishing time and select that first. The next ones are choosen in the same process except the fact that they shouldn’t clash with each other. Hence first (2,4) so then I cant select (3,8) and (3,6) so I had to select (5,7) and so on.

b. Algorithm would be as efficient as sorting algorithm used to sort the finishing time with the starting time as sattelite data and removing the invalid ones with the clashing time

Still stressed from student homework?
Get quality assistance from academic writers!