Upload
sadasidha08
View
124
Download
2
Embed Size (px)
DESCRIPTION
This presentation was made as an assignment in my University. Here I have tried to explain one of the oldest approximation algorithm The List Scheduling Algorithm. The idea is to schedule some jobs in some identical parallel machaine.
Citation preview
Scheduling Jobs On Identical Parallel Machines
Greedy Algorithm & Local Search
Prepared ByMir Md. Asif HossainStudent Id : 0805070
Problem Overview‘n’ Different Jobs
‘j’=1 to nWith processing time Pj =1 to ‘n’
JOB 1
JOB 2
JOB 3
JOB ‘N’
All Jobs Are Present At Time 0
Problem Overview
‘m’ Identical Parallel Machine‘i’=1 to m
M1
M2
M4
Mm
Problem Overview
Aim is to complete all jobs as soon as possible
JOB 1
JOB 2
JOB 3
JOB 4
JOB 5
JOB 6 NP HARD
JOB 1
JOB 3
JOB 2
JOB 6 JOB 4
JOB 5
Schedule
Problem Overview
Goal
If job ‘J’ completes at a time Cj
then minimize Cmax = max(j=1,...,n Cj)
Cj is often called the makespan or length of the schedule
Local Search Algorithm For Scheduling Jobs At Identical Parallel Machine
1.Start with any schedule2. Consider job ‘l’ that finishes last3. If there any machine to which it can be reassigned such that this
job finishes earlier . Reassigned the Job.
4. Repeat step until no other Job left to reassigned.
Example Consider a scenario with 7 jobs and 4 parallel machine
JOB 1
JOB 2
JOB 3
JOB 4
JOB 5
JOB 6
JOBS Machines
JOB 7
Example
1.Start with any schedule2. Consider job ‘l’ that finishes last3. If there any machine to which it can be reassigned such that this
job finishes earlier . Reassigned the Job.
4. Repeat step until no other Job left to reassigned.
Example
1.Start with any schedule2. Consider job ‘l’ that finishes last3. If there any machine to which it can be reassigned such that this
job finishes earlier . Reassigned the Job.
4. Repeat until no other Job left to reassigned.
JOB 1
JOB 2
JOB 3 JOB 4JOB 5
JOB 6
JOB 7
Example
1.Start with any schedule2. Consider job ‘l’ that finishes last3. If there any machine to which it can be reassigned such that this
job finishes earlier . Reassigned the Job.
4. Repeat steps until no other Job left to reassigned.
JOB 1
JOB 2
JOB 3 JOB 4JOB 5
JOB 6
JOB 7
Example
1.Start with any schedule2. Consider job ‘l’ that finishes last3. If there any machine to which it can be reassigned such that this
job finishes earlier . Reassigned the Job.
4. Repeat steps until no other Job left to reassigned.
JOB 1
JOB 2
JOB 3 JOB 4JOB 5
JOB 6
JOB 7
Example
1.Start with any schedule2. Consider job ‘l’ that finishes last3. If there is any machine to which it can be reassigned such that this
job finishes earlier . Reassigned the Job.
4. Repeat step 3 until no other Job left to reassigned.
JOB 1
JOB 2
JOB 3 JOB 4JOB 5
JOB 6
JOB 7
Example
1.Start with any schedule2. Consider job ‘l’ that finishes last3. If there is any machine to which it can be reassigned such that this
job finishes earlier . Reassigned the Job.
4. Repeat step 3 until no other Job left to reassigned.
JOB 1
JOB 2
JOB 3 JOB 4JOB 5
JOB 6
JOB 7
Example
1.Start with any schedule2. Consider job ‘l’ that finishes last3. If there is any machine to which it can be reassigned such that this
job finishes earlier . Reassigned the Job.
4. Repeat step 3 until no other Job left to reassigned.
JOB 1
JOB 2
JOB 3 JOB 4JOB 5
JOB 6
JOB 7
Example
1.Start with any schedule2. Consider job ‘l’ that finishes last3. If there is any machine to which it can be reassigned such that this
job finishes earlier . Reassigned the Job.
4. Repeat step 3 until no other Job left to reassigned.
JOB 1
JOB 2
JOB 3 JOB 4JOB 5
JOB 6
JOB 7
Example
1.Start with any schedule2. Consider job ‘l’ that finishes last3. If there is any machine to which it can be reassigned such that this
job finishes earlier . Reassigned the Job.
4. Repeat step 3 until no other Job left to reassigned.
JOB 1
JOB 2
JOB 3 JOB 4JOB 5
JOB 6
JOB 7
Example
1.Start with any schedule2. Consider job ‘l’ that finishes last3. If there is any machine to which it can be reassigned such that this
job finishes earlier . Reassigned the Job.
4. Repeat steps until no other Job left to reassigned.
JOB 1
JOB 2
JOB 3
JOB 4
JOB 5
JOB 6
JOB 7
Example
1.Start with any schedule2. Consider job ‘l’ that finishes last3. If there is any machine to which it can be reassigned such that this
job finishes earlier . Reassigned the Job.
4. Repeat steps until no other Job left to reassigned.
JOB 1
JOB 2
JOB 3
JOB 4
JOB 5
JOB 6
JOB 7
Example
1.Start with any schedule2. Consider job ‘l’ that finishes last3. If there is any machine to which it can be reassigned such that this
job finishes earlier . Reassigned the Job.
4. Repeat steps until no other Job left to reassigned.
JOB 1
JOB 2
JOB 3
JOB 4
JOB 5
JOB 6
JOB 7
Example
1.Start with any schedule2. Consider job ‘l’ that finishes last3. If there is any machine to which it can be reassigned such that this
job finishes earlier . Reassigned the Job.
4. Repeat steps until no other Job left to reassigned.
JOB 1
JOB 2
JOB 3
JOB 4
JOB 5
JOB 6
JOB 7
Example
1.Start with any schedule2. Consider job ‘l’ that finishes last3. If there is any machine to which it can be reassigned such that this
job finishes earlier . Reassigned the Job.
4. Repeat step 3 until no other Job left to reassigned.
JOB 1
JOB 2
JOB 3
JOB 4
JOB 5
JOB 6
JOB 7
Example
1.Start with any schedule2. Consider job ‘l’ that finishes last3. If there is any machine to which it can be reassigned such that this
job finishes earlier . Reassigned the Job.
4. Repeat steps until no other Job left to reassigned.
JOB 1
JOB 2
JOB 3
JOB 4
JOB 5
JOB 6
JOB 7
Example
1.Start with any schedule2. Consider job ‘l’ that finishes last3. If there is any machine to which it can be reassigned such that this
job finishes earlier . Reassigned the Job.
4. Repeat steps until no other Job left to reassigned.
JOB 1 JOB 2
JOB 3
JOB 4
JOB 5
JOB 6
JOB 7
Algorithm Analysis
We first provide some natural lower bounds on the length of an optimal schedule Cmax
Total work done
Average work in each machine is P/m
So
Algorithm AnalysisConsider solution of local search algorithm. Let ℓ be a job that completeslast in this final schedule; the completion time of job ℓ, Cℓ
Partition Total Time into two parts
Sℓ = Cℓ − pℓ pℓ
Algorithm Analysis
Total work done in 1st part m*Sℓ <= total work
So
From 2.4
Hence
Theorem 2.5: The local search procedure for scheduling jobs on identical parallel machines is
a 2-approximation algorithm
From inequality 2.5 we can write thatProof
hence the total length of the schedule produced is at most
By applying lower bounds 2.3 and 2.4 we get that schedule length is at most 1/m is significant only when m is small.
Greedy Algorithm For Scheduling Jobs At Identical Parallel Machine
Whenever a machine is Idle If there is at least a job in the list then
One of the remaining jobs is assigned to start processing on that machine
Often Called As List Scheduling Algorithm
Example Consider a scenario with 7 jobs and 4 parallel machine
JOB 1,3
JOB 2,2
JOB 3,5
JOB 4,2
JOB 5,3
JOB 6,2
JOBS Machines
JOB 7,4
Example Consider a scenario with 7 jobs and 4 parallel machine
JOB 1,3
JOB 2,2
JOB 3,5
JOB 4,2
JOB 5,3
JOB 6,2
JOBS Machines
JOB 7,4
JOB 1,3
Example Consider a scenario with 7 jobs and 4 parallel machine
JOB 2,2
JOB 3,5
JOB 4,2
JOB 5,3
JOB 6,2
JOBS Machines
JOB 7,4
JOB 1,3
JOB 2,2
Example Consider a scenario with 7 jobs and 4 parallel machine
JOB 3,5
JOB 4,2
JOB 5,3
JOB 6,2
JOBS Machines
JOB 7,4
JOB 1,3
JOB 2,2
JOB 3,5
Example Consider a scenario with 7 jobs and 4 parallel machine
JOB 4,2
JOB 5,3
JOB 6,2
JOBS Machines
JOB 7,4
JOB 1,3
JOB 2,2
JOB 3,5
JOB 4,2
Example Consider a scenario with 7 jobs and 4 parallel machine
JOB 5,3
JOB 6,2
JOBS Machines
JOB 7,4
JOB 1,3
JOB 2,2
JOB 3,5
JOB 4,2
JOB 5,3
Example Consider a scenario with 7 jobs and 4 parallel machine
JOB 6,2
JOBS Machines
JOB 7,4
JOB 1,3
JOB 2,2
JOB 3,5
JOB 4,2
JOB 5,3
JOB 6,2
Example Consider a scenario with 7 jobs and 4 parallel machine
JOBS Machines
JOB 7,4
JOB 1,3
JOB 2,2
JOB 3,5
JOB 4,2
JOB 5,3
JOB 6,2
JOB 7,4Cmax = 3+4 = 7
Theorem 2.6: The list scheduling algorithm for the problem of minimizing the makespan on
m identical parallel machines is a 2-approximation algorithm.
Proof
It can be proofed that list scheduling can be reduced to local search algorithm. To see this, If we uses this schedule as the starting point for the local search procedure, that algorithm would immediately declare that the solution cannot be improved.
Improving Our Greedy Approach
Different lists yield different results
Add additional greedy rule to sort the jobs in the list in non decreasing order
This greedy algorithmis called the longest processing time rule, or LPT.
Example Consider a scenario with 7 jobs and 4 parallel machine
JOB 1,3
JOB 2,2
JOB 3,5
JOB 4,2
JOB 5,3
JOB 6,2
JOBS Machines
JOB 7,4
Example Consider a scenario with 7 jobs and 4 parallel machine
JOB 1,3
JOB 2,2
JOB 3,5
JOB 4,2
JOB 5,3
JOB 6,2
JOBSMachines
JOB 7,4 JOB 3,5
JOB 7,4
JOB 5,3 JOB 2,2
JOB 6,2
JOB 1,3
JOB 4,2
Theorem 2.7: The longest processing time rule is a 4/3-approximation algorithm for schedulingjobs to minimize the makespan on identical
parallel machines.
Any counterexample for which the last job ℓ to complete is not the smallest canyield a smaller counterexample, simply by omitting all of the jobs ℓ +1, . . . , n; the length of the schedule produced is the same, and the optimal value of the reduced input can be no larger. Hence the reduced input is also a counterexample.