×
Log in to StudySoup
Get Full Access to Introduction To Algorithms - 3 Edition - Chapter 16 - Problem 16-2
Join StudySoup for FREE
Get Full Access to Introduction To Algorithms - 3 Edition - Chapter 16 - Problem 16-2

Already have an account? Login here
×
Reset your password

Scheduling to minimize average completion time Suppose you

Introduction to Algorithms | 3rd Edition | ISBN: 9780262033848 | Authors: Thomas H. Cormen ISBN: 9780262033848 130

Solution for problem 16-2 Chapter 16

Introduction to Algorithms | 3rd Edition

  • Textbook Solutions
  • 2901 Step-by-step solutions solved by professors and subject experts
  • Get 24/7 help from StudySoup virtual teaching assistants
Introduction to Algorithms | 3rd Edition | ISBN: 9780262033848 | Authors: Thomas H. Cormen

Introduction to Algorithms | 3rd Edition

4 5 1 287 Reviews
11
0
Problem 16-2

Scheduling to minimize average completion time Suppose you are given a set S D fa1; a2;:::;ang of tasks, where task ai requires pi units of processing time to complete, once it has started. You have one computer on which to run these tasks, and the computer can run only one task at a time. Let ci be the completion time of task ai , that is, the time at which task ai completes processing. Your goal is to minimize the average completion time, that is, to minimize .1=n/Pn iD1 ci. For example, suppose there are two tasks, a1 and a2, with p1 D 3 and p2 D 5, and consider the schedule in which a2 runs first, followed by a1. Then c2 D 5, c1 D 8, and the average completion time is .5 C 8/=2 D 6:5. If task a1 runs first, however, then c1 D 3, c2 D 8, and the average completion time is .3 C 8/=2 D 5:5. a. Give an algorithm that schedules the tasks so as to minimize the average completion time. Each task must run non-preemptively, that is, once task ai starts, it must run continuously for pi units of time. Prove that your algorithm minimizes the average completion time, and state the running time of your algorithm. b. Suppose now that the tasks are not all available at once. That is, each task cannot start until its release time ri. Suppose also that we allow preemption, so that a task can be suspended and restarted at a later time. For example, a task ai with processing time pi D 6 and release time ri D 1 might start running at time 1 and be preempted at time 4. It might then resume at time 10 but be preempted at time 11, and it might finally resume at time 13 and complete at time 15. Task ai has run for a total of 6 time units, but its running time has been divided into three pieces. In this scenario, ais completion time is 15. Give an algorithm that schedules the tasks so as to minimize the average completion time in this new scenario. Prove that your algorithm minimizes the average completion time, and state the running time of your algorithm.

Step-by-Step Solution:
Step 1 of 3

Lesson 3.1 – Differential Rules F' (Derivative) c 0 x 1 xn n*x n­1 c*f(x) c*f '(x) f + g f ' + g' f ' ­ g' f ' ­ g' ex ex Examples 1) y = 3x + 2 2) y = x + 12x – 2x 4 3) y = e + 1000x y' = 3 + 0 y' = 12x +24x – 8x 3 y' = e + 1000 y' = 3 Lesson 3.2 – Product and Quotient Rule f ' (derivative) Product Rule: f * g f 'g + g'f Example: y = 4x*2x y' = (2x)*(4x)'+ (4x)*(2x)' y' = (4)*(2x) + (4x)*(2)

Step 2 of 3

Chapter 16, Problem 16-2 is Solved
Step 3 of 3

Textbook: Introduction to Algorithms
Edition: 3
Author: Thomas H. Cormen
ISBN: 9780262033848

Since the solution to 16-2 from 16 chapter was answered, more than 624 students have viewed the full step-by-step answer. Introduction to Algorithms was written by and is associated to the ISBN: 9780262033848. This full solution covers the following key subjects: task, completion, average, tasks, Algorithm. This expansive textbook survival guide covers 35 chapters, and 151 solutions. The answer to “Scheduling to minimize average completion time Suppose you are given a set S D fa1; a2;:::;ang of tasks, where task ai requires pi units of processing time to complete, once it has started. You have one computer on which to run these tasks, and the computer can run only one task at a time. Let ci be the completion time of task ai , that is, the time at which task ai completes processing. Your goal is to minimize the average completion time, that is, to minimize .1=n/Pn iD1 ci. For example, suppose there are two tasks, a1 and a2, with p1 D 3 and p2 D 5, and consider the schedule in which a2 runs first, followed by a1. Then c2 D 5, c1 D 8, and the average completion time is .5 C 8/=2 D 6:5. If task a1 runs first, however, then c1 D 3, c2 D 8, and the average completion time is .3 C 8/=2 D 5:5. a. Give an algorithm that schedules the tasks so as to minimize the average completion time. Each task must run non-preemptively, that is, once task ai starts, it must run continuously for pi units of time. Prove that your algorithm minimizes the average completion time, and state the running time of your algorithm. b. Suppose now that the tasks are not all available at once. That is, each task cannot start until its release time ri. Suppose also that we allow preemption, so that a task can be suspended and restarted at a later time. For example, a task ai with processing time pi D 6 and release time ri D 1 might start running at time 1 and be preempted at time 4. It might then resume at time 10 but be preempted at time 11, and it might finally resume at time 13 and complete at time 15. Task ai has run for a total of 6 time units, but its running time has been divided into three pieces. In this scenario, ais completion time is 15. Give an algorithm that schedules the tasks so as to minimize the average completion time in this new scenario. Prove that your algorithm minimizes the average completion time, and state the running time of your algorithm.” is broken down into a number of easy to follow steps, and 377 words. The full step-by-step solution to problem: 16-2 from chapter: 16 was answered by , our top Engineering and Tech solution expert on 11/10/17, 05:55PM. This textbook survival guide was created for the textbook: Introduction to Algorithms, edition: 3.

Other solutions

People also purchased

Related chapters

Unlock Textbook Solution

Enter your email below to unlock your verified solution to:

Scheduling to minimize average completion time Suppose you