Question: Problem 1 Greedy Scheduling 3 points Scheduling is a problem where the goal is to permute a set of n tasks, where each i t

Problem 1
Greedy Scheduling
3 points
Scheduling is a problem where the goal is to permute a set of n tasks, where each ith task is prescribed with a length li(which represents the time taken to complete this task) and a priority weight wi(where higher weights represent higher priority).
(a) Implement your own class called Tasks which represents a data structure that stores all the jobs J, along with their respective lengths l and weights w.
(b) Within the Tasks class, implement the GreedyRatio(self) subroutine in this class to find the optimal schedule that minimizes the sum of weighted completion times.
(c) Perform the empirical runtime analysis of your GreedyRatio(self) subroutine by simulating multiple Tasks objects with randomly generating n tasks (Let n=5:5:101), each having a uniformly random length li using the statement randrange (5,51,5), and a uniformly random weight wi using the statement randrange (1,n+1,1).
Problem 1 Greedy Scheduling 3 points Scheduling

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!