✅ Author Profile: A Matlab simulation developer passionate about research, skilled in data processing, modeling simulation, program design, obtaining complete code, reproducing papers, and research simulation.
🍎 Previous Review: Follow my personal homepage:Matlab Research Studio
🍊 Personal Motto: Seek knowledge through investigation,obtain complete Matlab code and simulation consultation via private message.
🔥 Content Introduction
1. Introduction
Path planning is one of the core technologies for intelligent systems such as mobile robots and drones, aiming to find a feasible path in complex environments that meets the criteria of “collision-free, short path, and high smoothness.” Grid maps have become the most commonly used environmental modeling method in path planning due to their intuitive modeling and clear expression of environmental information. The Whale Optimization Algorithm (WOA), a novel intelligent optimization algorithm proposed in 2016, has advantages such as fast convergence speed, fewer parameters, and strong global search capability. However, the original WOA is designed for continuous space optimization, and directly applying it to discrete grid path planning presents issues such as “coding mismatch and difficulty in satisfying obstacle avoidance constraints.” This paper discusses the improvement strategies for adapting WOA to path planning from the perspective of grid map modeling principles, and verifies its effectiveness in obstacle avoidance and path length optimization through simulation experiments, providing clear technical references for related researchers and students.
2. Principles of Grid Map Modeling
The essence of a grid map is to discretize the robot’s working environment into a “grid cell array,” using binary or multi-value coding to describe the state of each cell, achieving a digital representation of environmental information. The modeling process can be divided into three core steps:
(1) Environmental Information Collection and Preprocessing
First, raw environmental data is obtained through sensors (such as LiDAR and visual cameras), including information on obstacle locations, sizes, and environmental boundaries. Then, through denoising (such as filtering to remove measurement errors) and coordinate calibration (unifying the environmental coordinate system with the robot’s coordinate system), structured environmental data is obtained, laying the foundation for grid division.
(2) Grid Cell Division and State Coding
The grid size is determined based on application scenario requirements: if the robot is small and high environmental accuracy is required (such as indoor micro-robots), the grid side length can be set to 5-10 cm; if it is an outdoor drone, the side length can be set to 1-5 m (balancing computational efficiency and environmental detail). After division, each grid is assigned a state value:
- Free Grid: No obstacles, the robot can pass, coded as “0”;
- Obstacle Grid: Contains obstacles (such as walls, furniture, trees), coded as “1”;
- Special Grid: The starting grid is coded as “S”, and the ending grid is coded as “E”, facilitating algorithm recognition of the target.
For example, in a 10×10 indoor grid map (Figure 1), (1,1) is the starting point S, (10,10) is the ending point E, (3,2)-(3,4) and (6,5)-(8,5) are obstacle grids (coded as 1), while the rest are free grids (coded as 0), visually presenting the distribution of environmental obstacles.
(3) Advantages and Adaptability of Grid Maps
The core advantage of grid maps lies in “discretization + digitalization”: discretization transforms complex environments into an iterable set of units, suitable for iterative optimization by intelligent algorithms; digitalization facilitates computer storage and computation, eliminating the need to handle complex geometric relationships in continuous environments. Additionally, grid maps support dynamic updates (for example, when obstacles move, only the corresponding grid coding needs to be modified), providing convenience for dynamic path planning.
3. Fundamentals of the Whale Optimization Algorithm and Path Planning Adaptation Improvements
(1) Core Principles of the Original WOA

⛳️ Results










