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
Concept explainers
Question
Chapter 16.5, Problem 1E
Program Plan Intro
Program Plan:To get the solution of scheduling problem where each penalty wi is replaced by 80- wi.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
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, i
No plagarism please!
Correct and detailed answer will be Upvoted else downvoted. Thank you!
Q. Which of the following is CORRECT for the weighted interval scheduling problem?
1. The original problem is one of the subproblems.
2. To ensure that a problem can be solved using dynamic programming, there should be a natural ordering on subproblems from “smallest” to “largest”. In the weighted interval scheduling problem, OPT(j) is a smaller problem than OPT(p(j))
3. The recursive implementation of the algorithm for computing the optimal value without using memoization has o(n) complexity
4. Weighted interval scheduling problem has exponential computing complexity.
As a teaching administrator of the department, your responsibility is to schedule the
classes for a particular classroom. Suppose there are n classes, each class i is
represented by its start time and finishing time [Si, fi], and we say that two classes i
and j are non-conflicting if they do not overlap in time (i.e., sizfj or szfi). You want to
schedule as many classes for the classroom as possible, but the scheduled classes
should be non-conflicting. Develop an algorithm so that you can select the maximum
number of classes for the classroom. (We are expecting either pseudocode or
language description of your algorithm)
Chapter 16 Solutions
Introduction to Algorithms
Ch. 16.1 - Prob. 1ECh. 16.1 - Prob. 2ECh. 16.1 - Prob. 3ECh. 16.1 - Prob. 4ECh. 16.1 - Prob. 5ECh. 16.2 - Prob. 1ECh. 16.2 - Prob. 2ECh. 16.2 - Prob. 3ECh. 16.2 - Prob. 4ECh. 16.2 - Prob. 5E
Ch. 16.2 - Prob. 6ECh. 16.2 - Prob. 7ECh. 16.3 - Prob. 1ECh. 16.3 - Prob. 2ECh. 16.3 - Prob. 3ECh. 16.3 - Prob. 4ECh. 16.3 - Prob. 5ECh. 16.3 - Prob. 6ECh. 16.3 - Prob. 7ECh. 16.3 - Prob. 8ECh. 16.3 - Prob. 9ECh. 16.4 - Prob. 1ECh. 16.4 - Prob. 2ECh. 16.4 - Prob. 3ECh. 16.4 - Prob. 4ECh. 16.4 - Prob. 5ECh. 16.5 - Prob. 1ECh. 16.5 - Prob. 2ECh. 16 - Prob. 1PCh. 16 - Prob. 2PCh. 16 - Prob. 3PCh. 16 - Prob. 4PCh. 16 - Prob. 5P
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.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?arrow_forwardFrom the textbook NETWORK FLOWS: THEORY, ALGORITHMS, AND APPLICATIONS - Exercise 4.2: Formulate and solve with Python code using a topo-shortest-path algorithm and data below: Beverly owns a vacation home in Cape Cod that she wishes to rent for the period May 1 to August 31. She has solicited a number of bids, each having the following form: the day the rental starts (a rental day starts at 3 P.M.), the day the rental ends (checkout time is noon), and the total amount of the bid (in dollars). Beverly wants to identify a selection of bids that would maximize her total revenue. Find the best bids to accept using python. Data Below: Bid Start End Nights Price 1 1 3 2 581 2 2 6 4 1149 3 2 5 3 844 4 3 8 5 1406 5 4 8 4 1129 6 6 12 6 1701 7 8 12 4 1136 8 8 16 8 2245 9 8 18 10 2829 10 12 16 4 1140 11 12 17 5 1429 12 13 16 3 865 13 15 20 5 1419 14 17 21 4 1120 15 18 20 2 574 16 19 24 5 1401 17 23 30 7 1973 18 25 28 3 866 19 25 29 4 1129 20 27 31 4 1122arrow_forwardYou are organizing a conference that has received n submitted papers. Your goal is to get people to review as many of them as possible. To do this, you have enlisted the help of k reviewers. Each reviewer i has a cost sij for writing a review for paper j. The strategy of each reviewer i is to select a subset of papers to write a review for. They can select any subset S; C {1,2, ..., n}, as long as the total cost to write all reviews is less than T (the time before the deadline): 2 Sij 1. (b) Show that for B = 2 this fraction is close to 1/3. [Hint: You can consider an instance with 3n + 1 papers and only n will be reviewed.]arrow_forward
- Let A = {1, 2, 3, 4, 5} and B = {2, 3, 4, 5, 6, 7} and C = {a, b, c, d, e} 15. Give an example of f: A -> B that is not 1-1.arrow_forwardFrom Greedy Algorithm, there were 3 candidates of simple rules that are really impractical when we designed an algorithm to solve the interval scheduling problem. The first impractical rule was picking a request that starts earliest. The second impractical rule was picking a request that has minimum interval. And the last one was picking a request with the smallest number of conflicts. Describe in 1 paragraph the scenario that will cause a problem if we implement the last rule as a simple rule of the greedy algorithm.arrow_forward(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 systemsarrow_forward
- For the employee file discussed in illustrative problem 18.1, making use ofTable P18.1, answer the questions given below:Records from the employee file are to be read and, by making use of the basicpay, allowances and deductions, the total salary is to be computed for eachemployee. Assume that it takes 200 µs of CPU time to perform the computation fora single record. The updated records are to be written onto the disk.a) What is the time taken to process a sector of records?b) Having processed a sector of records, what is the time taken to process allrecords in the very next sector?c) What is the time taken to process the records, in all sectors of a track,assuming that the sectors are continuously read?d) What is the time taken to process all records in a cylinder?arrow_forwardWrite a divide-and-conquer algorithm for the Towers of Hanoi problem. TheTowers of Hanoi problem consists of three pegs and n disks of differentsizes. The object is to move the disks that are stacked, in decreasing order oftheir size, on one of the three pegs to a new peg using the third one as atemporary peg. The problem should be solved according to the followingrules: (1) when a disk is moved, it must be placed on one of the three pegs;(2) only one disk may be moved at a time, and it must be the top disk on oneof the pegs; and (3) a larger disk may never be placed on top of a smallerdisk.(a) Show for your algorithm that S (n) = 2n − 1. (Here S (n) denotes thenumber of steps (moves), given an input of n disks.)(b) Prove that any other algorithm takes at least as many moves as given inarrow_forwardProcesses P1, P2, and P2 are queued to run. The arrival time of P1 is t = 0, the arrival time of P2 is t = 1, and the arrival time of P3 is t = 2. According to the first come first serve (FCFS) algorithm, processes are run by the operating system. P1 operates 7 time units, P2 4 time units, P3 operates 1 time unit. So what is the average waiting time (in time units) for this system? 0 5 3 7arrow_forward
- Part(a): What is a Deadlock? How it is detected? What are the necessary conditions for a deadlock to occur? Part(b): Suppose there are two resources available and the initial value of semaphore is set to 3.Consider a situation where P() and V() functions are called as follows. P(), P(), V(), V(), P(), P(), V(), P(), P(), V(), P(),P(),P(),V() Answer the following: 1. How many processes are sleeping on P ()?What is the value of semaphore? 2. How may processes have successfully completed their execution? 3. How many resources are available?arrow_forwardWireless sensor networks are a special kind of network that facilitates communication. Sensor nodes in WSNs relay information to and from a central base station. The computing resources and storage space of a sensor node are limited. Take, for example, an algorithm that can be solved by solving subproblems. Is it preferable to use dynamic programming or divide and conquer to solve these subproblems independently at various sensor nodes? Try to keep your writing short and sweet.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_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
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