Introduction to Algorithms
3rd Edition
ISBN: 9780262033848
Author: Thomas H. Cormen, Ronald L. Rivest, Charles E. Leiserson, Clifford Stein
Publisher: MIT Press
expand_more
expand_more
format_list_bulleted
Question
Chapter 34, Problem 4P
a.
Program Plan Intro
To state the problem “scheduling with profits and deadlines” as a decision problem.
b.
Program Plan Intro
To show that the decision problem is NP-complete.
c.
Program Plan Intro
To give a polynomial-time
d.
Program Plan Intro
To give a polynomial-time algorithm for the optimization problem, assuming that all processing times are integers from 1 to n.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Job scheduling: Consider the problem of scheduling n jobs of known durations
t1, t2, . . . , tn for execution by a single processor. The jobs can be executed in any order, one job at a time. You want to find a schedule that minimizes the total time
spent by all the jobs in the system. (The time spent by one job in the system is the sum of the time spent by this job in waiting plus the time spent on its execution.) Design a greedy algorithm for this problem. Does the greedy algorithm always yield an optimal solution? (Hint: You may get a clue from Prim’s Algorithm)
Using a pseudo random number generation function (e.g., rand() in C or otherequivalent functions in other languages) that generates uniformly distributed randomnumbers, generate a workload for a system that is composed of 1000 processes. Youcan assume that processes arrive with an expected average arrival rate of 2 processesper second that follows a Poisson Distribution and the service time (i.e., requestedduration on the CPU) for each process follows an Exponential Distribution with anexpected average service time of 1 second. Your outcome would be printing out a listof tuples in the format of <process ID, arrival time, requested service time>.You can assume that process IDs are assigned incrementally when processes arriveand that they start at 1.Based on your actual experiment outcome, also answer the following question: whatare the actual average arrival rate and actual average service time that were generated?
Consider the following Job Scheduling problem. We have one machine and a setof n jobs {1, 2, . . . , n} to run on this machine, one at a time. Each job has a start time sifinish time fi and profit pi where 0 ≤ si < fi < ∞ and pi > 0. Two jobs i and j are compatible if the intervals [si, fi)and [sj , fj ) do not overlap. The goal is to find a set A of mutually compatible jobs with the maximumtotal profit, i.e.,P j∈A pj is maximized.Consider the following two greedy choices. For each one, determine whether it is a “safe” greedy choicefor this Job Scheduling problem. If your answer is yes, prove the “Greedy-choice property”. If your answeris no, please give a counterexample and show that the greedy choice will not lead to an optimal solution.
a.Greedy choice 1: Always select a job with the earliest finish time that is compatible with allpreviously selected activities.b.Greedy choice 2: Always select a job with the highest profit per time unit (i.e., pi/(fi − si))that is…
Chapter 34 Solutions
Introduction to Algorithms
Ch. 34.1 - Prob. 1ECh. 34.1 - Prob. 2ECh. 34.1 - Prob. 3ECh. 34.1 - Prob. 4ECh. 34.1 - Prob. 5ECh. 34.1 - Prob. 6ECh. 34.2 - Prob. 1ECh. 34.2 - Prob. 2ECh. 34.2 - Prob. 3ECh. 34.2 - Prob. 4E
Ch. 34.2 - Prob. 5ECh. 34.2 - Prob. 6ECh. 34.2 - Prob. 7ECh. 34.2 - Prob. 8ECh. 34.2 - Prob. 9ECh. 34.2 - Prob. 10ECh. 34.2 - Prob. 11ECh. 34.3 - Prob. 1ECh. 34.3 - Prob. 2ECh. 34.3 - Prob. 3ECh. 34.3 - Prob. 4ECh. 34.3 - Prob. 5ECh. 34.3 - Prob. 6ECh. 34.3 - Prob. 7ECh. 34.3 - Prob. 8ECh. 34.4 - Prob. 1ECh. 34.4 - Prob. 2ECh. 34.4 - Prob. 3ECh. 34.4 - Prob. 4ECh. 34.4 - Prob. 5ECh. 34.4 - Prob. 6ECh. 34.4 - Prob. 7ECh. 34.5 - Prob. 1ECh. 34.5 - Prob. 2ECh. 34.5 - Prob. 3ECh. 34.5 - Prob. 4ECh. 34.5 - Prob. 5ECh. 34.5 - Prob. 6ECh. 34.5 - Prob. 7ECh. 34.5 - Prob. 8ECh. 34 - Prob. 1PCh. 34 - Prob. 2PCh. 34 - Prob. 3PCh. 34 - Prob. 4P
Knowledge Booster
Similar questions
- We call the density of a task T, C/min(D, P), where C is the computation time, D is the relative deadline, and P is the period. Prove: A system of independent, preemptable tasks can be feasibly scheduled on one processor if its density is equal to or less than 1 (please type out the questions)arrow_forwardI need help with this. unsure how to start and or complete this problem Consider the following Job Scheduling problem. We have one machine and a setof n jobs {1, 2, . . . , n} to run on this machine, one at a time. Each job has a start time sifinish time fi and profit pi where 0 ≤ si < fi < ∞ and pi > 0. Two jobs i and j are compatible if the intervals [si, fi)and [sj , fj ) do not overlap. The goal is to find a set A of mutually compatible jobs with the maximumtotal profit, i.e.,P j∈A pj is maximized.Consider the following two greedy choices. For each one, determine whether it is a “safe” greedy choicefor this Job Scheduling problem. If your answer is yes, prove the “Greedy-choice property”. If your answeris no, please give a counterexample and show that the greedy choice will not lead to an optimal solution. a.Greedy choice 1: Always select a job with the earliest finish time that is compatible with allpreviously selected activities. b.Greedy choice 2: Always select a job…arrow_forward11. ) An algorithm X has two parts XA and Xg. In order to complete running algorithm X both parts have to be executed consecutively. If running time of XA is e(f(n)), and running time of Xp is O() then what should be f(n) so that algorithm X has the most efficient solution.arrow_forward
- The Weighted Interval Scheduling Problem is defined as n requests labelled 1,...,n, with each request i specifying a start time si, a finish time f; and a weight v. For each request i, s;< f;. Assume the requests are sorted in order of non-decreasing finish times: f₁s f₂s... fr. Two requests i and j, iarrow_forwardGiven a set J of jobs, a set M of machines, M and for each j ∈ J and i ∈ M, the time taken to process job j on machine i is pij. formulate this problem into a linear program and relax it to create a linear program (using equations)arrow_forwardGiven a set of jobs {J1, ... , Jn}, each job Ji = < ti, wi > has a required processing time ti and aweight wi. Design an efficient algorithm (pseudo code) to minimize the weighted sum of overall completion times ∑ni=1wiCi, where Ci is the completion time of job i. What is the time complexityof your algorithm? Note: You first need to briefly explain your ideas to solve the problem, e.g. what data structures are used, how the intermediate results are saved, which sorting strategy is used, and why the final results are correct;arrow_forwardIn a school, there are four teachers X1,X2,X3,X4 and five batches Y1,Y2,Y3,Y4,Y5. Given that teacher Xi is required to teach batch Yj for Pij periods, schedule a complete routine in the minimum possible number of periods. The matrix is given below: X1 X2 X3 X4 Y1 2 2 -- -- Y2 1 Y3 -- -- Y4 | 1 2 1 -- Y5 1 1 -- -- Remember there are only 3 class rooms available.arrow_forward2.Polling server. A real-time system has two periodic tasks T1 (5, 1), T2 (6, 2), and a polling server S (4, 1). Two aperiodic jobs are released at 2 and 8 with execution time 1.5 and 2 respectively. Apply Rate-Monotonic algorithm to schedule the periodic and aperiodic jobs and draw the Gantt chartarrow_forward1- According to Hom's theory, the optimal Earliest Deadline First (EDF) algorithm is achieved by: a. Applying first come first served approach. b. Applying the shortest task first approach. e. Applying the least computation power first. d. Any algorithm that can execute the earliest deadline first at any instant. 2- If the captured signal for a real-time system is not suitable for gadgets, then it is more convenient to ... a. Modify the signal using signal conditioning techniques before processing it. b. Use complicated algorithm in the processing step. c. Remove complexity after processing step. d. Add magical number to ADC. 3- The difference between the bus and the port in the computer is a. The bus has more than one bit while the port is a single bit connection. b. The bus has one bit while the port has more than a single bit connection. c. The bus connects more than two devices while the port connects only two devices. d. None of the above. 4- When the resource in the RTOS is…arrow_forward3-22 A small manufacturing department contains three serial workstations (that is, parts go through each of the three workstations in order, one workstation after the other). Parts arrive according to an exponential interarrival-time distribution with mean 8 (all times are given in minutes), with the first part's arriving at time 0. Before a new part can start processing, it must be mounted on a special fixture, and this mounting operation takes 2 minutes (there are four fixtures available, which can be reused, but each fixture can carry only one part at a time). The part remains on the fixture until it completes processing on all the workstations, at which time it is removed from the fixture (this re- moval operations takes 1 minute), after which the fixture becomes available for another part that might be waiting for it. Processing times at the first workstation follow a tri- angular operation time with minimum 4, mode 7, and maximum 9. Processing times at the second workstation have…arrow_forwardConsider the following part of a function (assume n>=1 and m>=1 and n and m are inputs to the function) for (i = 1 to n) for (j - 1 to m) for (k = 1 through 1000) { Task A Task B If Task A requires t time units and Task B requires s time units, then the algorithm requires _in the worst case, assuming that t and s are constants. time units to be executed, and therefore it is 1000 * t* s* n units, O(1000 * t* s ) 1000 + n + m +t + s units, O(1000 + n+ m +t+ s) n*m* t*s units, O(n*m*t*s) 1000*n*m* (t +s) units, O(n*m) O (1000 +m + n) * (t +s) units, O(m + n) O m'n units, O(mn)arrow_forwardConsider a computer system to which two types ofcomputer jobs are submitted. The mean time to run eachtype of job is m1. The interarrival times for each type of jobare exponential, with an average of li type i jobs arrivingeach hour. Consider the following three situations. a Type 1 jobs have priority over type 2 jobs, and pre-emption is allowed. b Type 1 jobs have priority over type 2 jobs, and nopreemption is allowed.c All jobs are serviced on a FCFS basis.Under which system are type 1 jobs best off? Worst off?Answer the same questions for type 2 jobs.arrow_forwardarrow_back_iosSEE MORE QUESTIONSarrow_forward_ios
Recommended textbooks for you
- Operations Research : Applications and AlgorithmsComputer ScienceISBN:9780534380588Author:Wayne L. WinstonPublisher:Brooks Cole
Operations Research : Applications and Algorithms
Computer Science
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Brooks Cole