ON SOME ASPECTS OF GRAPH THEORY FOR OPTIMAL TRANSPORT AMONG MARINE PORTS

This paper is devoted to the Travelling Salesman Problem as applied to Czechoslovak ocean shipping companies and their marine ports on the Black Sea. The shortest circular path around these ports is found and discussed. Formulation of the problem accounts for the fact that distances between the individual cities are not the same in both directions. The consequences that arise from this situation are studied. The used algorithms are based on graph theory and standard logistic methods. In addition, the results are compared with the results obtained by using a minimum spanning tree algorithm.


INTRODUCTION
The Travelling Salesman Problem (TSP) is formulated as a task with a given set of cities and the paths between them. The task is to find the shortest (most economical) path passing through all the cities and returning to the starting point. The TSP is usually formulated using concepts based on graph theory. Graph vertices represent cities, while graph edges refer to individual paths between cities. In the traditional view, the solution to the problem lies in finding a closed path (a circle) on a rated (usually non-oriented) graph, cf. [1,8]. Contrary to the classical case, our method recognizes that distances between individual cities are different when travelling in the opposite direction. Such a situation is described by means of a closed path in an oriented graph. The TSP remains a viable topic for study, cf. [2,7,[19][20].
The Czechoslovak Ocean Shipping (COS) company was founded in 1959. During its existence, the company was using 28 home ports in various countries. This paper is devoted to the Black Sea region. In this area, the business interests of the company were realized through seven marine ports (Braila, Galati, Reni, Izmail, Constanza, Varna, Burgas) in three countries (Bulgaria, Romania, Ukraine). There are currently other transport companies operating in the Czech Republic that engage in ocean shipping. These include DSV Air & Sea s.r.o., Cargo IHL -International Shipping Company, Multitrans CZ s.r.o. and Logex Logistics, s.r.o. These companies are represented in most of the major world ports, including former home ports of COS. For the history of Czechoslovak maritime shipping, see, e.g., [10,15].
In line with the TSP principles, we search for and also compare the shortest and longest paths from Prague, through all seven ports and back to Prague. We assume that the trip from Prague to the Black Sea area takes place by air, the journey then continues through the individual ports and ends after a final return flight back to Prague. Given that, among the cities in question, only Varna and Burgas had operational international airports at the time COS existed, these two locations necessarily become the second and the penultimate vertices on our graph.

DATA AND METHODS
For calculating and finding the shortest path, we are going to use the road distances between the ports listed in Table 1  We emphasize that, in most theoretical tasks of this type, it is assumed that the distances between two vertices A and B are the same in both directions: A-B, B-A. However, in the case of real road traffic, these distances may be different (see Table 1). The difference may be caused, for example, by one-way roads, highway connections and city bypasses.
The transport problem is modelled using a graph. All graphs represented in this article are finite, connected, weighted and closed with oriented edges. The system of traffic routes can be transformed into a graph in which vertices represent seaports, edges represent transport routes and weights of edges represent the energy consumed while using the means of transport (ship, car, airplane, train or something else) between the respective two ports. To model this situation, we create a connected graph G=(V,E), where V is the set of n vertices and E is the set of edges as usual. The edges are weighted.
A Hamiltonian path is a path that visits each vertex of the graph exactly once. A Hamiltonian cycle is a closed path that visits each vertex exactly once (except for the vertex that is both the start and the end, which is visited twice). A graph containing a Hamiltonian cycle is called a Hamiltonian graph. In the language of graph theory, the TSP requires finding a Hamiltonian cycle with the smallest sum of the weights of the edges.
Using the mathematical software "Maple", the length of all circular paths (Hamiltonian cycles) was computed. All discovered circular paths were divided into two groups. The first group included paths beginning with Prague-Burgas nodes and ending with Varna-Prague nodes. The second group included paths beginning with Prague-Varna nodes and ending with Burgas-Prague nodes. The paths in each group were examined individually and arranged in terms of length from the shortest to the longest. From each group, the five longest and five shortest paths were selected. It has been examined whether the five shortest paths in Group 1 correspond exactly to the five shortest paths in Group 2, except for the fact that they run in opposite directions. The same methodology was used for the five longest trips of each group. The conclusions are presented in Table 2-5 with a subsequent analysis of the findings.
For comparison with Hamilton cycles, we present a minimum spanning tree (MST) and its length. Although the MST does not solve the problem of circular paths, it has significant use in logistic processes. A typical application of such an MST algorithm would be in searching for the most effective way for road or train lane construction, electricity distribution, water distribution and especially engineering networks.
The spanning tree of a connected graph G is a subgraph G´, which connects all vertices but does not contain any cycles [9,14]. For the MST, we denote , where and E´ represents the set of n -1 edges of the MST, such that that . The sum of the weights of the edges of the MST is minimal. Thus, for subgraph G´= (V´,E´) of the graph G, we propose and the spanning tree G´ of the graph G is minimal if, for each spanning tree G´´ of the graph G, it holds that . There are several generally known algorithms that use different ways to search for the MST, e.g., Kruskal's algorithm [16], Prim's algorithm or Borůvka's algorithm.

RESULTS
This chapter summarizes and interprets the results that have been obtained from input data by mathematical methods.
Two paths can be considered as mutually equivalent if these paths pass through the ports in reverse order, e.g., the first path in Table 2 (P-Bu-Br-I-R-G-C-V-P) and the fourth path in Table 3 (P-V-C-G-R-I-Br-Bu-P). The following tables present two sets of the five shortest and longest paths in the direction Prague-Burgas and Prague-Varna, including the paths equivalent to them. Table 2 The shortest paths in the direction Prague-Burgas In the left half of Table 2, we see the shortest paths in the direction of Prague-Burgas, while the right half shows the equivalent paths. A similar layout for the Prague-Varna paths is found in Table 3. Table 3 The shortest paths in the direction Prague-Varna

P-V-C-Br-I-R-G-Bu-P 3,534.3 P-Bu-G-R-I-Br-C-V-P 3,532.3
For the five longest paths in each direction, Tables 4-5 are compiled in an analogous manner to the Tables 2-3. Table 4 concerns the Prague-Burgas routes. Table 4 The longest paths in the direction Prague-Burgas  Table 5 contains the longest paths in the direction Prague-Varna. It can be noticed that the table contains a larger number of items (paths) than the previous ones, due to the existence of four paths of identical length in kilometres (4,001.1) in fifth place. Table 5 The longest paths in the direction Prague-Varna From these tables, various observations can be made, which are discussed in the next chapter. Next, Figure 1 shows the MST of the examined graph. The length of the MST is 2,012.8 km.

DISCUSSION
In Tables 2-5, one can see that the paths in which Varna is the second vertex are longer than the paths starting with the Prague-Burgas step.
A. Prague-Burgas direction: In this direction, the shortest path found has a length of 3,527.3 km. The cities were passed in the following order: Prague-Burgas-Braila-Izmail-Reni-Galati-Constanza-Varna-Prague (Figure 2). Due to asymmetries in Table 1, the length of this path in the opposite direction is 3,529.3 km (Table 2).
B. Prague-Varna direction: In this direction, the shortest path has a length of 3,528.4 km. The cities were passed in the following order: Prague-Varna-Constanza-Galati-Izmail-Reni-Braila-Burgas-Prague. The length of this path in the opposite direction is 3,527.6 km.
From Tables 2-3, it becomes apparent that, if we compare the five shortest paths in both directions, the following applies: 1) Of the five shortest paths in each direction, only four are mutually equivalent.
2) When arranging paths in terms of distance, the mutually equivalent paths do not appear in the same position in the order.
3) The path from Table 2, which does not have an equivalent counterpart in Table 3, and the path from Table 3, which does not have an equivalent counterpart in Table 2, both appear in fifth position in their respective tables. 4) In the direction Prague-Burgas, the distance difference between the first and the fifth path is only 3.2 km, while, in the direction Prague-Varna, it is 5.9 km. Corresponding to this fact, the distance differences in the columns displaying equivalent paths are greater in the direction Prague-Varna than in the direction Prague-Burgas. On some aspects of graph theory for optimal transport among marine ports 43.
In a similar way, we can classify the five longest paths in both directions, as described in Tables 4-5:  1) For the direction Prague-Varna, the table contains a greater number of paths than five, because, in Table 5, there are four paths of equal length in kilometres. 2) Among the longest paths listed in both directions, there are only two equivalent ones (one  in each table). Furthermore, these two paths do not appear in the same position in the order. 3) In the direction Prague-Burgas, the difference between the first and the fifth path is 1 km, while, in the direction Prague-Varna, the difference in length between the paths is only 0.6 km. Corresponding to this fact, the distance differences in the columns displaying equivalent paths are smaller in the direction Prague-Varna than in the direction Prague-Burgas. 4) The longest path of all has a length of 4,001.7 km and can be achieved in two different ways (one of them is described in Figure 2).
The overall comparison of all tables shows that the distance differences between the shortest paths are in the order of kilometres, while the differences between the longest paths are in the order of hundreds of meters.
In line with the formulation of the problem, the Burgas-Varna edge is excluded from this graph. This fact had to be taken into account in all calculations and also while constructing Figures 1-2. It might appear to be more advantageous to use the spanning tree for comparing the length of the MST and Hamiltonian cycles. However, according to the formulation of the problem (Chapter 1), the path must end again at the starting vertex. Therefore, when using the MST, it is necessary to pass each edge twice (see Figure 1). Thus, the length of the path is disproportionately increased, so it is much more advantageous to use Hamiltonian cycles for solving this task.

CONCLUSION
In this paper, the discussed TSP has an additional property, namely, that paths in opposite directions can have a different length. The differences between the five shortest and the five longest paths between Black Sea ports are studied and the paths are compared with an MST. The shortest and the longest paths are found in both possible directions. Differences between equivalent paths are discussed.
In the field of transport studies, many different methods are being used to solve optimization problems, be it the optimization of transport itself [2,4,[6][7][11][12], the placement of logistics centres [5,13] or the construction of transport networks [3]. Other practical applications of a theoretical approach to freight transport or combined transport issues are studied in [17][18]21].
We may expect that the further study of transport optimization will continue to take into account ever-increasing traffic density, the increasing volume of freight transported, improvements in technologies and rising standards of living.