📣 Sample Code
🔗 References
[1] Wang Buwei, Pan Pengcheng. Path Planning for Mobile Robots with Multiple Target Points Based on Improved Whale Optimization Algorithm [J]. Robotics Technology and Applications, 2023(6):14-19. DOI:10.3969/j.issn.1004-6437.2023.06.004.
🎈 Some theoretical references are from online literature; if there is any infringement, please contact the author for removal.
👇 Follow me to receive a wealth of Matlab e-books and mathematical modeling materials
🏆 Our team specializes in custom MATLAB simulation guidance across various research fields, helping to realize research dreams:
🌟 Improvements and Applications of Various Intelligent Optimization Algorithms
Production scheduling, economic scheduling, assembly line scheduling, charging optimization, workshop scheduling, departure optimization, reservoir scheduling, three-dimensional packing, logistics site selection, cargo position optimization, bus scheduling optimization, charging pile layout optimization, workshop layout optimization, container ship loading optimization, pump combination optimization, medical resource allocation optimization, facility layout optimization, visual domain base station and drone site selection optimization, knapsack problem, wind farm layout, time slot allocation optimization, optimal distribution of distributed generation units, multi-stage pipeline maintenance, factory-center-demand point three-level site selection problem, emergency supply material distribution center site selection, base station site selection, road lamp post arrangement, hub node deployment, transmission line typhoon monitoring devices, container scheduling, unit optimization, investment portfolio optimization, cloud server combination optimization, antenna linear array distribution optimization, CVRP problem, VRPPD problem, multi-center VRP problem, multi-layer network VRP problem, multi-center multi-vehicle VRP problem, dynamic VRP problem, two-layer vehicle path planning (2E-VRP), electric vehicle path planning (EVRP), hybrid vehicle path planning, mixed flow workshop problem, order splitting scheduling problem, bus scheduling optimization problem, flight shuttle vehicle scheduling problem, site selection path planning problem, port scheduling, port bridge scheduling, parking space allocation, airport flight scheduling, leak source localization, cold chain, time windows, multi-parking lots, etc., site selection optimization, port bridge scheduling optimization, traffic impedance, redistribution, parking space allocation, airport flight scheduling, communication upload and download allocation optimization.
🌟 Time Series, Regression, Classification, Clustering, and Dimensionality Reduction in Machine Learning and Deep Learning
2.1 BP Time Series, Regression Prediction, and Classification
2.2 ENS Voice Neural Network Time Series, Regression Prediction, and Classification
2.3 SVM/CNN-SVM/LSSVM/RVM Support Vector Machine Series Time Series, Regression Prediction, and Classification
2.4 CNN|TCN|GCN Convolutional Neural Network Series Time Series, Regression Prediction, and Classification
2.5 ELM/KELM/RELM/DELM Extreme Learning Machine Series Time Series, Regression Prediction, and Classification
2.6 GRU/Bi-GRU/CNN-GRU/CNN-BiGRU Gated Neural Network Time Series, Regression Prediction, and Classification
2.7 Elman Recurrent Neural Network Time Series, Regression Prediction, and Classification
2.8 LSTM/BiLSTM/CNN-LSTM/CNN-BiLSTM Long Short-Term Memory Neural Network Series Time Series, Regression Prediction, and Classification
2.9 RBF Radial Basis Function Neural Network Time Series, Regression Prediction, and Classification
2.10 DBN Deep Belief Network Time Series, Regression Prediction, and Classification
2.11 FNN Fuzzy Neural Network Time Series, Regression Prediction
2.12 RF Random Forest Time Series, Regression Prediction, and Classification
2.13 BLS Broad Learning System Time Series, Regression Prediction, and Classification
2.14 PNN Pulse Neural Network Classification
2.15 Fuzzy Wavelet Neural Network Prediction and Classification
2.16 Time Series, Regression Prediction, and Classification
2.17 Time Series, Regression Prediction, and Classification
2.18 XGBOOST Ensemble Learning Time Series, Regression Prediction, and Classification
2.19 Transform Various Combinations of Time Series, Regression Prediction, and Classification
Directions cover wind power prediction, photovoltaic prediction, battery life prediction, radiation source identification, traffic flow prediction, load forecasting, stock price prediction, PM2.5 concentration prediction, battery health status prediction, electricity consumption prediction, water body optical parameter inversion, NLOS signal identification, precise prediction of subway stops, transformer fault diagnosis.
🌟 Image Processing Aspects
Image recognition, image segmentation, image detection, image hiding, image registration, image stitching, image fusion, image enhancement, image compressed sensing.
🌟 Path Planning Aspects
Traveling Salesman Problem (TSP), Vehicle Routing Problem (VRP, MVRP, CVRP, VRPTW, etc.), 3D path planning for drones, drone collaboration, drone formation, robot path planning, grid map path planning, multimodal transport problems, electric vehicle routing problem (EVRP), two-layer vehicle routing problem (2E-VRP), hybrid vehicle routing problem, ship trajectory planning, full path planning, warehouse patrol, bus time scheduling, reservoir scheduling optimization, multimodal optimization.
🌟 Drone Application Aspects
Drone path planning, drone control, drone formation, drone collaboration, drone task allocation, online optimization of safe communication trajectories for drones, vehicle collaborative drone path planning.
🌟 Communication Aspects
Sensor deployment optimization, communication protocol optimization, routing optimization, target localization optimization, Dv-Hop localization optimization, Leach protocol optimization, WSN coverage optimization, multicast optimization, RSSI localization optimization, underwater communication, communication upload and download allocation.
🌟 Signal Processing Aspects
Signal recognition, signal encryption, signal denoising, signal enhancement, radar signal processing, signal watermark embedding and extraction, electromyography signals, electroencephalography signals, signal timing optimization, electrocardiogram signals, DOA estimation, encoding and decoding, variational mode decomposition, pipeline leakage, filters, digital signal processing + transmission + analysis + denoising, digital signal modulation, bit error rate, signal estimation, DTMF, signal detection.
🌟 Power System Aspects
Microgrid optimization, reactive power optimization, distribution network reconstruction, energy storage configuration, orderly charging, MPPT optimization, household electricity, electric/cold/heat load forecasting, power equipment fault diagnosis, battery management system (BMS) SOC/SOH estimation (particle filter/Kalman filter), multi-objective optimization in power system scheduling, photovoltaic MPPT control algorithm improvement (perturbation observation method/incremental conductance method), electric vehicle charging and discharging optimization, microgrid day-ahead optimization, energy storage optimization, household electricity optimization, supply chain optimization.
🌟 Cellular Automata Aspects
Traffic flow, crowd evacuation, virus spread, crystal growth, metal corrosion.
🌟 Radar Aspects
Kalman filter tracking, trajectory association, trajectory fusion, SOC estimation, array optimization, NLOS identification.
🌟 Workshop Scheduling
Zero-Wait Flow Shop Scheduling Problem (NWFSP), Permutation Flow Shop Scheduling Problem (PFSP), Hybrid Flow Shop Scheduling Problem (HFSP), Zero-Idle Flow Shop Scheduling Problem (NIFSP), Distributed Permutation Flow Shop Scheduling Problem (DPFSP), Blocking Flow Shop Scheduling Problem (BFSP).
👇