【优化求解】基于吉萨金子塔建造优化算法 GPC求解最优目标matlab代码

1 简介

吉萨金子塔建造优化算法(Giza Pyramids Construction,GPC)是于2020年提出的一种,新型智能优化算法,其仿照金字塔建造的过程,具有寻优能力强,精度高的特点。

Nowadays, many optimization issues around us cannot be solved by precise methods or that cannot be solved in a reasonable time. One way to solve such problems is to use metaheuristic algorithms. Metaheuristic algorithms try to find the best solution out of all possible solutions in the shortest time possible. Speed in convergence, accuracy, and problem-solving ability at high dimensions are characteristics of a good metaheuristic algorithm. This paper presents a new population-based metaheuristic algorithm inspired by a new source of inspiration. This algorithm is called Giza Pyramids Construction (GPC) inspired by the ancient past has the characteristics of a good metaheuristic algorithm to deal with many issues. The ancient-inspired is to observe and reflect on the legacy of the ancient past to understand the optimal methods, technologies, and strategies of that era. The proposed algorithm is controlled by the movements of the workers and pushing the stone blocks on the ramp. This algorithm is compared with five standard and popular metaheuristic algorithms. For this purpose, thirty different and diverse benchmark test functions are utilized. The proposed algorithm is also tested on high-dimensional benchmark test functions and is used as an application in image segmentation. The results show that the proposed algorithm is better than other metaheuristic algorithms and it is successful in solving high-dimensional problems, especially image segmentation.​

2 部分代码

% Giza Pyramids Construction (GPC) Algorithm

% -------------------------------------------------

clc;
clear;
close all;

%% Problem Definition
CostFunction=@(x) Sphere(x);        % Cost Function

nVar=30;                  % Number of Decision Variables

VarSize=[1 nVar];         % Decision Variables Matrix Size

VarMin=-5.12;             % Decision Variables Lower Bound
VarMax= 5.12;             % Decision Variables Upper Bound

%% Giza Pyramids Construction (GPC) Parameters

MaxIteration=1000;   % Maximum Number of Iterations (Days of work)

nPop=20;             % Number of workers

G = 9.8;             % Gravity
Tetha = 14;          % Angle of Ramp
MuMin = 1;           % Minimum Friction 
MuMax = 10;          % Maximum Friction
pSS= 0.5;            % Substitution Probability

%% Initialization
% Empty Stones Structure
stone.Position=[];
stone.Cost=[];

% Initialize Population Array
pop=repmat(stone,nPop,1);

% Initialize Best Solution Ever Found
best_worker.Cost=inf;

% Create Initial Stones
for i=1:nPop
  pop(i).Position=unifrnd(VarMin,VarMax,VarSize);
  pop(i).Cost=CostFunction(pop(i).Position);
  if pop(i).Cost<=best_worker.Cost
      best_worker=pop(i);          % as Pharaoh's special agent
  end
end

% Array to Hold Best Cost Values
BestCost=zeros(MaxIteration,1);
   
   % Show Iteration Information
   disp(['It:' num2str(it) ', Cost => ' num2str(BestCost(it))]);
end

figure;
%plot(BestCost,'LineWidth',2);
semilogy(BestCost,'LineWidth',2);
xlabel('Iteration');
ylabel('Best Cost');
%grid on;

3 仿真结果

4 参考文献

[1]Sasan Harifi et al., A Giza Pyramids Construction: an ancient‑inspired metaheuristic algorithm for optimization [J]. Evolutionary Intelligence. 2020.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

Matlab科研辅导帮

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

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

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

打赏作者

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

抵扣说明:

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

余额充值