

I can not decide which of these is going to be optimal. In each case we will have take in to account the chosen jobs being compatible, needless to say. If I go for alternate fashion, I choose the first possible job in the first resource, then second possible job in the second resource and so on. If I go for sequential manner, I schedule all the possible jobs in the first resource and then do the same for second resource with the jobs yet to be scheduled. My problem is, how do I proceed after that? Do I choose the resources in sequential or in an alternate fashion? How do I schedule my jobs now? As my idea goes, again you start by sorting the requests in order of finish time. Now, let us say we have two resources instead of one. In order to schedule the $n$ job requests over one resource, you sort the requests in order of finish time, choose the request with earliest finish time, choose the next compatible one, and so on. Qj = BST.floor(S.Consider the interval scheduling problem, see also here. Weighted-Activity-Selection(S): // S = list of activities When we have optimal substructure and repeating subproblems then natural solution would be to use DP to reuse the computation by caching subproblem solutions in a DP table. P1 requires 21 ms for completion, hence waiting time for P2 will be 21 ms Similarly, waiting time for process P3 will be execution time of P1 + execution time. Job Details // max of including and excludingįor the example, we can see from the recursion tree of the example, there are lots of subproblems we need to recompute if we do plain recursion of the above optimal substructure. A formal explanation is given by a Charging argument. Continue until the set of candidate intervals is empty.


Remove x, and all intervals intersecting x, and all intervals in the same group of x, from the set of candidate intervals. Given N jobs where every job is represented by following three elements of it.ģ) Weight representing Profit or Value Associated.įind the maximum profit subset of jobs such that no two jobs in the subset overlap. Select the interval, x, with the earliest finishing time.
