File Exchange

## A mayfly optimization algorithm

version 2.6 (3.36 KB) by
Mayfly Algorithm for global optimization

Updated 12 Jan 2021

This simplified Matlab demo code shows how to use the new Mayfly Algorithm to solve global optimization problems.

### Cite As

Konstantinos Zervoudakis (2021). A mayfly optimization algorithm (https://www.mathworks.com/matlabcentral/fileexchange/76902-a-mayfly-optimization-algorithm), MATLAB Central File Exchange. Retrieved .

Zervoudakis, K., & Tsafarakis, S. (2020). A mayfly optimization algorithm. Computers & Industrial Engineering, 145, 106559. https://doi.org/10.1016/j.cie.2020.106559

Zervoudakis, K., & Tsafarakis, S. (2020), “Mayfly optimization Algorithm - Matlab code”, Mendeley Data, v1. http://dx.doi.org/10.17632/5w58s8hhz2.1

Xiaoma Liu

Benjamin Bohan

k kundu

sir, i have came across with ur another paper on Linear antenna array synthesis using Mayfly Algorithm.Can you please help me in getting code for that.my mail id 1sonu1986@gmail.com.

Lee Jiang Wei

ProblemSize=[1 50] is the dimension of your solution vector.
Your objective function needs a solution to evaluate. What is the dimension of this solution? E.g. [1 5]? [3 2]? etc...

@konstantinos! I downloaded the code, but it gives error. Can you tell me what do you mean by ProblemSize=[1 50]; When I run it, it gives me the following error:
Subscripted assignment dimension mismatch.
Error in fun2sn0 (line 11)
[~, ix1(ix)] = sort(b); % temp stores the randomly generated vector "best" by algorithm
Error in MA>@(x)fun2sn0(x)
Error in MA (line 71)
Mayfly(i).Cost=ObjectiveFunction(Mayfly(i).Position);

All functions are included in one file, it's hard to understand the code like this.

omima bakry

@konstantinos Ok think you

@onima bakra. Yes. In case where your problem is a discrete one, you need to convert the continuous values to discrete ones.

omima bakry

@konstantinos Ok think you
can i use mayfly for solving opf problem for ieee 33 bus system

@onima bakra. The problem probably stems from the R2014a version of Matlab, since the Mayfly Algorithm code was created with R2019a. Considering that in line 229 the functions start to appear, you should move all functions to separate files.

omima bakry

I download and made run but there are error in line 229 column 1 i used matlab R2014a

Nick Rdrm

##### MATLAB Release Compatibility
Created with R2019a
Compatible with R2018a and later releases
##### Platform Compatibility
Windows macOS Linux