300 likes | 335 Views
Learn about optimal scheduling strategies for parallel machines, job sequencing, and essential algorithms for efficient processing.
E N D
Parallel Machines(Q||ΣCi ,Q|pmtn|ΣCi , R||ΣCi , R|pmtn|Cmax, R|pmtn|Lmax) Lesson 8
Q||ΣCi Assume that i1, i2,..., ir is the sequence of jobs to be processed on machine Mj. t Mj i1 i2 i3 ● ● ● ir (pi1+pi2+pi3 +...+pir)/sj 0 pi1/sj (pi1+pi2)/sj (pi1+pi2+pi3)/sj The contribution of these jobs is This implies that in an optimal schedule the jobs on machine Mj are sequenced according to nondecreasing processing requirements pi.
Optimal Strategy • Let t1, t2,..., tn be a nondecreasing sequence of the n smallest numbers in the set • If then schedule job i on Mj as the k-th last job because we assume p1 ≥p2 ≥ ... ≥pn.
Q||ΣCi Consider an instance I with 2 machines and 10 jobs. Let s1= 2 and s2= 5. Let p1= 10, p2= 9, p3= 8, p4= 7, p5= 6, p6= 5, p7= 4, p8= 3, p9= 2, and p10= 1.
Q||ΣCi Consider an instance I with 2 machines and 10 jobs. Let s1= 2 and s2= 5. Let p1= 10, p2= 9, p3= 8, p4= 7, p5= 6, p6= 5, p7= 4, p8= 3, p9= 2, and p10= 1. First, we find the 10 smallest numbers:
Q||ΣCi Consider an instance I with 2 machines and 10 jobs. Let s1= 2 and s2= 5. Let p1= 10, p2= 9, p3= 8, p4= 7, p5= 6, p6= 5, p7= 4, p8= 3, p9= 2, and p10= 1. First, we find the 10 smallest numbers: Second, we find the assignment:
Q||ΣCi Consider an instance I with 2 machines and 10 jobs. Let s1= 2 and s2= 5. Let p1= 10, p2= 9, p3= 8, p4= 7, p5= 6, p6= 5, p7= 4, p8= 3, p9= 2, and p10= 1. First, we find the 10 smallest numbers: Second, we find the assignment: M1 10 7 3 M2 t 0 1 2 3.2 4.6 6.5 8.4
Q||ΣCi Consider an instance I with 2 machines and 10 jobs. Let s1= 2 and s2= 5. Let p1= 10, p2= 9, p3= 8, p4= 7, p5= 6, p6= 5, p7= 4, p8= 3, p9= 2, and p10= 1. First, we find the 10 smallest numbers: Second, we find the assignment: M1 10 7 3 M2 t 5 1 9 8 6 4 2 1 0 2 3.2 4.6 6.5 8.4
Optimal Strategy • Let t1, t2,..., tn be a nondecreasing sequence of the n smallest numbers in the set • If then schedule job i on Mj as the k-th last job because we assume p1 ≥p2 ≥ ... ≥pn.
Optimal Strategy • Let t1, t2,..., tn be a nondecreasing sequence of the n smallest numbers in the set • If then schedule job i on Mj as the k-th last job because we assume p1 ≥p2 ≥ ... ≥pn. • Optimality of this strategy is a consequence of the following result about Monge array.
Q|pmtn|ΣCi • To solve this problem we apply an adapted version of the SPT-rule. Order the jobs according to nondecreasing processing requirements, and schedule each successive job preemptively so as to minimize it completion time. In other words, we schedule job n on the fastest machine M1 until it is completed at time t1 = pn/s1. Then we schedule job n – 1 first on machine M2 for t1 time units and then on machine M1 from time t1 to time t2≥ t1 until it is completed. Job n – 2 is scheduled on M3 for t1 time units, on M2 for t2 – t1 time units, and on machine M1 from time t2 to time t3≥ t2 until it is completed, etc.
Q|pmtn|ΣCi Consider an instance I with 2 machines and 10 jobs. Let s1= 2 and s2= 5. Let p1= 10, p2= 9, p3= 8, p4= 7, p5= 6, p6= 5, p7= 4, p8= 3, p9= 2, and p10= 1. M1 9 8 M2 t 10 9 8 0 0.2 0.52 0.992 A simple interchange argument may be used to prove the correctness of the algorithm.
Unrelated Machines • We have n independent jobs i = 1,..., n to be processed on m machines. • The processing time of job i on machine Mj is pij(i = 1,..., n; j = 1,..., m). • This model is a generalization of the uniform machine model we get by setting pij = pi/sj .
No preemption. • The unrelated machines model is a generalization of the uniform machine model. • Remind that, problem Q||ΣCi is the only problem which was polynomially solvable in the case of non-preemptable jobs with arbitrary processing times. • We show that a polynomial algorithm also exists for the corresponding problem with unrelated machines.
R||ΣCi We reduce this problem to assignment problem. Again, if i1, i2,..., ir is the sequence of jobs processed on machine Mj. Mj i1 i2 i3 ● ● ● ir t (pi1j+pi2j+pi3j +...+pirj) 0 pi1j (pi1j+pi2j) (pi1j+pi2j+pi3j) Then the contribution of these jobs in the objective function is
Assignment • We define a position of a job on a machine by considering the job processed last on the first position, the job processed second from last on the second position, etc. To solve problem R||ΣCi we have to assign the jobs i to positions k on machines j. The cost of assigning job i to (k, j) is kpij. t Mj i1 i2 i3 ● ● ● ir (pi1j+pi2j+pi3j +...+pirj) 0 pi1j (pi1j+pi2j) (pi1j+pi2j+pi3j)
Property of Assignment Problem Note that an optimal solution of this assignment problem has the following property: • if some job i is assigned to position k > 1 on machine j, then there is also a job assigned to position k– 1 on machine j. • Otherwise, scheduling job i in position k– 1 would improve the total assignment cost. • A solution of the Assignment Problem always yields an optimal solution of our scheduling problem.
R|pmtn|Cmax We solve problem R|pmtn|Cmaxin two steps. • We formulate a linear program to calculate for each job i and each machine j the amount of time tijmachine j works on job i in an optimal schedule. • We construct a corresponding schedule.
R|pmtn|Cmax • Given nm positive integers pij, which represents the total processing times of job i on machine Mj. • Let tij be the processing times of that part of job i which is processed on Mj. • Then tij/ pij is the fraction of time that job i spends on machine j, and must hold in order for job i to be completed.
LP the total time job ispends on all machines. the total time machine Mj spends processing jobs.
Schedule • An optimal solution of LP determines for each job i and each machine j the amount of time tij machine j works on job iin an optimal schedule. M1 1 2 5 M2 1 2 3 M3 3 4 M4 1 3 5 0 Cmax
Schedule • An optimal solution of LP determines for each job i and each machine j the amount of time tij machine j works on job iin an optimal schedule. • Also we have
LP the total time job ispends on all machines. the total time machine Mj spends processing jobs.
Schedule • An optimal solution of LP determines for each job i and each machine j the amount of time tij machine j works on job iin an optimal schedule. • Also we have • To problem of finding a corresponding schedule is equivalent to the problem of finding a solution to the O|pmtn|Cmaxproblem.
O|pmtn|Cmax • An optimal schedule of the O|pmtn|Cmax problem achieves the bound • An optimal schedule of the O|pmtn|Cmax problem can be constructed in polynomial time by using the reduction to Bipartite Matching problem.
R|pmtn|Lmax • Assume that the jobs are numbered in nondecreasing due date order, i.e. d1 d2 ... dn. • Let be the total amount of time that machine Mj spends on job i within the time period I1=[0, d1 +Lmax]. • Furthermore, for k = 2,..., n let be the total amount of time that machine Mj spends on job i within the time period Ik=[dk–1 +Lmax, dk +Lmax]. t 0 d1 d2 d3 d4 t 0 d1+Lmax d2+Lmax d3+Lmax d4+Lmax
LP the total time job ispends on all machines in Ik. the total time machine Mj spends processing jobs in Ik.
Schedule • Given an optimal solution of this LP, an Lmax-optimal schedule can be obtained by constructing for each of the time periods Ik (k = 1,..., n) a corresponding schedule using the data given by the matrix • For each interval Ik we get an instance of O|pmtn|Cmaxproblem and problem R|pmtn|Lmaxis polynomially solvable.
Exercise • Formulate LP for R| pmtn, ri|Lmax.