I know this question is posted many time here and there are many solution, but actually all this answers is telling that is to sort
I know this question is posted many time here and there are many solution, but actually all this answers is telling that is to sort the job based on time of (pi,fi) and schedule these jobs which will take n log n.
But I want this code, I mean question need to write this algorithm with showing all steps not only describe the idea by writing paragraph, need to write code of this algorithm with analyzing the time complexity of each line code to come up with final time complexity.
and one note is all proposed solution saying that to sort jobs and time complexity is nlogn, but in the question asking for polonomial algorithm (O(n^k)) not logarithm.
so please show algorithm with polonomial time .
A search engine company needs to do a significant amount of computation every time it recompiles its index. For this task, the company has a single large supercomputer, and an unlimited supply of high-end PCs.They have broken the overall computation into n distinct jobs, labeled J1, J2, ..., Jn, which can be performed completely independently of one another. Each job consists of two stages: first it needs to be preprocessed on the supercomputer, and then it needs to be finished on one of the PCs. Lets say that job Ji needs pi seconds of time on the supercomputer, followed by fi seconds of time on a PC.Since there are at least n PCs available on the premises, the finishing of the jobs can be performed fully in parallel all the jobs can be processed at the same time. However, the supercomputer can only work on a single job at a time, so the system managers need to work out an order in which to feed the jobs to the supercomputer. As soon as the first job in order is done on the supercomputer, it can be handed of to a PC for finishing; at that point in time a second job can be fed to the supercomputer; when the second job is done on the supercomputer, it can proceed to a PC regardless of whether or not the first job is done (since the PCs work in parallel); and so on.Lets say that a schedule is an ordering of the jobs for the supercomputer, and the completion time of the schedule is the earliest time at which all jobs will have finished processing on the PCs. This is an important quantity to minimize, since it determines how rapidly El Goog can generate a new index. Give a polynomial-time algorithm that finds a schedule with as small a completion time as possible.Note: to prove that your greedy strategy yields the optimal solution, you have to prove that the problem has the greedy-choice property
Step by Step Solution
There are 3 Steps involved in it
Step: 1
The problem you are describing is a classic example of optimizing the job scheduling to minimize the overall completion time To keep the time complexi...See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started