## 3 Materials and Methods  
The prototype system, referring to the structure presented in Figure 1, was implemented using Python version 3.7 and the MySQL database. In the proposed considered scenario, the geolocalization data were obtained in integration with the GPS-based vehicle location system, the ABC-track system. The information was obtained thanks to the courtesy of the owners (ABC-Track Ltd. Company). Dedicated requests were sent to the address indicated in the Company documentation, using the HTTP--GET method. The get-Points service was used for receiving the information about individual points on the route map. The data was collected and processed using scripts written in Python programming language. The obtained data structures were imported to the newly created DataFrame object of the Pandas library in JSON format for further analysis in the optimization module. As a result of a query to the site, a list of objects was returned. Each of the objects is a representation of a particular point on the map and has the following information:  
* pointId--unique identifier of the point. * pointName--point name. * pointLatitude--the latitude of the point. * pointLongitude--the longitude of the point. The distances between pairs of coordinates are obtained by the Table Service, offered in OSRM API. It calculates the length and duration of the fastest route between all pairs of given coordinates. All returned data were in JSON (JavaScript Object Notation) format, preprocessed using Python's script, saved in a local database, and converted to tabular form (csv). For the needs of the study, a two-stage optimization algorithm was developed and implemented in MathCad 13 software. It ensures a favorable balance between the degree of optimization and time consumption and is characterized by good scalability. The first and base stage is a version of the greedy algorithm, which guides the selection of orders for vehicles by the local best hop approach. It means a request is selected whose handling will have the most negligible possible impact on the growth of the cost function. In this case, total distance was the main optimization criterion. In the case of several equivalent candidates, the next criterion was the choice according to the largest truck-order heuristic principle. This stage is deterministic (i.e., it always returns the same result with the same input data set). In the second stage, the \"greedy\" solution is randomly adjusted based on the random swapping of orders assignments. It was a proprietary implementation of a variant of the 2-opt algorithm, often used to solve the traveling salesman problem [54]. Total fuel cost was the main optimization criterion in this stage. Three variants of the algorithm were used in the analyzes:  
* Greedy only
* Greedy + Simple RandSwap and,
* Greedy + Wise RandSwap  
Simple RandSwap relies on a random exchange of orders between two vehicles. If the swap generates a lower or equal cost--it is accepted, otherwise, it is rejected. In the Wise RandSwap algorithm, interchanges between vehicles with nearby routes are preferable. The algorithm uses the following main inputs as shown in Figure 1: Requests, TrucksList, DestPos, and DistMx datasets. The DestPos and DistMx input data were imported from the mentioned csv file, returned by GIS/OSRM services, located in Kielce, Poland. Representative and actual input data of requests list and list of the vehicle was obtained from a local shipping company--Alma-Alpinex Join-Stock Company, which redistributes food products and manages a fleet of approx. 100 vehicles. The sample output problem solution (Service Records), including route sequences proposed by experienced planners, was obtained from the same source. Total 1103 pallets divided into 416 individual orders were redistributed to 202 destinations from one central depot. The six types of trucks with different capacities of 27, 21, 20, 18, 10, and 8 pallets were considered as candidates.