Consider a problem in which you have a list J of jobs, each of which takes the same amount of time to complete. You need to schedule these jobs in array S, indexed from 0 to n. Each job occupies a single index in the array, because they each take the same amount of time to complete. Each job j e J has: •deadline j.deadline from 0 to n, denoting the latest index in S at which it can be scheduled. •profit j.profit, denoting the profit or gain from completing job j. The goal is to maximize the sum of profits of the jobs scheduled in S. |J| can be greater than |S|, so it might not be possible to schedule all jobs. There is no penalty for leaving a job undone. Consider the following algorithm: Job Scheduling IN : List J of jobs, max index n 1 S+ an array indexed 0 to n, with null at each index 2 Sort J in non-increasing order of profits 3 for i from 0 to n Find the largest t such that S[t] = null and t < J[i].deadline (if one exists) if an index t was found | S[t] + J[i] OUT: S maximizes the profit of scheduled jobs Note that – is used to denote assignment; x + y means that x is assigned the value of y. Prove that the algorithm is correct. HINT: A schedule S is promising if it can be extended to an optimal schedule by scheduling jobs that have not yet been considered. If S is promising after all jobs have been considered, then S is an optimal schedule.
Consider a problem in which you have a list J of jobs, each of which takes the same amount of time to complete. You need to schedule these jobs in array S, indexed from 0 to n. Each job occupies a single index in the array, because they each take the same amount of time to complete. Each job j e J has: •deadline j.deadline from 0 to n, denoting the latest index in S at which it can be scheduled. •profit j.profit, denoting the profit or gain from completing job j. The goal is to maximize the sum of profits of the jobs scheduled in S. |J| can be greater than |S|, so it might not be possible to schedule all jobs. There is no penalty for leaving a job undone. Consider the following algorithm: Job Scheduling IN : List J of jobs, max index n 1 S+ an array indexed 0 to n, with null at each index 2 Sort J in non-increasing order of profits 3 for i from 0 to n Find the largest t such that S[t] = null and t < J[i].deadline (if one exists) if an index t was found | S[t] + J[i] OUT: S maximizes the profit of scheduled jobs Note that – is used to denote assignment; x + y means that x is assigned the value of y. Prove that the algorithm is correct. HINT: A schedule S is promising if it can be extended to an optimal schedule by scheduling jobs that have not yet been considered. If S is promising after all jobs have been considered, then S is an optimal schedule.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
100%
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education