We use greedy strategy to solve the activity selection probl

We use greedy strategy to solve the activity selection problem: each time we select the activity with the smallest finishing time and remove the activities which haw overlap with it, then reduce the problem to the sub-problem for the remaining activities. But if we have two CPUs instead, and we still want to select as many as possible activities to process by these two CPUs, does this greedy strategy still work? Similar to question 3, please explain your reason.

Solution

The activity selection process is the process for selecting non conflicting activities with given time frame with each activity having some start time and finish time.The problem is to select maximum number of activities without any conflict but it can be done by single machine at a time for each single activity.Hence the greedy selection method will always result in optimal solution.
As per your requirement and process the sub problems can be assigned to each of the two cpu.The greedy algorithm will then work on both the cpu simultaneously by solving selecting one activity at a time.

 We use greedy strategy to solve the activity selection problem: each time we select the activity with the smallest finishing time and remove the activities whi

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site