A Path Planning Model with a Genetic Algorithm for Stock Inventory Using a Swarm of Drones

: In this paper, a mathematical model and solution for performing the inventory tasks of a multi-user, mixed warehouse in which neither satellite positioning nor other IT solutions can be used was presented. After reviewing the literature on road planning and the use of drones in warehouses, a method is presented that can be used to control drones that can be moved in all directions for imaging and transmission. The proposed method consists of three main steps. As a ﬁrst step, we provide the mathematical model and solution method needed to determine the (optimal execution time) access routes required for processing the compartments of the warehouses. This is an initial step before starting the inventory. This considers the structure of the warehouse, its features, the number of drones, and the parameters of the drones. In the second step, based on the routes obtained in the ﬁrst step, the real-time movement of the drones was controlled during processing, including camera movement and image recording. The third step is post-processing, i.e., processing the images for QR code identiﬁcation, interpreting the QR code, and recognizing empty compartments for inventory control. A major advantage for users of the solution method is that the result can be achieved automatically without an external orientation device, relying solely on its own movement and the organization of a pre-planned route. The proposed model and solution method are suitable not only for inventory control, but also for solving other problems matching the model.


Introduction
The traceability of a company's products and inventory is now a fundamental factor in a company's daily operation.In this regard, inventory management is extremely important, as each item in inventory represents part of the value of the business, and it is important for managers to know the value of the items in the corporate organization they lead.Thus, from a strategic point of view, it is very important to introduce the correct practices of stock management, so that the logistics managers of the company know and are able to manage the material flow processes of the organization.Certain tasks of stock management require high levels of human resources (inventory, order picking, etc.) [1]; therefore the training of specialists cannot be neglected, with a special focus on the development of computer thinking [2].
Drones are a breakthrough technology in warehouse inventory management as they enable real-time, fast, and accurate inventory records while minimizing operational costs for supply chain stakeholders.From a sustainability perspective, drones socially minimize the risk of human injury in the facility.From an environmental perspective they use environmentally friendly devices, i.e., rechargeable batteries, to navigate the facility layout and execute the daily operational schedule.From an economic perspective, to enable nearcontinuous inventory control and optimize operational decision-making, they minimize labor costs and operational downtime related to inventory [3].Drone-enabled supply chain solutions are based on first mile and last mile delivery.Their efficiency significantly affects the total operating cost.Drone technologies also enable the improvement of first mile Drones 2022, 6, 364 2 of 28 delivery and last mile operations, but the design and optimization of these solutions mean new challenges [4].Drone-based material handling is becoming increasingly important today, as advances in technology and increasingly sophisticated regulation allow drone transport to be used in more and more areas of practice.The deployment of drone systems requires a number of planning tasks that require rethinking logistics tasks such as route planning, scheduling, and resource allocation [5,6].
Drones can help the industry-in addition to the previous ones-perform tasks that can be automated and monotonous, such as maintaining product traceability.Therefore, the system uses a distributed ledger to store, to validate, and ensure the reliability of inventory data collected by drones and make it available to interested parties [7].In order to demonstrate the performance of the system proposed by the authors of [8], various tests were carried out in a real industrial warehouse, with the following conclusion: the system is able to obtain inventory data very quickly compared with traditional manual tasks, while it is able to estimate the position of the items thanks to the signal strength of the tags when the drone hovers over the elements.
In this article, we presented a mathematical model and procedure not encountered in our literature review.The model and method describe the inventory of a GPS-inaccessible high warehouse with multiple drones using QR code for a multi-user warehouse.The complexity of the problem is discussed later in this paper.

Literature Review
Inventory work is an important link in the invoicing system of industrial enterprises.Considering the current shortcomings of manual inventory work, such as low efficiency and potential for error, technology has emerged in recent years that has allowed drones to be equipped with high-precision portable radio-frequency identification readers for inventory, and the key issue is route planning.In order to reduce energy consumption and improve inventory efficiency, the lowest energy efficiency ratio and time efficiency ratio were taken as the objective to construct the objective function, and the corresponding mathematical model of UAV route planning is established in literature [9].In the model given by ref. [9], a hybrid differential evolution (DE) algorithm based on the life-cycle swarm optimization (LSO) algorithm was proposed.The actual environmental data of a tobacco company's raw material and auxiliary warehouse were used for the physical modeling, and the simulation experiment was performed using the proposed intelligent optimization algorithm.In the same environment, compared with the other three leading path planning algorithms, the experimental results showed that the path planned by the proposed algorithm can effectively improve the efficiency of UAV storage.
During the inventory, an important issue is raised: the access route.Nowadays, many articles deal with drone routing, which is closely related to solving the inventory problem.During our literature research, different methods were used for drone route planning.Many articles deal with route planning based on a two-dimensional environment, which is not suitable for practical application, since our shelving system requires spatial route planning.These two-dimensional solutions provide a suitable solution mostly for agricultural problems and patrol and monitoring tasks.The following algorithms are most often used by researchers during route planning suitable for inventory: the traditional squid algorithm [10]; the genetic algorithm [11,12]; the rapidly expanding random tree algorithm [13,14]; the traditional particle swarm optimization algorithm (PSO); the ant colony algorithm [15,16]; and deep neural networks [17,18].Most of the research only uses the shortest flight path [19] or the least energy consumption [20] to generate the singleobjective optimization model, and further uses the convex approximation strategy [21] to calculate the route.These solutions can be used from a practical point of view, as examined in this study.However, our target function was a max-min time function, which does not allow the direct application of the specified methods.
The key to drone routing and effective inventory is for the drone to carry a highprecision, portable, radio-frequency identification (RFID) reader to perform an inventory task according to ref. [22].Based on a quadrotor drone, they proposed a route-planning method that uses a drone equipped with an RFID reader to carry out inventory of industrial product warehouses.Since the particle swarm optimization algorithm (PSO) tends to converge prematurely when solving routing problems and tends to fall into local optima (which, according to our experience [23], often happens), PSO is improved and a differential evolution based a repair method is suggested.The fitness-adaptive differential evolution algorithm (FiADE) and PSO were mixed (used previously [24,25]) and further developed for further application in three-dimensional space.The final simulation results showed that the improved PSO-based hybrid suitability DE algorithm (PSO-DE) has higher uniformity than the DE, PSO, and whale optimization algorithms (WOA), and is more suitable for drone route planning in complex industrial warehouses.
In order to solve the inventory task, it is necessary to examine which drones are suitable for performing the task.Our previous investigations [23] showed that autonomous drones are needed for the task.For a drone to be fully autonomous, the ability to localize is very essential.Adequate accuracy is usually achieved by using several sources of positional information.During the research [26], two sources of information were used:

