Palmer调度算法及Matlab程序
--Palmer D.Sequencing jobs through a multi-stage process in the minimum total time-a quick method of obtaining a near optimum. Operations Research Quarterly,1965,16:101:107
n作业m机器排程的Palmer启发式算法
Palmer启发式算法是基于作业的加工时间按斜度顺序指标排列作业的启发式算法。按机器的顺序,加工时间趋于增加的作业被赋予较大的优先权数。
作业i的斜度指标si定义为:
s(i)=Sigma[j=1:m](2j-m-1)t(i,j) i=1,2,...,n
其中:m为机器数目,t(i,j)为第i个作业在第j台机器上的加工时间。
按s(i)非增的顺序排列作业,可以构造出作业的加工序列:
s(i(i))>=s(i(2))>=...>=s(i(n))
注:求解效果不是太好。
如果5项作业在8台机器上的加工时间如下:
13 13 25 2 14 10 14 18
4 7 3 17 7 9 25 3
6 15 2 1 21 2 6 9
2 1 11 4 2 9 18 3
4 9 12 2 6 22 6 26
Palmer求解结果:
Makespan =148
Schedule =5 2 4 1 3
CDS求解结果:
Makespan =132
Schedule =4 5 2 1 3
两者对比,CDS解比Palmer解的Makespan短近13%;
对应的Matlab计算程序为Palmer.m:
function [Makespan,Schedule]=Palmer(PT)
[n,m]=size(PT);
if n<=1
error('The job qty must large than 2')
end
for i=1:n
SlopeIndex(i)=0;
for j=1:m
SlopeIndex(i)=SlopeIndex(i)+(2*j-m-1)*PT(i,j);
end
end
[Best,BestIndex]=sort(SlopeIndex,'descend');
StartTime(1:m,1:n)=0;
StartTime(1,BestIndex(1))=0;
for j=2:n
StartTime(1,BestIndex(j))=StartTime(1,BestIndex(j-1))+PT(BestIndex(j-1),1);
end
for k=2:m
StartTime(k,BestIndex(1))=StartTime(k-1,BestIndex(1))+PT(BestIndex(1),k-1);
for j=2:n
StartTime(k,BestIndex(j))=max(StartTime(k,BestIndex(j-1))+PT(BestIndex(j-1),k),...
StartTime(k-1,BestIndex(j))+PT(BestIndex(j),k-1));
end
end
Makespan=StartTime(m,BestIndex(n))+PT(BestIndex(n),m);
Schedule=BestIndex;
生产管理 调度