# Path Planning Optimization of the Load Transport Process Using Heuristic Algorithms
## 2 Description of the Problem  
The working environment (Figure 1) has additional constraints (1, 4) and obstacles (2, 3). The limitations result from the range of working movements that can be performed by the crane ([27]), while the obstacles can be interpreted as buildings or other machines located in its work zone. Forbidden areas are defined as geometric shapes (cylinders) that can be described by their height (\(h\)) and diameter (\(d\)). The proposed work environment model can be applied to industrial settings where precise crane movements are essential to navigating complex arrangements of obstacles and other equipment. These conditions include, but are not limited to, construction sites and warehouses where the safe transfer of heavy loads is critical to operational efficiency. The key assumption of this problem is to transfer the load from the starting point \(P_{s}\) to the endpoint \(P_{k}\) by the shortest possible path while maintaining work safety and determining the characteristic variables that allow the crane to map the optimal trajectory. Based on the assumptions made, the single-criteria optimization objective function will have the form [25; 26]:  
\[f_{1}=L(1+K_{1})\Rightarrow min, \tag{1}\]  
where \(L\)--trajectory length and \(K_{1}\)--penalty function. In three-dimensional problems, the penalty function can be defined as [26]:  
\[K_{1}=\lambda\sum_{j}^{n}\sum_{i}^{m}k_{ji} \tag{2}\]The individual components of Formula (2) take the form:  
\[A_{ji}=\left\{ \begin{array}{ll}1&\text{for }d_{ji}<r_{j}\\ 0&\text{for }d_{ji}\geq r_{j}\end{array} \right. \tag{3}\]  
\[B_{ji}=\left\{ \begin{array}{ll}1&\text{for }z\leq H_{j}+h_{j}&\&\quad z\geq h_{j} \\ 0&\text{for }z>H_{j}+h_{j}&\&\quad z<h_{j}\\ 0&\text{for }z<H_{j}+h_{j}&\&\quad z<h_{j}\\ 0&\text{for }z>H_{j}+h_{j}&\&\quad z>h_{j}\end{array} \right. \tag{4}\]  
\[k_{ji}=A_{ji}B_{ji}\left(1-\frac{d_{ji}}{r_{j}}\right) \tag{5}\]  
where \(z_{i}\) is the designated trajectory point on the Z-axis, \(H_{j}\) is the height of the obstacle, \(h_{j}\) is the distance between the obstacle and ground, \(d_{ij}\) is the distance between the trajectory point and the obstacle center, \(r_{j}\) is the radius of the obstacle, \(j\) is the number of obstacles, \(i\) is the number of trajectory points, \(k\) is the trajectory number of an iteration, \(\lambda\) is the scale coefficient, \(n\) is the sum of obstacles and \(m\) is the sum of trajectory points. The penalty function, which has been presented in the objective function, takes into account, among others, the following cases: one of the crane's points is in an obstacle or there is a collision between the crane's members. If one of these conditions is met, the objective function increases its value by the penalty function. The subject of appropriate selection of the penalty function has been extensively described in the papers [28; 29]. The optimization process was carried out using two heuristic algorithms: the classic genetic algorithm (GA) and the particle swarm optimization algorithm (PSO). The choice of parameters for both algorithms, such as population size and mutation rates for GA or swarm size for PSO, was made based on preliminary tests, to ensure optimal performance for the crane operating environment. These choices were critical to minimize the impact of local minima on solution quality and convergence time [25; 26]. All tests were performed on a Fujitsu Esprimo C720 computer (Fujitsu Technology Solutions, Augsburg, Germany) with the following parameters: CPU Intel(R) Core(TM) i5-4590 @3.30 GHz, RAM 8 GB, Intel(R) HD Graphics 460. Both heuristic algorithms have been implemented in Matlab R2022b software through self-written scripts and functions. The parameters of the working space adopted for the research are as follows:  
* Co-ordinates (in mm) of the starting point \(P_{s}(-600,800,1)\),  
Figure 1: Rotary crane working environment.