Skip to content

Repository files navigation

CNJSO: Conscious Neighborhood-Based Jellyfish Search Optimizer

MATLAB DOI

MATLAB implementation of the Conscious Neighborhood-Based Jellyfish Search Optimizer (CNJSO), an improved Jellyfish Search Optimizer designed to strengthen exploration and improve the balance between exploration and exploitation.

Associated paper

M. H. Nadimi-Shahraki, M. Banaie-Dezfouli, and H. Zamani, "Conscious Neighborhood-Based Jellyfish Search Optimizer for Solving Optimal Power Flow Problems," Mathematics, vol. 13, no. 19, article 3068, 2025. https://doi.org/10.3390/math13193068

The paper is open access: read the copy included in this repository or view the published article.

Main contributions

CNJSO extends the original Jellyfish Search Optimizer through three complementary mechanisms:

  1. Conscious neighborhood: each jellyfish identifies neighbors and non-neighbors using spatial and fitness information, then consciously selects a local or global movement strategy.
  2. Best Archive and Non-neighborhood-based Global Search (BNGS): a randomly selected archived solution and a random non-neighbor guide global exploration.
  3. Wandering Around Search (WAS): an inferior jellyfish receives additional opportunities to improve through a random number of jumps over randomly selected dimensions.

These mechanisms are intended to increase population diversity, reduce premature convergence, and improve the exploration-exploitation balance.

Algorithm outline

For each iteration, CNJSO:

  1. calculates the conscious neighborhood and non-neighborhood of every jellyfish;
  2. selects a random local neighbor and the best global non-neighbor;
  3. chooses between movement within the swarm and BNGS;
  4. applies boundary handling and evaluates the new position;
  5. invokes WAS when the new solution fails to improve the personal best;
  6. updates personal bests and the archive of iteration-best solutions; and
  7. records the best fitness and convergence history.

Repository contents

File Purpose
main.m Configures and runs the benchmark demonstration
CNJSO.m Main CNJSO optimization procedure and archive management
Generating_Neighborhood.m Constructs conscious neighborhoods and non-neighborhoods
WAS_strategy.m Implements the Wandering Around Search strategy
initialization.m Initializes the population using a logistic chaotic map
Get_Functions_details.m Provides the included Sphere (F1) and Schwefel 2.22 (F2) functions
paper/CNJSO-paper.pdf Open-access copy of the associated article
CITATION.cff Machine-readable citation metadata

Requirements

  • MATLAB R2018a or later

The implementation was developed in MATLAB R2018a.

Quick start

  1. Download or clone this repository.
  2. Open the repository folder in MATLAB.
  3. Run:
main

The default demonstration minimizes the 30-dimensional Sphere function (F1) using 30 jellyfish. It prints the best solution and fitness and displays a convergence curve.

To run the second included benchmark, edit main.m:

Function_name = 'F2';

Calling CNJSO from your own code

Define a minimization objective function that accepts a row vector and returns one scalar:

objective = @(x) sum(x.^2);
D = 30;
N = 30;
MaxFES = D * 1000;
lb = -100;
ub = 100;

[bestFitness,bestPosition,~,curve] = ...
    CNJSO(D,N,MaxFES,lb,ub,objective);

lb and ub may be scalars or vectors containing one bound per decision variable.

Outputs

  • bestFitness: best fitness reported at the final iteration;
  • bestPosition: corresponding decision vector;
  • BestChart: stored best value at each iteration; and
  • curve: convergence history.

Demo versus full paper experiments

This repository is a compact general-optimization demonstration containing two classical benchmark functions. It does not include the complete CEC 2018 suite, the ten comparison algorithms, power-flow solvers, or IEEE 30-bus and 118-bus OPF case files used for the paper's experimental tables.

The paper reports:

  • CEC 2018 experiments in 30, 50, and 100 dimensions;
  • 100 search agents and a nominal evaluation setting of 10^4 x dimension;
  • 20 independent runs;
  • comparisons with PSO, KH, GWO, WOA, EEGWO, HGSO, JSO, TSA, MTBO, and FOA;
  • Wilcoxon rank-sum and Friedman statistical tests; and
  • OPF experiments using population size 50, 200 iterations, and 20 runs.

Accordingly, the included demo illustrates the core CNJSO implementation but does not directly reproduce all numerical results in the article. The MaxFES input is used by this release to calculate the iteration count as floor(MaxFES/N); extra objective evaluations performed by WAS are not counted explicitly.

Reproducibility

CNJSO is stochastic. For a repeatable demonstration, uncomment the rng(1,'twister') line in main.m. For research comparisons, perform multiple independent runs and report summary statistics.

Release safeguards

The GitHub-ready release retains the proposed CNJSO strategies and adds small implementation safeguards: consistent archive dimensions, population-sized archive capacity, correct neighborhood index mapping, safe handling of zero neighborhood denominators and empty sets, scalar/vector bound validation, correct output assignment in main.m, and preallocated convergence arrays.

Citation

If this code contributes to your research, please cite the associated article:

@article{NadimiShahraki2025CNJSO,
  author  = {Nadimi-Shahraki, Mohammad H. and Banaie-Dezfouli, Mahdis and Zamani, Hoda},
  title   = {Conscious Neighborhood-Based Jellyfish Search Optimizer for Solving Optimal Power Flow Problems},
  journal = {Mathematics},
  volume  = {13},
  number  = {19},
  pages   = {3068},
  year    = {2025},
  doi     = {10.3390/math13193068}
}

Contact

Mahdis Banaie-Dezfouli (corresponding author)
GitHub: MahdisBD
Email: m.dezfouli@sco.iaun.ac.ir

Usage and citation

This repository is provided for academic and research visibility. No open-source software license is currently granted. If you use or refer to this implementation in academic work, please cite the associated paper. For permission to reuse, modify, or redistribute the code, please contact the authors.

The included article is distributed under the Creative Commons Attribution 4.0 license stated in the paper.

About

MATLAB implementation of the Conscious Neighborhood-Based Jellyfish Search Optimizer (CNJSO) for numerical optimization and optimal power flow research.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages