APPLICATION OF FLOYD‘S ALGORITHM ON TRANSPORT NETWORK OF SOUTH BOHEMIAN REGION APPLICATION OF FLOYD‘S ALGORITHM ON TRANSPORT NETWORK OF SOUTH BOHEMIAN REGION

When choosing the best option, some optimality criterion always enters into the solution of the problem. For example, in dealing with the problem of possible routes between two nodes we can assess distance (length) of possible routes, the consumption


Introduction
Finding the optimal routes in networks (transport network, telecommunication network, etc.) is the most common task of Graph Theory used in everyday life.These tasks are solved within the models of real transport networks.An example of a schematic model of the transport network may bea common non-oriented, connected and edge-rated graph.We are searching for optimal routes at this graph (model) because we need, for example, to minimize the costs necessary for realization of journeys.Minimizing the costs (such as the fuel consumption) can be understood as a task of finding the shortest (minimal) path between two specified nodes in the graph.
But it is not always about the minimizing of costs.Tasks of the reliability and capacity belong to the issue of route optimization in networks as well.These examples belong to the tasks of important routes within the graph [1]: • Task of the shortest (minimal) path; -from one specific node of graph (origin) to another; a) searching for minimal path from origin to final destination; b) searching for minimal path from origin to all other nodes of graph; -from each node to one another; • task of the most reliable path; • path with a maximum capacity; • finding the maximum path in the graph (adjusted general algorithm).
In the following part a task of optimal route is generally formulated and a practical demonstration of the application of a simplified Floyd's algorithm on the transport network of I and II class roads in South Bohemian region is conducted for searching optimal routes in the network.Specifically, it is the application of the algorithm in the task of finding the minimal path from each of the network vertex to another [2].

Formulation of the problem of optimal route in network
Let us have a transport network as graph G = (X, U, {(h)) wherein each edge h !U is rated with number φ (h), called the edge length.Then the task of the optimal route in a network of n nodes (vertexes) is to find the optimum route, namely [3]: • from one node v i (i.e.start or origin vertex) to other node v j (i.e. the destination or final vertex) in the network; • from the initial node v i to each of the other nodes v j !X in the network; When choosing the best option, some optimality criterion always enters into the solution of the problem.For example, in dealing with the problem of possible routes between two nodes we can assess distance (length) of possible routes, the consumption

Minimal paths from one node to another
The bulk of the tasks requires the calculation of distances between any two network nodes, thus the task is to find the minimal path between all pairs of nodes (v i , v j ), more precisely between ordered pairs [v i , v j ] in graph G = (X, U, {(h)), where v i !v j and i, j = 1, …, n.In the selected transport network the output of the algorithm will be a square matrix of minimum distances D of type n x n, where n = number of nodes (towns and cities with more than 5,000 inhabitants) in the graph, in the case of the South Bohemian Region n = 16.The whole graph is thus shown as a square 16 x 16 matrix where the row and column headings constitute individual nodes (cities) of the graph (Fig. 3) [6].

Floyd Algorithm
To demonstrate the practical use of the algorithm in practice, Floyd algorithm determining the minimal path from each node to another one was chosen.This algorithm is suitable for all transport networks having the number of edges approaching the complete graph.The algorithm is applicable to oriented and non-oriented graphs.In the case of simplified transport network of South Bohemia region it will be a non-oriented graph G = (X, U, {(h)).
c for i j for all i, j = 1, …, n. [3] of time needed for the relocation, the mutual availability of the nodes and the costs associated with relocation.However, we always come to the two extreme tasks, namely [3 and 4]: • to minimum => task to find the minimal path; • to maximum => task to find the maximal path.The most common practical example is the criterion of optimizing the costs associated with relocation, and because our demand is to minimize the distance after which the relocation occurs.In application on the transport network of South Bohemian Region we will discuss the task of finding minimal paths between all nodes in the graph G = (X, U, {(h)) [4].

Model of transport network in South Bohemian Region
As already mentioned in the introductory part of the article, simplified transport network is composed of I and II class roads (Fig. 1).Based on the real map and real conditions the traffic model was created (non-oriented graph G = (X, U, {(h))) showing simply the same transport network with the valuation of individual edges with the distance [km], but for simplicity intersections in rural areas are neglected -intersections of network are merely nodes = cities with a population over 5,000.This simplified model of the network is then shown in Fig. 2.
Fig. 1 The road network of South Bohemian Region with the nodestowns and cities with population over 5,000 (source: http://www.mapy.cz)[5] Fig. 4 Schematic representation of shortening the way from the vertex v i to v j through the vertex v k (source: Authors) 3) If k = n, then the final matrix C n is the searched matrix of minimal distances of the graph; thus, for all pairs of nodes i and j applies c ij = d ij , where d ij is the distance (= the distance of the shortest path) between the nodes v i and v j for all i, j = 1, …, n.
The final matrix C n = D is called distance matrix [10 and 11].
The final distance matrix D for transport network model in South Bohemia is shown in Figure 6 including minimal distances The symbol p(h) represents the direct distance between nodes v i and v j .Thus, if there is an edge in the graph directly connecting node v i with node v j , then we record to the matrix of direct distances the edge evaluation h {^h (= distance) between these nodes [7].
If the direct distance between nodes v i and v j does not exist, we write to the matrix of direct distances the symbol 3 (in our case in Fig. 3, the symbol 3 represents the large number 10 12 ).
2) The sequence of matrices C k , where k = 1 ,…, n is being gradually constructed.In this cycle, for k = 1, …, n, we search whether the way from the vertex v i to v j cannot be shortened through the vertex v k (see the schematic representation in Fig. 4) [8].
For all i, j !k we recalculate the elements in the matrix C k according to the relation [9]: Thus for the matrix C 1 (see in Fig. 5), its elements are as follows.: path, which was, by means of using Floyd algorithm, applied to a particular transport network of the South Bohemian region [12].
The task solution is represented by the abovementioned distance matrix D indicating the minimum distances from each node of the network to another one.This procedure is applicable to other transport networks as well (road network in the Czech Republic) and has a practical use, for example in logistics (route planning, transport service of territorial units etc.) and other sectors of transport (telecommunications etc.).from every major city to one another along existing I and II class roads.

Conclusion
The main objective of this paper was to describe the issue of searching for optimal paths in networks as one of the key areas of graph theory.For illustration, one of the most common tasks of graph theory was described -the task of searching for minimal

Fig. 2 A
Fig. 2 A simplified model of the transport network in the South Bohemian Region with values of edges (km) (source: Authors)

1 )
First, we prepare the initial square matrix of direct distance of n x n type so that:

Fig. 3
Fig. 3 Formation of the initial matrix C 0 of the graph direct distances (source: Authors)