大规模装箱问题:常春藤算法IVY求解二维装箱问题(MATLAB代码)

作品简介

一、问题描述

装载率:所有选择的箱子的总面积与夹板面积之比

假设一共有300个箱子,如何设计算法,使得选择部分箱子放入80*80的甲板上,让甲板的装载率越大,要求箱子间不得重叠。

二、常春藤算法IVY求解二维装箱问题

2.1算法简介

常春藤算法(Ivy algorithm,IVY)是Mojtaba Ghasemi 等人于2024年提出智能优化算法。该算法模拟了常春藤植物的生长模式,通过协调有序的种群增长以及常春藤植物的扩散和演化来实现。常春藤植物的生长速率是通过微分方程和数据密集型实验过程建模的。该算法利用附近常春藤植物的知识来确定生长方向,并通过选择最近和最重要的邻居进行自我改进。常春藤算法通过保持种群多样性、简单灵活的特点,可以轻松修改和扩展,使研究者和实践者能够探索各种修改和技术以增强其性能和能力。

参考文献:

[1]Mojtaba Ghasemi, Mohsen Zare, Pavel Trojovský, Ravipudi Venkata Rao, Eva Trojovská, Venkatachalam Kandasamy,Optimization based on the smart behavior of plants with its engineering applications: Ivy algorithm,Knowledge-Based Systems,Volume 295,2024.https://doi.org/10.1016/j.knosys.2024.111850.

2.2部分代码

常春藤算法IVY的目标函数是甲板的装载率

% -----------------------------------------------------------------------------------------------------------
close all
clear 
clc
SearchAgents_no=30; % Number of search agents
Function_name='F1'; % Name of the test function that can be from F1 to F23 (Table 1,2,3 in the paper)
Max_iteration=30; % Maximum numbef of iterations
% Load details of the selected benchmark function
[lb,ub,dim,fobj]=Get_Functions_details(Function_name);
[fMin,bestX,curve]=IVY(SearchAgents_no,Max_iteration,lb,ub,dim,fobj);
save bestX bestX
save curve curve
ResultList=PlotFigure(bestX);%货物的序号和长宽
save('result.txt','ResultList','-ascii');
figure
plot(curve,'g-','linewidth',3)
xlabel('迭代次数');
ylabel('装载率');
xlim([1 Max_iteration])
% ylim([min(curve) max(curve)])
legend('IVY')

2.3部分结果

下图中甲板中,金黄色区域表示已经放置箱子,粉色区域表示闲置区域。

三、完整MATLAB代码


创作时间: