**3.2 Construction of Hamiltonian cycles by the splitting method**

218 Recurrent Neural Networks and Soft Computing

Edge *t* Edge *t* (0,12) 0,008 (5,9) 0,5 (0,3) 1,0 (6,7) 0,063 (0,1) 1,0 (6,10) 1,0 (0,4) 1,0 (7,11) 1,0 (1,13) 1,0 (8,11) 1,0 (1,2) 0,25 (8,9) 1,0 (1,5) 1,0 (8,12) 1,0 (2,14) 0,125 (9,10) 0,125 (2,3) 0,125 (9,13) 1,0 (2,6) 1,0 (10,11) 1,0 (3,15) 1,0 (10,14) 1,0 (3,7) 0,25 (11,15) 1,0 (4,7) 0,25 (12,15) 1,0 (4,5) 1,0 (12,13) 0,5 (4,8) 1,0 (13,14) 0,5 (5,6) 1,0 (14,15) 1,0

Table 5. Dependence *t* of the step on the choice of the deleted edge

Fig. 12. Examples of Hamiltonian cycles in 2D-torus

Results discussed in this section should be considered as preliminary and opening the research field studying the relation between the quality of nesting of graphs of parallel algorithms to graphs of computer systems whose regularity is violated by node and edge

defects and the parameters of neural network algorithms implementing this nesting.

The time of execution of the above-described algorithm can be substantially reduced by using the following method:


For example, the initial graph of the system can be split into connected subgraphs by the algorithms proposed in (Tarkov, 2005).

Fig. 13. Unification of cycles

Optimization of Mapping Graphs of Parallel

chosen for parallelization.

(See Table 7).

the system graph edges.

the Hopfield one.

**4. Conclusion** 

cycle in the three-dimensional torus is optimal too.

Table 7. Construction of Hamiltonian Cycles in 3D-torus

So, the experiments show that the proposed algorithm:

1. Constructs optimal Hamilton cycles in 2D-tori with edge defects;

Programs onto Graphs of Distributed Computer Systems by Recurrent Neural Network 221

If the Hamilton cycles in all two-dimensional tori are optimal then the resulting Hamilton

In the table 7 the times (in seconds) of construction of optimal Hamilton cycles in threedimensional tori with *n mmm* nodes are presented: *seq t* is the time of the sequential algorithm, *par t* is the time of the parallel algorithm on processor Intel Pentium Dual-Core CPU E 52000, 2,5 GHz with usage of the parallel programming system OpenMP (Chapman, Jost & van der Pas, 2008), / *St t seq par* is the speedup. The system of equations (14) was

*m* 4 8 12 16 20 24 28 32

*n* 64 512 1728 4096 8000 13284 21952 32768

*seq t* 0.125 0.062 0.906 6.265 31.22 133.11 390.61 2293.5

*par t* 0.171 0.062 0.484 3.265 15.95 70.36 217.78 1397.6

*S* 0.73 1 1.87 1.92 1.96 1.89 1.79 1.64

2. Allows to construct optimal Hamilton cycles in 3D-tori with tens of thousands of nodes

A problem of mapping graphs of parallel programs onto graphs of distributed computer systems by recurrent neural networks is formulated. The parameter values providing the absence of incorrect solutions are experimentally determined. Optimal solutions are found for mapping a "line"-graph onto a two-dimensional torus due to introduction into Lyapunov function of penalty coefficients for the program graph edges not-mapped onto

For increasing probability of finding optimal mapping, a method for splitting the mapping is proposed. The method essence is a reducing solution matrix to a block-diagonal form. The Wang recurrent neural network is used to exclude incorrect solutions of the problem of mapping the line-graph onto three-dimensional torus. This network converges quicker than

An efficient algorithm based on a recurrent neural Wang's network and the WTA principle is proposed for the construction of Hamiltonian cycles (ring program graphs) in regular graphs (2D- and 3D-tori, and hypercubes) of distributed computer systems and 2D-tori disturbed by removing an arbitrary edge (edge defect). The neural network parameters for

For unification of two cycles *R*1 and *R*<sup>2</sup> , it is sufficient if the graph of the system has a cycle ABCD of length 4 such that the edge AB belongs to the cycle *R*1 and the edge CD belongs to the cycle *R*<sup>2</sup> (Fig. 13).

The cycles *R*1 and *R*2 can be united into one cycle by using the following algorithm:


The cycles *R*1 and *R*<sup>2</sup> , and also the resulting cycle are marked by bold lines in Fig. 12. The edges that are not included into the above-mentioned cycles are marked by dotted lines.

For comparison, Table 6 gives times (in seconds) of constructing Hamiltonian cycles in a 2Dmesh by the initial algorithm ( <sup>1</sup>*t* ) and by the algorithm with splitting of cycle construction ( <sup>2</sup>*t* ) with the number of subgraphs *k* = 2. The times are measured for *p* = *n*. The cycle construction time can be additionally reduced by parallel construction of cycles in subgraphs.


Table 6. Comparison of cycle construction times in 2D-mesh

The proposed approach can be applied to constructing Hamiltonian cycles in arbitrary nonweighted nonoriented graphs without multiple edges and loops.

We can use the splitting method to construct Hamilton cycles in three-dimensional tori because the three-dimensional torus can be considered as a connected set of twodimensional tori. So, the Hamilton cycle in three-dimensional torus can be constructed as follows:


If the Hamilton cycles in all two-dimensional tori are optimal then the resulting Hamilton cycle in the three-dimensional torus is optimal too.

In the table 7 the times (in seconds) of construction of optimal Hamilton cycles in threedimensional tori with *n mmm* nodes are presented: *seq t* is the time of the sequential algorithm, *par t* is the time of the parallel algorithm on processor Intel Pentium Dual-Core CPU E 52000, 2,5 GHz with usage of the parallel programming system OpenMP (Chapman, Jost & van der Pas, 2008), / *St t seq par* is the speedup. The system of equations (14) was chosen for parallelization.


Table 7. Construction of Hamiltonian Cycles in 3D-torus

So, the experiments show that the proposed algorithm:

