资源简介

带时间窗的节约算法,求解车辆路径问题,是一个函数形式,效果很好

资源截图

代码片段和文件信息

function outcome=cw(NumberoffacilitiesassignofpointttimeutimewindowquantityQofcar)    

%%%%%%%%%Nroutepoint与assignofpoin一一对应
facilitypop=zeros(1:Numberoffacilities);
facilitypop(assignofpoint)=1;
trueSelectefacilities=find(facilitypop(1:)==1);     %被选择的设施编号  
trueselectNumberoffacilities=size(trueSelectefacilities2);
outcome=cell(2Numberoffacilities);
for i=1:trueselectNumberoffacilities%此时的设施为i
    H=1;
    a=trueSelectefacilities(i);%设施的伪编号   
    pointofsubroute=find(assignofpoint==a);%属于该设施点的所有需求点的伪编号    
    Numberofpointsofsubroute=size(pointofsubroute2);%该设施点的需求点数量      
    judge=zeros(1Numberofpointsofsubroute);                           %判断需求点的位置情况       
    chrom1=zeros(1Numberofpointsofsubroute);%最后输入的是伪编号      
    chrom2=sort(pointofsubroute);     

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      27328  2010-04-06 14:42  cw.m

----------- ---------  ---------- -----  ----

                27328                    1


评论

共有 条评论