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
(i) Describe Banker’s algorithm for deadlock avoidance with supporting example
Consider a computer system with has four identical units of a resource R. There are three processes each with a maximum claim of two units of resource R. Processes can request these resources in anyway, that is, two in one shot or one by one. The system always satisfies a request a request for a resource if enough resources are available. If the process doesn’t request any other kind of resource, show that the system never deadlock
Give a solution for the following synchronization problem using semaphores
Producer- Consumer Problem
Readers- Writers Problem
List out the issues in preprocessor scheduling that causes performance degradation in multiprocessor systems
QUESTION TWO
A. (i) Describe Banker’s algorithm for deadlock avoidance with supporting example
(ii)Consider a computer system with has four identical units of a resource R. There are three processes each with a maximum claim of two units of resource R. Processes can request these resources in anyway, that is, two in one shot or one by one. The system always satisfies a request a request for a resource if enough resources are available. If the process doesn’t request any other kind of resource, show that the system never deadlock
B. Give a solution for the following synchronization problem using semaphores
(i)Producer- Consumer Problem
(ii)Readers- Writers Problem
C. List out the issues in preprocessor scheduling that causes performance degradation in multiprocessor systems
The assignment optimization problem states that given n tasks, n machines, and time required for each machine to do each task, find the minimum time required to do all tasks following a 1-1 assignment of the tasks to the machines.
State the corresponding assignment decision problem.
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
- Suppose you are given n tasks J = {j1, j2, · · · jn}.Each task ji has two parts - a preprocessing phase which takes pi units and a main phase whichtakes fi units of time. There are n machines that can execute the main phases of the jobs in parallel.However, the preprocessing phases need to be executed sequentially on a special machine. Thecompletion time of any schedule is the earliest time when all tasks have finished execution. Designa greedy algorithm which produces a schedule that minimizes the completion time. Here, youneed to give formal proof of correctness. Your proof should not exceed one side of an A4 sheet.Anything more than that will not be considered by the evaluator. Provide only pseudocode.arrow_forwardConsider 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…arrow_forwardImplement this algorithm in C program . Show the gantt chart as output. Round-robin (RR) is one of the algorithms employed by process and network schedulers in computing. As the term is generally used, time slices (also known as time quanta) are assigned to each process in equal portions and in circular order, handling all processes without priority (also known as cyclic executive).arrow_forward
- The issue is said to have the given property if it is feasible to develop an optimum solution for the problem by first successfully creating optimal solutions for each of the problem's subproblems. a) Subproblems that overlap one another; b) achieving optimum substructure; c) memory; and d) being greedyarrow_forwardusing c++ ..Given a set of activities and the starting and finishing time of each activity, find themaximum number of activities that can be performed by a single person assuming that aperson can only work on a single activity at a time.This problem is called the activity selection problem, which concerns the selection ofnon-conflicting activities to perform within a given time frame, given a set of activities eachmarked by a start and finish time. Input:11{1, 4}, {3, 5}, {0, 6}, {5, 7}, {3, 8}, {5, 9}, {6, 10}, {8, 11}, {8, 12}, {2, 13}, {12, 14}Output:4{1, 4}, {5, 7}, {8, 11}, {12, 14}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_forward
- Explore the bakery algorithm for the N-process critical problem. Explain all the conditions for good solution to a critical section problem against the bakery algorithm. Your explanation needs to have a proper scenario you can discuss the scenarios either diagrammatically or descriptively.arrow_forwardThe language must be in python. Neural Network Units two training examples:Example 1: [0.9, 10.0, 3.1, 1]Example 2: [0.9, 2.1, 3.7, 1] Note that you don't have to explicitly include a threshold or bias since the examples include a last element of 1 which means that the last weight effectively operates as a threshold. Create a single ReLU unit and provide the outputs for those examples. Calculate the derivative of the ReLU with respect to net input for both examplesarrow_forward(Greedy Algorithms) Suppose you are given n tasks j={j1,j2,...jn}.Each task jl has two parts -a preprocessing phase which takes pl unites and a main phase which takes fl units of time. There are n machines that can esecute the main phase of the jobs in parallel. However, the preprocessing phases need to be execute sequentially on a special machine. The completion time of any schedule is the earliest time when all tasks have finished execution. Design a greedy algorithm which produces a schedule the minimizes the completion time. Here, you need to give formal proof of correctnessarrow_forward
- 92. An edge from process Pi to Pj in a wait for graph indicates that : a. Pi is waiting for Pj to release a resource that Pi needs b. Pj is waiting for Pi to release a resource that Pj needs c. Pi is waiting for Pj to leave the system d. Pj is waiting for Pi to leave the systemarrow_forwardThere are N cranes (numbered from 0 to N -1) arranged in a line along a road. Road begins at position 0. The K-th crane is located at distance P[K] from the beginning of the road and its arm length is equal to A[K]. The cranes cannot change their positions. There is a package, initially located at position B, that has to be moved by the cranes to position E. The K-th crane can pick up the package only if the distance between its position...... Task from I need solve by Javaarrow_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 overallcompletion 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_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_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