Question: This is for a activity selection problem for scheduling several competing activities that require exclusive use of a common resource, with a goal of selecting
This is for a activity selection problem for scheduling several competing activities that require exclusive use of a common resource, with a goal of selecting a maximum-size set of mutually compatible activities. Suppose we have a set S = {a1, a2, , an} of n proposed activities that wish to use a common resource. The resource can serve only one activity at a time. Assume that each activity is represented by an interval. For example, the activity aj = [sj, fj) starts at sj and finishes at fj. The length of the activity aj = [sj, fj) is defined as fj - sj.
- Sort all the activities in the increasing order of their interval lengths. Instead of always selecting the first activity to finish, we instead select the activity with the shortest interval that is compatible with all previously selected activities.
- Give a counter example to show that this greedy approach DOES NOT always yield an optimal solution.
- What is the solution given by this greedy approach on the counter example?
- What is the optimal solution of this counter example?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
