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
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