Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Exercise : (Scheduling) Consider the following basic scheduling problem, where the input consists of n jobs represented by an array of processing times P[1n] and
Exercise : (Scheduling) Consider the following basic scheduling problem, where the input consists of n jobs represented by an array of processing times P[1n] and deadlines D[1n]. Your task is to schedule the jobs in such a way that as many jobs as possible respect their deadline. Formally, a schedule is a permutation :[n][n]. We imagine that the jobs [n] are executed in the order (1),(2),,(n). The completion time Cj of a job j is the total processing time of all jobs preceeding j (including j itself), i.e., Cj=i:(i)(j)P[i]. We say that j is early if CjD[j]. Your task is to compute the maximum number of early jobs, across all possible schedules. See Figure 1 for an example. a. First, focus on the simplification of this problem where P[j]=1 for all j[n] (i.e., all jobs have the same processing time 1). Design a greedy algorithm for this scheduling problem running in time O(nlogn). b. Next, focus on the unrestricted problem and let p=j[n]P[j] denote the total processing time of all jobs. Design a dynamic programming algorithm for this scheduling problem running in time O(nlogn+np)
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