•
The Intel RealSense T265 tracking camera to calculate continuous visual odometry, and The RGB sensor combined with the ArUco reference indicators to minimize the accumulated error during visual odometry.
These markers have their mistakes.A variance filter was successfully implemented and evaluated to minimize the error caused by ArUco markers.The entire system was tested several times on a drone that can fly autonomously in an indoor environment.Furthermore, all processes required for such localization ran smoothly on the Nvidia Jetson Nano computer mounted directly on the drone during flight.All these results proved to be a very strong foundation for an autonomous drone that can perform warehouse inventory in an indoor environment, all without human intervention.
According to the literature [27], the goal of introducing an unmanned aerial vehicle stem UAV (drone) in a warehouse is to reduce operation times and eliminate human labor in repetitive, simple tasks.One such area is the inventory process, which are several information carriers (QR codes (Quick Response), barcodes, or RFID tags) on the goods in the warehouse.This process is particularly labor-intensive in large, high-shelf warehouses where thousands of products are stored.Not every business needs a daily inventory requirement.Most warehouses perform this process periodically (monthly, quarterly, etc.).However, such an inventory is always a challenge, as the warehouse operations must be suspended and the entire warehouse staff must be involved in the inventory process, which is a loss for the company.Because of this, there is a growing need to automate this process to reduce time and reduce human error.
In ref. [28], multi-sensor accuracy was investigated for 3D indoor positional accuracy using the OASE flexible sensor fusion platform.This evaluation was based on real drone flights in an industrial laboratory using mm-accurate measurements provided by motion capture cameras, allowing sensors to be evaluated based on their deviation in 2D and 3D.The research investigated the following sensors: IMU, sonar, SLAM camera, ArUco markers, and Ultra-Wideband (UWB) positioning with up to six anchors.The paper demonstrated that the achievable 2D (3D) indoor localization error varied from 4.4 cm to 21 cm (4.9 cm to 67.2 cm) depending on the sensor set selected.Furthermore, cost/accuracy trade-offs were defined to indicate the relative importance of different sensor combinations depending on the (technical) budget and use case.These laboratory results were validated during a "Proof of Concept" installation of an inventory drone in a 65,000 m 2 warehouse with more than 10 flight hours.By combining laboratory results and real-world deployment experience, different subsets of sensors were presented as minimally feasible solutions for three different indoor use cases, considering accuracy and cost: a large drone with low weight and cost constraints, one or more medium-sized drones, and a weight, and a swarm of cost-constrained nanodrones.This is a valuable study.The GPS positioning system cannot be used in the warehouse we are examining, so the routes must be determined in advance.Based on the results of the study, we have to make sure that if the drone flies in the middle of the aisle, i.e., it cannot collide with the shelf system due to the inaccuracy of the sensors.Of course, a certain flight distance requires the drone to be calibrated and directed to a given optimal position.
One of the biggest challenges for indoor drone applications is navigation and obstacle avoidance.Due to indoor operations, the global positioning system is not capable of accurate localization and navigation.To solve this problem, ref. [29] presented a system that facilitates the autonomous navigation of drones with cameras in the interior aisles of a building by processing images based on deep neural networks.For a deep neural network, choosing a good combination of hyper-parameters for better prediction is a complicated task.In the mentioned article, the tuning of the hyper-parameters of a convolutional neural network was implemented using genetic algorithms.The proposed architecture (DCNN-GA) was compared with state-of-the-art ImageNet models.The experimental results showed minimal loss and high performance of the proposed algorithm.Similar results were obtained by De Falco in ref. [30].In their article, they proposed an approach based on the use of unmanned aerial vehicles for warehouse scanning and the use of regionbased convolutional neural network (R-CNN) for autonomous inventory activities.The experimental results obtained from the video recordings of the real warehouse environment proved the feasibility of the proposed solution and the possible scope for development.
There are also other approaches for path planning and optimization, such as that presented Nguyen et al. in ref. [31], who combined fuzzy logic and ANFIS approaches for optimization.The optimization of Wang et al. followed an artificial intelligence algorithmic approach [32].
To automate inventory management in a large warehouse, a drone-mounted camera scans a pre-displayed ground QR code to reveal the route.The drone runs along the navigated route and manages the inventory of the warehouse by scanning the barcode or QR code attached to the product.However, unlike warehouses, which have well-defined grids or shelves, the location of products in a yard is not fixed, but flexible.Thus, for effective inventory management in a warehouse, the position of the QR codes attached to the product must also be estimated.Yoons [33] proposed a position estimation method for drones and products based on the segmentation model of QR codes in their research.The segmentation model was used to recognize the region of the QR code with perspective distortion caused by the angle difference between the camera and the QR code.After that, the detected QR code region was rectified and decoded to determine whether it is a terrestrial QR code, and the position of the drone was estimated.Finally, the 3D coordinates of the QR code attached to the product, rather than the QR code on the ground, were calculated from the images taken by the drones from two different viewpoints.Consequently, the 3D position coordinates of the drones and the QR codes attached to the products were estimated using the QR codes on the ground, and thus effective inventory management was realized in the warehouse.In our case, we worked with a complex warehouse structure, unlike ref. [23].The structure of the warehouse can be recognized with a preliminary structure recognition algorithm using the previous ones.This is, however, beyond the scope of this article.
Kessler, in ref. [34], presented an approach for the automation of stock inventory using a drone equipped with a camera and various artificial intelligence procedures.This avoids the use of sensor technology such as RFID, and only visual display of products and goods was used.A unique data set was developed and used to train an object-recognition model to extract and count all relevant objects based on an image of the warehouse.It was shown that different pre-processing steps and especially image enhancement methods can significantly affect the performance of such models.
Several specialized studies deal with solutions that use RFID technology during the inventory process [1,8,[35][36][37].Others use barcodes to automatically identify data as a solution for drone inventory [38,39].
A model that uses an omnidirectional drone capable of moving in all directions for imaging and transmission was presented in ref. [23].The proposed model includes three steps.In the first step, an optimal solution for determining a transit route was provided.This is consistent with the structure and capabilities of the warehouse.In the second step, the real-time movement of the drone was determined during processing, including camera movements and image capture.The third step is post-processing, i.e., processing the images for QR code identification, QR code interpretation, and checking matches and discrepancies for inventory control.A key advantage is that the result can be achieved without external orientation devices, relying solely on its own movement and the organization of the pre-planned route.The proposed model can be effective not only in inventory control, but also in revealing the structure of a warehouse shelf system and determining empty compartments.The article presented the model and solution method for traversing shelf systems with fixed positions using a drone.The solution we outlined is a significant further development of the model presented in ref. [23].At the end of the Artificial Intelligence (GA) solution used in ref. [23], it is advisable to carry out tests such as those in ref. [40].
Shape recognition is a useful tool for many engineering tasks, such as structural inspection, traffic monitoring, or even QR code recognition.A new shape recognition technique was proposed for the recognition of shapes based on their contours, which can be used for fast processing of drone images.The image was first segmented into regions, then the contours were analyzed, and shape descriptors were built, which were used as inputs to the classifier.Simplified sequential fuzzy indexing tables were used for pattern recognition, so that very fast and robust inferences could be made [41][42][43].

Materials and Methods
In the large, lightweight warehouses of logistics centers, especially those where different products of several companies are stored, it is often difficult to determine the exact location of the stored goods.This mainly occurs if the storage is not carried out with an automatic forklift or when, due to a mistake, an error occurs in the registered and actual location of the goods during picking and put away.To make matters worse, it is very difficult or in some cases impossible to use GPS-based identification in these warehouses.If time-of-flight (ToF) cameras are not available, automatic device positioning is not possible.In this study, a model was presented that can update the stock register with a drone, and that can be generally applied to different warehouse structures.
Storage (loading and unloading), order picking, unit load design, and labeling take place in the warehouse building.A double shelving system is used in the warehouse.Between the double shelves, there is a wide aisle where the drone can travel.A shelf system is divided into rows or compartments.One, two, or three spaces can be created in one compartment (see Figure 1).All units stored in these locations were identified with a QR code that contains all the important data for their management.A mid-range drone and its camera can take a high-quality image from th the aisle (in the model to be described later, the drone was always set in the m compartment), and the blue and red colors used on the shelves help to identif goods in the image.At the end of the aisle, the docking station was placed where the battery could be charged and replaced.However, its position must exactly for each drone (see Table 1 parameter  =   ,  ,  ).A mid-range drone and its camera can take a high-quality image from the middle of the aisle (in the model to be described later, the drone was always set in the middle of the compartment), and the blue and red colors used on the shelves help to identify the stored goods in the image.At the end of the aisle, the docking station was placed manually, where the battery could be charged and replaced.However, its position must be specified exactly for each drone (see Table 1 Table 1.Basic data of the warehouse and the drone.

Data (Warehouse)
Description w = w w x , w y the size of the warehouse (in meters).
This indicates the compartment located in the i-th row and the j-th column of the two opposite shelf systems of the k-th aisle (k = 1; 2; . . .; r).Among the opposite shelving systems, the numbering starts with the first column of the left-hand shelving system in the case of columns, and then continues the numbering from the front (from 1) with the first column of the right-hand shelving system.β = 0, if left-hand shelf system and β = 1 if right-hand shelf system.This is a determining parameter due to the rotation of the camera.
Function specifying the vertical distance between the compartments (calculated from given data).

h h
The width of the compartment (in meters).

h d
The depth of the compartment (in meters).
h w the width of the aisle (in meters).

h c
The width of the road (charging aisle) (in meters).

h g
The required height difference of the drones when the drone is on the changing aisle (in meters).

h b
The height of the b-th drone when changing aisle (aisle change height, in meters).
The number of the compartments within a column (within the j-th column of the k-th aisle, β side).This and the height of the compartments ensure that shelf systems of different heights can be managed together. m The number of all compartments ( m The number of compartments within the rows.They can also be split, with different heights. The number of aisles (the number of shelf systems is equal to twice the number of aisles).
P l = P l p lx , p ly , 0 P l The shelf system's position.If l is odd, it means the left shelf system of the aisle (β = 0); if it is even, it means the right shelf system (β = 1).
The starting position of the drones in the aisle between the two shelving systems (viewed from the side of the main entrance).
. Each drone will have a starting position at a different height to avoid collision.C kb can be calculated from the basic data.
The end position of the aisle between the two shelves.
C kb can be calculated from the basic data.

Date (drone) Description
g the number of drones

Data (Warehouse) Description
The position of the docking station of the b-th drone's.d bz = 0.

T w
The operating time of the drone when fully charged.During this time, the drone must proceed from the charger to the compartments and back.

T PH
The photo shooting time.

V h
The horizontal travel speed.The maximum travel speed is 16 m/s, but in practice it can be set at 10 m/s.

V a
The rate of rise.

V d
The rate of descent.

V r
The rotation speed (estimated).
∆t This indicates the operating time that must be less than when arriving at the charger, in case of intermediate charging.

T ch
The charging time.
In the warehouse, processing with several drones at the same time can be carried out.In this case, each drone would work independently.However, each aisle can only be processed by one drone, i.e., two different compartments of an aisle cannot be processed by two different drones in the same processing cycle.In addition, to avoid collisions, the drones travel between aisles at different heights.The operation process for one drone is described below, which is applicable for all drones.As they are working simultaneously, the pre-processing system must handle all the drones participating in the processing at the same time.

The Course of the Processing
Moving along the aisle, the drone looks for the compartments and takes a photo of each compartment, which is sent to a pre-processing device (in our study, this was a high-capacity tablet) where the pre-processing application runs.During the pre-processing, the first test checked the quality of the image (in terms of brightness, sharpness, distracting factors).The drone did not change its position until the pre-processing application instructed it to do so.If the picture quality was not good enough, the pre-processing application took another picture with the drone.If the picture was good quality, the drone continued its journey.During the image processing, a proper QR code was being checked.If the QR code was appropriate, its content was read out.If successful, it sent the content of the QR code to the central application and set the processing status to 'successful'.If it was not successful, it sets the bin's processing status to 'failed'.If a QR code was not found, an empty compartment comment was entered (of course, this does not mean that the compartment is empty in all cases; however, the central application decided whether it is empty or due to incorrect processing).In this case, it always sent the drone to the next compartment.Further processing always took place in the central application and depended solely on the capabilities of the central application.The description of the processes taking place here is beyond the scope of this study.
After processing each compartment, the pre-processing application sent the position of the compartment (see Table 1 R k = R k (i, j, β) values), the processing status, and the data in the QR code to the central application.
According to the model, a pre-processing system was proposed that knows the location of the drone in the warehouse exactly, i.e., the 3D data inside the warehouse are defined.This and the QR code sent can tell the inventory management model exactly where the product is located or if the location is empty.
The pre-processing application also includes the previously determined optimal routes for each drone, which are primarily optimized for the drones' operating time, including the charging time in case the drones run out of power.
Based on the above, the processing consists of three main steps (Figure 2).
cording to the shortest processing time.This is created by the central application and to the pre-processing application.
Step 2: (runtime processing in the pre-processing application) controlling the dr along the specified optimal paths to the compartments, taking the photos.
Step 3: (post-processing) to perform the pre-processing (photo processing) for next step of the drone.
Based on the literature review, we did not come across an approach like our inventory registration; therefore, it can be declared that our proposed method fo ventory can be considered a research-based new development in the ongoing debate studies in this field.Step 1: (initial step before running) determining the optimal route of the drones according to the shortest processing time.This is created by the central application and sent to the pre-processing application.
Step 2: (runtime processing in the pre-processing application) controlling the drones along the specified optimal paths to the compartments, taking the photos.
Step 3: (post-processing) to perform the pre-processing (photo processing) for the next step of the drone.
Based on the literature review, we did not come across an approach like ours for inventory registration; therefore, it can be declared that our proposed method for inventory can be considered a research-based new development in the ongoing debate and studies in this field.
Research questions Our study was based on the following research questions: • How can the stock inventory be managed with drone automation?

•
Can the inventory process with drones be modeled mathematically?

•
How can the stock inventory check be optimized with drones?
Drones 2022, 6, 364 9 of 28 Regarding the first step, a mathematical model and algorithm was developed that accurately answers the abovementioned questions; in this way, a usable method for processing automated warehouse stocking was developed.
The solution method of Step 2, as the result of the first step is known, was already described in this chapter; it must be programmed in the pre-processing application based on what is described.
The first step in model creation is to clarify the markings and their content; therefore, full parameter exploration was performed.The dataset was defined with the help of practical experts.The basic data collected were grouped according to their role in the model.Then, after selecting the necessary parameters, it is important to fix the dimensions.In the second step, the mathematical model of the warehouse and the factory parameters of the drones to be used were prepared and supplemented with variable data.A manageable simplified movement and speed model was created (the simplification was carried out within reasonable limits).The next step is to develop a practical positioning strategy.After that, the elements and environment required for optimization were selected.
During the GA method testing, inconsistencies arose that caused the model to be subjected to several manual tunings (the main reason is the difference between factory and real drone parameters and not necessarily smooth movement, which could be due to several reasons, such as temperature and stock saturation issues).These contradictions, since they required relatively small modifications, can be easily eliminated.
In summary, in this section, the following necessary elements were found to help specify the method for creating the model:

Basic Concepts
Compartment: a well-defined storage area on all sides, in which one or more goods or unit loads can be stored at the same time.The compartment has its own identifier.The compartment is rectangular.
Shelf system: a set of interconnected compartments used for storage, which are also connected to each other in their physical structure.In shelf systems, the compartments located above each other have the same width and depth.Their heights can vary, but the shelf system is rectangular.
Aisle: refers to roads suitable for transport between shelf systems.They can be two-way or one-way.
Charging aisle: the main road where the drone is located.Main entrance: the place where the inventory starts and also ends.Docking station charger: the non-operational location of the drone where the drone is charged.

The Known Data
In this section, known data related to the mathematical model are provided.The known data are the most important parameters of the warehouse and the drone: these are specifically provided by the storage company; the parameters of the drones are included in the technical description.The following tables summarize the data used for the model and provide the notations.Each index was used consistently for the same data, and an index table is also provided.

Agreements
In some warehouses, there is only one-way traffic in the aisles.One may enter one of the aisles and come back in the aisle(s) next to it.The following restriction does not constitute an actual restriction, but is for the sake of convenient handling.One can always enter from the side of the main entrance in case of an odd number of aisles and can come back on the even-numbered ones.
The selection of the main entrance is also arbitrary, but this does not affect the course of the solution either since the other side of the shelf systems is treated similarly.The main entrance was fixed from the point of view of the docking stations.The main entrance is where the docking stations were located.If there was a docking station on both sides, we could choose based on the floor plan, usage practice, or freely.
All drones took off at the same time.If this was not the case, but each drone started at a time different from the start time, then a time variable ∆t b could be assigned to each drone, which shows the time elapsed from the start of the inventory to the start of the drone.By adding this to T f (see later), we obtained the time used by the given drone from the beginning of the inventory to the end of the processing.This does not affect the algorithm described below; in addition, this case occurs very rarely in practice, and due to the abovementioned reasons, this parameter can be omitted without restricting the generality.
The next table shows the indexes (Table 2).

Indexes Description
k, k 1 the serial number of the aisle.
i, i 1 , represents the rows of the shelf system.j, j 1 , represents the columns of the shelf system.
β, β 1 position of the shelf system (left or right).The following figures (Figures 3-5) show the structure and parameters of the warehouse to be modeled.

Variable Data
In this section, variable data are provided related to the mathematical model.Denote by  the number of all bins, i.e., formally let  denote the number of compartments to be processed by the -th drone:

Variable Data
In this section, variable data are provided related to the mathematical model.Denote by  the number of all bins, i.e., formally let  denote the number of compartments to be processed by the -th drone:

Variable Data
In this section, variable data are provided related to the mathematical model.Denote by m the number of all bins, i.e., formally let mb denote the number of compartments to be processed by the b-th drone: For every drone, we need a sequence of compartments, where S b is belonging to all drones k l 1 i l All drones visited all compartments of all shelving systems while working.The compartment series S b describes the sequence of these compartments visited by a drone, where the first parameter is the number of the shelf system, the other two are the number of shelves in the shelf system and the number of compartments within it, and the last one is whether it is examining the left or right shelf system of the aisle.
The next table shows the variable data (Table 3).The sequence number of the processing (as the drones move between each compartment).The S b -s belonging to each drone can be built from this.
The execution time of visiting the sequence of compartments S b .
The Śb subseries execution time without charging.
The travel time from the docking station to the i p , j p , β starting point.
t R k (i q ,j q ,β q ),T The travel time from the point i q , j q , β q to the docking station.
The travel time from one compartment of a aisle to another compartment of the aisle.
The time from one compartment of one aisle to the compartment of the other aisle with a change at the beginning of the aisle.
The time from one compartment of one aisle to the compartment of the other aisle with a change at the end of the aisle.

p b
The number of charges of the b-th drone-1.

mb
The number of compartments to be processed by the b-th drone.
Note: in the following, the b-th drone is always being examined in general, but all other drones can be described similarly.
The drones need to be charged from time to time.They may not be able to process the compartments assigned to them in one charge.For this reason, the compartment series of S b of the b-th drone must be broken down into parts that can be processed with one charge, i.e., it contains the compartments processed during the operating time.Thus, the processing time consists of three parts:

•
The drone moves to the first compartment to be processed,

•
Returns to the docking station.
The drone returns to the docking station when it comes to a compartment in which the available operating time for the previous compartment is still greater than ∆t, but in the case of the current compartment it is already less, i.e., the operating time falls below a critical level.In addition, the individual subchains must output the entire chain, since each compartment must be examined in the order of S b .
Let us denote the series of compartment tests carried out in one aisle at a time Sb = Sb k p i p j p β p , . . ., k q i q j q β q ⊂ S b (q ≥ p) if a shelf system needs to be changed, it is changed either in the direction of C or C during the change.Denote in Sb G the aisle change, i.e., The division above is important during the practical examination.When solving the problem related to the model, the compartments examined during one charge is treated in a uniform manner; based on this, the time of Śb is also included in the compartment change, so Sbi is not needed in the calculations from now on.At the same time, if the optimal solution is given, it is necessary to know in which direction we are switching.Sbi must be entered here.Then, the execution time of the sequence Śb is from charger to charger if it is true 0 Let where every Śbu 0 ≤ T w − T f Śbu ≤ ∆t (u = 1, . . ., p − 1).(10) This condition no longer has to be met for the last one.
The final access list should include a flight to the docking station.For this reason, S b must be supplemented with the charging of the drone D in the appropriate places.The location of this is determined by the later algorithm (algorithm for generating objective function).The function T f Śbu represents the operating time of the journey of each partial series from the docking station through processing to the docking station.The sum of these yields the total operating time.T f Śbu is defined below.
Then, the goal is to minimize the processing time of the drone with the longest processing time.This also results in an even distribution of work between the drones: If T is minimal, then S bv is the optimal route.This is the objective function of the mathematical model.

The Speed of the Drone
The speed of AS drone is determined by knowing its horizontal travel speed and its vertical travel speed by projecting it onto the diagonal path.The red arrow indicates the velocity as a vector and its magnitude is the magnitude of the current velocity.
Height function Let h s denote the height difference between compartments R k (i 1 , j 1 β 1 ) and R k (i 2 , j 2 β 2 ) within the same shelf system: If i 1 < 0, then −i 1 shows the serial number of the drone.In this case, we consider the aisle-change height of drone −i 1 during the calculation: Drones 2022, 6, 364 14 of 28 if i 2 < 0, then −i 2 shows the serial number of the drone.In this case, we consider the aisle-change height of drone −i 2 during the calculation: More cases do not occur in practice.Let x denote the horizontally mapped path of the drone's path and y the vertically mapped path of the drone's path (Figure 6).More cases do not occur in practice.
Let  denote the horizontally mapped path of the drone's path and mapped path of the drone's path (Figure 6).When moving upwards When moving down It follows that the speed of the drone when moving up: It follows that the speed of the drone when moving down: Based on these y ≥ 0 and x = 0 then V 2 (x, y) y < 0 and x = 0 then V 1 (x, y) y ≥ 0 and x = 0 then V a y < 0 and x = 0 then V d (21) It depends on the lengths of the road to be covered in the horizontal and vertical direction.

The Length and Time of Each Route
The drone starts all processing by being positioned in the middle of the two shelf systems in the green square position shown in Figure 2 (C kb ).This means the center of the bottom row (it can be modified if necessary).The drone can take the best shot from the center of the compartments.This is confirmed by practical tests.The abovementioned periods are detailed in this section (Figure 7).

•
The drone moves to the first compartment to be processed, • Processes the QR codes of the compartments,

•
Returns to the docking station.
systems in the green square position shown in Figure 2 ( ) bottom row (it can be modified if necessary).The drone ca center of the compartments.This is confirmed by practica periods are detailed in this section (Figure 7).

•
The drone moves to the first compartment to be proces • Processes the QR codes of the compartments, • Returns to the docking station.Then, it moves from here to the first compartment to be III.
Then, it rotates the camera in the appropriate direction.Then, it moves from here to the first compartment to be processed, III.
Then, it rotates the camera in the appropriate direction.
=  (, , ) is the compartment access time from the docking station: is the compartment distance from the docking station: R k = R k (i, j, β) is the compartment access time from the docking station: where d T,C k is the path between the docking station and the starting position of the middle guide path between the two shelves to the green square (in the case of the f -th shelf system, where h h 2 is added because it always stands in the middle of the starting compartment): t T,C f is the time required to reach the starting position of the middle guideway between the docking station and the two shelves: II. Distance and time from the center to the starting compartment: III.The camera 90 V r is the camera rotation time.Travel time to the starting position:

.2. The Time to Reach the Docking Station from a Given Point Can Be Determined Similarly
This way is the reverse, since we

•
Rotate the camera to the starting position,

•
Move to the starting point of the shelf system according to the given drone,

A Path between Two Compartments within the Same Aisle
The path and time between the next two compartments in the processing line were determined (this is not affected by the fact that the two compartments were opposite to each other).For the time being, it is enough to calculate the speed and divide the distance by this to obtain the time.In addition, the camera could be rotated if necessary (by 180 • ).The rotation of the camera as needed was controlled by the β value of the two apertures.The time for photography was added at the end (Figure 9).

A Path between Two Compartments within the Same Aisle
The path and time between the next two compartments in the processing determined (this is not affected by the fact that the two compartments were o each other).For the time being, it is enough to calculate the speed and divide th by this to obtain the time.In addition, the camera could be rotated if necessary The rotation of the camera as needed was controlled by the  value of the two The time for photography was added at the end (Figure 9).Let (k v i v j v ), (k v+1 i v+1 j v+1 ) to be two points, where k v = k v+1 .Their distance is: Time spent by the drone on this route: where is the camera rotation (i.e., it only rotates when the two apertures are on opposite sides).

From One Compartment of One Row to Another Compartment of Another Row
In this subsection, the path and processing time of the two consecutive compartments to be processed, which are located in different rows, are given (Figure 10).

•
The drone rotates the camera to the starting position and moves to the start or end point of the shelf system according to the drone performing the processing (C, or C) at the given aisle height,

•
Then, it moves to the start or end point (C, vagy C) of the next shelf system to be tested according to the drone at the given aisle height.

•
Then, it returns to the starting slot of the row.

•
The drone rotates the camera to the starting position and moves to the start or point of the shelf system according to the drone performing the processing (,o at the given aisle height, • Then, it moves to the start or end point (,vagy  ̅ ) of the next shelf system t tested according to the drone at the given aisle height.

•
Then, it returns to the starting slot of the row.This ensures that aisles can be changed at both ends of the shelving system.To change aisles, the drone must move from the start or end point of the shelf tem to the middle of the aisle.This is given by .Let us denote This ensures that aisles can be changed at both ends of the shelving system.To change aisles, the drone must move from the start or end point of the shelf system to the middle of the aisle.This is given by h V(a(j 1 )•h h ,h s (k 1 ,i 1 ,j 1 ,β 1 ,−b,a(j 1 ),β 1 )) + 90 Similarly to the optimal path, we calculate Two cases occur: (a) The case of progress without direction (b) Aisle change in the case of one-way traffic Several warehouses have one-way traffic.The direction of travel is the opposite in odd-numbered and even-numbered aisles.Then

•
if k 1 is odd, then k 2 is even and the point of change is C and t R k Considering that there may be two compartments to be examined one after the other within an aisle or between different aisles, the t P function can be of two types, of which only the current one is always included: The Śbu 's subsequent (dockless) execution time

The Constraints
Based on the abovementioned, the sum of the compartment-order variables is exactly the sum of the number of cells from 0 to 1 (starting with 0) according to the number of cells.
During the condition set of the model, we must ensure four plus two conditions: 1.
All compartment serial numbers must be different (this should only be carried out for compartments belonging to a drone, but from the point of view of the solution, it is easier to handle it this way, and at the same time, it does not affect the final result).

2.
The sequence numbers should include all values starting from 0 up to all compartment numbers (i.e., the sequence numbers should increase one by one).

3.
Each compartment must be assigned to exactly one drone.4.
Only one drone can process an aisle.
Note.In the case of one-way traffic when changing aisles, two additional conditions apply:

5.
For each drone, the first compartment to be processed can be in an odd-numbered aisle.6.
In the event of changing aisles during processing, the sequence numbers of the two aisles must have different parities.
The first and third conditions can be specified as group conditions directly in the software in which the problem is run.
Condition 1 and condition 2 x kijβ cannot be negative (because it is a traversal sequence); for this reason, 0 ≤ x kijβ .
The value of x kij can be clearly limited from the above as follows: Each number must be different if different compartments are being examined, as follows:

Condition 3
The condition for assigning drones to compartments is calculated as follows: i.e., the processing of each compartment belongs to exactly one drone.Condition 4 Two drones cannot be in the same aisle at the same inventory, so Condition 5 and condition 6 Aisles change in case of one-way traffic In some warehouses, for safety reasons, the aisle between each shelving system can only be used in one direction.Usually, two adjacent aisles are reversed so that at the end of the aisle one can return down the aisle immediately adjacent to it.This implies that every second corridor has the same direction of travel, so we can assume that the direction of travel in even-numbered and odd-numbered corridors is the same.
For this, the model must be supplemented with new conditions.Let be a set ordered in increasing value according to x kijβ (it has significance from the implementation side, not in the model).Then, the starting condition is that each drone can only start in an odd aisle (due to condition 1).The restriction of changing aisles appears when calculating T f Śbu ; therefore: mod kb , 2 = 1, where x kb îb ĵb βb = min The second condition is as follows: if it is true, then The latter means indicates if the aisle numbers of the two compartments to be processed consecutively are not equal, the direction of the aisle of the first compartment to be processed must be opposite to the direction of the corridor of the next compartment.

Solution Method of the Task Related to the Model
The computational model can be further simplified if solution is no longer affected by these steps.

Results and Discussion
Before applying the method to real warehouses, the usability of the model and the solution algorithm for a simplified, but real warehouse was examined.A drone was used during the investigation.The structure of the specific warehouse is as follows (Figures 11  and 12):

Results and Discussion
Before applying the method to real warehouses, the usability of the model and the solution algorithm for a simplified, but real warehouse was examined.A drone was used during the investigation.The structure of the specific warehouse is as follows (Figures 11  and 12):   We ran the MatLab application supplemented with the algorithms given in the previous chapter with the following data (Table 4).

Data of the drone
The results are as follows: 1.The total number of possible cases was 11,780, which means a lot of cases, and that is why we chose a solution and control method that, if possible, quickly finds a good solution.It seems that a longer running time is needed, since in this special case the chromosome contains 11,780 genes.For this reason, the population has to be increased.
With the introduction of the variable mtp, the search for possible solutions has become easier, since the sequence numbers can not only be narrowly selected from the values 1, . . ., r• m•n, but from 1, . . ., mtp•r• m•n.However, this requires a conversion routine, which at the end of the run converts the received vector x back into serial numbers.

2.
The algorithm was tested with several speed values.It is obvious that, in the case of the current warehouse structure, (h e = 2.1, h h = 4); then, if the walk-in is carried out aisle by aisle, processing the compartments of the bottom row.Otherwise, the drone's program will use column traversal, also starting from the bottom row.It is also concluded that the examination of the opposite compartments was carried out in sequence.

3.
If (78) does not hold, then the genetic algorithm does not always provide a clear result.
All the obtained results were close to the optimal value; however, the traversal was not carried out regularly as described above, but-in some cases-with randomly chosen compartments.It produces different results when run several times under the same conditions and parameters.For this reason, the parameters must be examined more closely and adjusted accordingly.Fortunately, this did not happenin practice with the examined drones.4.
In our specific case, condition (79) was fulfilled, so according to the solution, if the docking station is in front of the first aisle, then the shelf system close to the docking station starts processing with a pair, moves towards the end and turns back at the last shelf system.It was confirmed during the run that if the drone starts with a full charge (which is always the case in practice), then it does not need to be charged at the given warehouse on the way with this visit.

5.
The situation was similar when taking pictures.If the rotation speed of the camera was shorter than the speed of movement (horizontal, vertical) between the compartments (79), then the opposite compartments were photographed first; if not, then a shelf system was photographed first, and then the opposite shelf system was photographed afterwards.6.
During the test, several different docking positions were tested.The situation is not more complicated in these cases either.Even in this case, the drone started at the first shelf system.In this case, it depends on which end aisle the docking station is located, since the drone started with the first compartment of the first shelf system closest to the aisle.7.
It was confirmed that the model describes the practical problem well and is suitable for the general investigation of the problem.The solution method is a bit uncertain, but if condition (78) is fulfilled, it solves the task well and returns the inventory program in the shortest time.8.
In the future, we will continue to investigate possible solutions to see whether a more stable, less sensitive solution method can be found.
In this study, the authors developed a new model for the automatic inventory of large warehouses using drones.By examining several warehouses, the authors formulated a general mathematical model to describe the problem.In addition, the algorithms for solving the problem related to the model were given, thus enabling the practical application of the obtained results.At the same time, the effect of the drone setup in solving warehouse tasks was examined.This model and the solution of the related task enable the description of the impact of automatic warehouse processing with the help of drones on sustainability aspects, especially with regards to energy consumption.
The main added value of the article is that it showed that the problem can be modeled mathematically and thus, in general, the problem can be solved using this model.An additional added value is the findings that the use of drones has a significant impact on the automation, speed, and energy efficiency of warehouse processing, while considering all the task-relevant constraints associated with warehouses.
The scientific contribution of this article for researchers in the field of the use of drones in the case of warehouse processes is the mapping of the main elements of the problem, the generalization of previously examined elements in practice, the mathematical model of the new, unique approach, and the time functions that specify the optimal route of processing, as well as the solving algorithm and the related auxiliary algorithms.The new results also confirm the important basic hypothesis that the problem can be solved.
The results of this study can be generalized, since several elements were incorporated into the model (e.g., the use of several drones, with different start times, if necessary different shelves, one-way, multi-way traffic) that do not necessarily occur in specific warehouses, or only a part of them, as well as for all similar systems (which are not necessarily warehouses), allowing the model and solution to be applied in contexts in which our concepts and definitions fit.It follows that the optimal processing routes and management of steps can be used or applied to various other types of drone-based services.
The results of the research can help managerial decisions, as the described method enables the analysis of individual processes of automatic warehouse management and the support of strategic decisions by examining various parameters.In this way, a warehouse management mechanism can be selected that best serves the set logistics goals.
The limitations of the model include automatic handling of faulty aperture processing (imaging).Although this occurs in a very small percentage of cases, handling the issue provides further research opportunities.In addition, the stability of the solving method also raises questions (according to the first approach, it seems to be very parameter sensitive), so it is worth performing a sensitivity test and improving it with further research.It is also worth examining a wider range of solution methods, possibly making the solution algorithm more stable by combining it with other, newer methods.

Conclusions
In this paper, we presented a mathematical model and a solution method for a multiuser warehouse inventory with drones.
Our previous investigations and experiences showed that the given mathematical model describes most of the warehouses and the drone inventory task in practice well.This also shows that, in practice, the model can be used well in logistic decisions.
As described in the previous chapter, we encountered some problems in our solution method, which fortunately did not cause any problems for the warehouses we investigated, but further investigations are needed to ensure the stability of the solution.

Figure 1 .
Figure 1.Construction of a specific warehouse.

Figure 2 .
Figure 2. Flowchart of the processing on a drone.

Figure 2 .
Figure 2. Flowchart of the processing on a drone.

•
data, included in tables the fixed basic data, of the warehouse, of the drone, of the drone's positioning within the warehouse • the variable, i.e., the data to be searched as a target; • the indexes used in bound; • function specifying the speed of the drone; • the processing route and time of the drone; • the constraints, and • the solving algorithm.

v
represents the sub-index of consecutive compartments.u index of charges.b index of drones.

Figure 3 .
Figure 3. Floor plan of the warehouse, with dimensions included.

Figure 3 .
Figure 3. Floor plan of the warehouse, with dimensions included.

Figure 4 .
Figure 4.The data of the shelf system.

Figure 5 .
Figure 5.The shelf system to be tested.The black shelves indicate that the compartments that have already been examined.(The green circle indicates the processing starting point of the drone ( ), the red circles the reference points of the shelf systems (  ), the red square indicates the floor-level reference point of the aisles of two shelf systems, which is the same as ( ), but  = 0.).

Figure 4 .
Figure 4.The data of the shelf system.

Figure 3 .
Figure 3. Floor plan of the warehouse, with dimensions included.

Figure 4 .
Figure 4.The data of the shelf system.

Figure 5 .
Figure 5.The shelf system to be tested.The black shelves indicate that the compartments that have already been examined.(The green circle indicates the processing starting point of the drone ( ), the red circles the reference points of the shelf systems (  ), the red square indicates the floor-level reference point of the aisles of two shelf systems, which is the same as ( ), but  = 0.).

Figure 5 .
Figure 5.The shelf system to be tested.The black shelves indicate that the compartments that have already been examined.(The green circle indicates the processing starting point of the drone (C kb ), the red circles the reference points of the shelf systems (P l ), the red square indicates the floor-level reference point of the aisles of two shelf systems, which is the same as (C kb ), but c ibz = 0.).

Figure 6 .
Figure 6.The speed of the drone.

Figure 6 .
Figure 6.The speed of the drone.

Figure 7 .
Figure 7. Processing process for individual drones.

Figure 7 .
Figure 7. Processing process for individual drones.

3. 6 . 1 .
The Distance and Time from the Docking Station to the Starting Point (Figure 8) This consists of three parts: I.The drone moves from the charger to the starting point between the shelves (the green view, C kb ), II.

Drones 2022, 6 , 364 16 of 29 Figure 8 .
Figure 8.The route and the auxiliary lines helping to determine it.(The blue line shows the drone's path from the docking station to the first compartment to be processed).I. Time to reach the starting position of the shelves:  =  (, , ) is the compartment distance from the docking station:  , ( , , ) =  , +  , .(22)

Figure 8 .
Figure 8.The route and the auxiliary lines helping to determine it.(The blue line shows the drone's path from the docking station to the first compartment to be processed).I. Time to reach the starting position of the shelves:

Figure 9 .Figure 9 .
Figure 9.The path from compartment to compartment within an aisle.Two shelf syst here since we observe two at the same time.(The blue line indicates the path of the dro processed compartment to the next compartment).

Figure 10 .
Figure 10.Movement from compartment to compartment in the case of different aisles.The fi shows the changeover at the starting point of the aisle, but the situation is similar if the change takes place at the other end of the shelf system.The orange path shows the path of another dro has a different route to avoid collisions.

Figure 10 .
Figure 10.Movement from compartment to compartment in the case of different aisles.The figure shows the changeover at the starting point of the aisle, but the situation is similar if the changeover takes place at the other end of the shelf system.The orange path shows the path of another drone.It has a different route to avoid collisions.

Figure 11 .
Figure 11.Floor plan of the warehouse, with dimensions included.

Figure 12 .
Figure 12.The data of the shelf system.

Figure 11 .
Figure 11.Floor plan of the warehouse, with dimensions included.

Figure 11 .
Figure 11.Floor plan of the warehouse, with dimensions included.

Figure 12 .
Figure 12.The data of the shelf system.Figure 12.The data of the shelf system.

Figure 12 .
Figure 12.The data of the shelf system.Figure 12.The data of the shelf system.

Table 2 .
Table of indexes.

Table 3 .
Variable data table.

Table 4 .
The most important data of the drone.