基于混洗遗传算法求解分布式系统中的任务调度附matlab代码

提出一种改进的洗牌遗传算法(SGA),用于解决异构分布式系统中的任务调度问题。该算法通过优化任务调度来减少应用的总执行时间,并采用HEFT方法生成初始种群,结合遗传操作得到近似最优解。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。

🍎个人主页:Matlab科研工作室

🍊个人信条:格物致知。

更多Matlab仿真内容点击👇

智能优化算法       神经网络预测       雷达通信       无线传感器        电力系统

信号处理              图像处理               路径规划       元胞自动机        无人机 

⛄ 内容介绍

Distributed systems such as Grid- and Cloud Computing provision web services to their users in all of the world. One of the most important concerns which service providers encounter is to handle total cost of ownership (TCO). The large part of TCO is related to power consumption due to inefficient resource management. Task scheduling module as a key component can has drastic impact on both user response time and underlying resource utilization. Such heterogeneous distributed systems have interconnected different processors with different speed and architecture. Also, the user application which is typically presented in the form of directed acyclic graph (DAG) must be executed on this type of parallel processing systems. Since task scheduling in such complicated systems belongs to NP-hard problems, existing  heuristic approaches are no longer efficient. Therefore, the trend is to apply hybrid metaheuristic approaches. In this paper, we extend a meta-heuristic shuffled genetic-based task  scheduling algorithm to minimize total execution time, makespan, of user application. In this regard, we take benefit of other heuristics such as Heterogeneous Earliest Finish Time (HEFT) approach to generate smart initial population by applying a new shuffle operator which makes a fortune to explore feasible and promising individuals in the search space. We also conduct other genetic operators in right way to produce final near to optimal solution. To reach concrete results we have conducted several scenarios. Our proposed algorithm outperforms in term of average makespan compared with other existing approaches such as HEFT versions and QGARAR.

⛄ 部分代码

%% Shuffled Genetic Algorithm for Task Scheduling based on:

% Hosseini, M. (2018). A new Shuffled Genetic-based Task 

%Scheduling Algorithm in Heterogeneous Distributed Systems.

% Journal of Advances in Computer Research, 9(4), 19-36.

clc

clear

close all

%%

global nVM nTask DAG extP0 extP1 extP2 c

nVM=3; % Number of Hetergenous Virtual Machines

c=ones(nVM)-eye(nVM);  % communication time between servers

nTask=11; % Number of Tasks

DAG=[0 12 14 0 0 0 0 0 0 0 0  % Directed Acyclic Graph

     0 0 0 8 15 11 0 0 0 0 0

     0 0 0 0 0 0 13 0 0 0 0

     0 0 0 0 0 0 0 11 0 0 0

     0 0 0 0 0 0 0 8 0 0 0

     0 0 0 0 0 0 0 0 7 12 0

     0 0 0 0 0 0 0 0 0 14 0

     0 0 0 0 0 0 0 0 0 0 15

     0 0 0 0 0 0 0 0 0 0 7

     0 0 0 0 0 0 0 0 0 0 10

     0 0 0 0 0 0 0 0 0 0 0];

extP0=[7 10 5 6 10 11 12 10 8 15 8]; %Execution Time on Processor1

extP1=[9 9 7 8 8 13 15 13 9 11 9];

extP2=[8 14 6 7 6 15 18 7 10 13 10];

Wbar=[8 11 6 7 8 13 15 10 9 13 9]; % Average Computation Cost

npop=20; % population size

maxIter= 100; % maximum number of generation

%% The first generation:

population=INITp(npop);

%% Genetic optimization:

for iter=1:maxIter

    for i=1:npop

        cost(i)=MAPPER(population{i});

        fitness(i)=1/cost(i);

    end

    for i=1:npop

        probs(i)=fitness(i)/sum(fitness);

    end

    [val,idx]=sort(cost);

    best=population{idx(1)};

    min_cost=val(1);

    disp(['Generation ',num2str(iter),' ... min cost= ',num2str(min_cost)]);

    plot(iter,min_cost,'ko');

    hold on

    pause(0.000001)

    for i=1:npop

        if i<= 0.2 * npop

            newPopulation{i}=population{idx(i)};

        else

            id1=randsrc(1,1,[1:npop;probs]); % Roullete wheel

            id2=randsrc(1,1,[1:npop;probs]);

            parent1=population{id1};

            parent2=population{id2};

            newPopulation{i}=crossover_mutation(parent1,parent2);

        end

    end

    population=newPopulation;

end

final_solution=best

makespan_genetic=val(1)

makespan_Level=MAPPER(1:11)

makespan_rankd=MAPPER([1 2 3 4 7 6 5 8 9 10 11])

makespan_ranku=MAPPER([1 3 2 7 6 4 5 8 10 9 11])

⛄ 运行结果

⛄ 参考文献

Hosseini, M. (2018). A new Shuffled Genetic-based Task  Scheduling Algorithm in Heterogeneous Distributed Systems. Journal of Advances in Computer Research, 9(4), 19-36.

⛄ 完整代码

❤️部分理论引用网络文献,若有侵权联系博主删除

❤️ 关注我领取海量matlab电子书和数学建模资料

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

matlab科研助手

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值