# Improved Networks Routing Using an Arrow-Based Description
## 6 The Algorithm in More Detail  
Initially, we run the first part of the algorithm as indicated in [5] and find the necessary cycles adjacencies that would determine a direct and a reverse path in the graph from a given source node to an end node. To do that, we first randomly number the nodes of the graph. Then we choose a parsing direction for each cycle. Usually, we use the same parsing direction for each internal cycle and the opposite direction for the border cycle. In our example, we have chosen the clockwise direction for the internal cycle and the counterclockwise direction for the external cycle. Afterwards we assign arrows to each link such that the arrows belonging to a specific cycle have the same orientation as the orientation of the cycle. These assignments are depicted in Figure 5.  
Furthermore, we randomly number the links in the graph such that they are uniquely identified. Recall that a link is shown as a composition of two arrows, running in opposite directions. In Figure 5, the link numbers are not shown for the sake of clarity. Once we have made these preliminary assignments, we can create the cycles Laplacian of the graph, which is used in finding a direct path and a reverse path in the graph as it is shown in the literature [6, 9, 10]. In parallel, we need to have a representation of the dependencies between the cycles and the nodes. However, a purely numerical dependency does not exist because the nodes-links incidence matrix A\({}_{\text{nKL}}\) is orthogonal to the cycles-links incidence matrix B\({}_{\text{CxL}}\) and therefore AB = BA = 0, wherein 0 in a matrix with all the entries equaling 0. Hence, a symbolic representation of nodes-cycles dependencies looks appropriate, as well as a list-based one. In this paper, we prefer the symbolic representation and we show it subsequently. For this purpose, we need to use the arrow representation of the graph together with all its properties as presented above. For this purpose, each non-zero entry (i,j) in the cycles-links matrix is replaced by the arrow corresponding to the sense in which the link is traversed within that cycle. In this way we have introduced the cycles-nodes dependencies. For example, the row in the matrix B corresponding to cycle 1 contains the non-zero entries in the second row of Table 2. The remaining entries on that row are zeroes and not shown below. The first row of Table 2 indicates the link numbers assigned to the links of the graph shown in Figure 5. We note that link 27 contains node 20, which is the end node of the sought path. Notice that cycles C1 and C2 are adjacent, with common link 29. As we already know from previous work [6], merging C1|C2 results in adding the corresponding rows or columns of the cycles Laplacian. We translate this operation using the cycle-nodes dependency for cycle1 and for cycle2, respectively and using the arrow representation. The result of the arrow operation related to link 29, which is the common link between cycles 1 and 2 is shown in Equation (2). \[\overrightarrow{(\mathbf{17},\mathbf{18})}\overset{\rightarrow}{+} \overrightarrow{(\mathbf{18},\mathbf{17})}=\overset{\rightarrow}{\boldsymbol {\theta}} \tag{2}\]  
In Equation (2), we have used the fact that each link has an inverse. At the end of the process we obtain the final cycle-links dependency vector of the merged cycle, whose non-zero entries are, in arrow notation, \((\overrightarrow{(\mathbf{19},\mathbf{20})},\overrightarrow{(\mathbf{20}, \mathbf{16})},\overrightarrow{(\mathbf{16},\mathbf{17})},\overrightarrow{( \mathbf{17},\mathbf{7})},\overrightarrow{(\mathbf{7},\mathbf{8})},\overrightarrow {(\mathbf{8},\mathbf{9})},\overrightarrow{(\mathbf{9},\mathbf{18})}, \overrightarrow{(\mathbf{18},\mathbf{19})})\)  
The next step in the algorithm is to separate the source and end nodes for each arrow. For the above merger, the vectors appear as in Table 3.