# Application of the Clark-Wright Method to Improve the Sustainability of the Logistic Chain
## 5 Results  
The set of vehicle routes, or circular tours, falls under the realm of operational decision-making. This type of task needs to be solved daily, as the structure of customer orders changes. In practice, the ability to complete the task in a very short amount of time (a few minutes at most) is required, as this is the only way to quickly respond to customer orders. Software based on a simple algorithm was used to calculate the Clark-Wright method. This algorithm enables quick calculations of optimized routes, which is crucial for operational decision-making and immediate response to changing orders. In the first step, it reads all the input data:  
* The nodes of the graph with the number of containers to be diverted;
* The edges between the nodes, given by the start and end nodes and the length of the route;  
Figure 5: Graphic representation of the vertices and edges of the initial graph in the vicinity of the city of \(\dot{\text{Z}}\)lima. * The number of vehicles and their capacities. [PERSON]'s algorithm, also known as the Floyd-Warshall algorithm, is an algorithm for finding the shortest paths between all pairs of nodes in a weighted graph. In our solution, it is used to calculate the shortest distances between all nodes, which is essential for creating the distance and savings matrix. This step is crucial in route optimization because it allows the shortest paths between individual points (nodes) to be identified, enabling efficient planning of vehicle routes to minimize travel distances and maximize savings. The result of applying [PERSON]'s algorithm is a matrix representation of the shortest paths between each pair of nodes, which serves as the foundation for the next steps in the Clark-Wright method. In the attached flowchart, you can see that after data input and the creation of the evaluation matrix, the next step is applying [PERSON]'s algorithm. This algorithm provides data that are then used to create the distance matrix, the shortest path matrix, and the savings matrix. The results from these matrices allow for more efficient grouping of individual nodes into routes, with the goal of minimizing travel distances while maintaining vehicle capacity. The functioning of the created software is shown using the flowchart in Figure 6.  
Figure 6: Process diagram of the developed software. In the provided diagram, there is a step labelled \"MAX L\({}_{\text{im}}\) (from savings matrix),\" which refers to identifying the pair of nodes with the highest savings value from the savings matrix. However, this step does not mean maximizing the objective function but rather optimizing the process of linking nodes based on these savings. The Clark-Wright method uses the savings matrix to determine pairs of nodes that, when connected, achieve the greatest savings in route length. This \"MAX L\({}_{\text{im}}\)\" step identifies the pairs with the highest savings value, representing the greatest potential for reducing the total travel distance. Subsequently, these pairs are merged into common routes, leading to the minimization of the objective function, which is the total route length. While the term \"maximizing\" savings is used in this step, the main goal of the entire process is indeed minimizing the total distance traveled, which corresponds to the objective function of the optimization. We chose this approach to ensure the greatest possible savings at each step and ultimately achieve a reduction in the total vehicle route length. For the first phase of the calculation, the starting capacities listed in Table 1 were used as input data. As is clear from the mentioned disproportion between the available capacity and the transportation requirements, this first calculation did not have a usable solution. The result of the calculation was 65 new routes, within which only 5980 containers were taken from 377 peaks. The remaining peaks were not served at all due to the exhaustion of capacities.