Sorting the array of integers using a neural network
Currently, quite a number of various algorithms and data structures are available on which all modern software systems are built. On the other hand, these algorithms are poorly suited for solving problems of pattern recognition, classification, and regression for which specific methods exist and/or solutions based on neural networks are applied. Neural networks are per se universal approximators, i.e. they can reproduce a predetermined curve with a high degree of accuracy. It also follows that unlike classical algorithms, systems based on neural networks will always have a certain percentage of errors due to their probabilistic nature. In this paper, an algorithm of sorting an array of integers using a neural network is proposed. This algorithm is a symbiosis of a neural network and classical algorithms. The paper presents a block diagram of the algorithm which comprises several parts such as a neural network to search for a minimal element of the input vector and a part of the system which places the found minimal element in the sorted part of the array. The last part of the system is implemented in the form of classical algorithms, but can be replaced by a degenerate version of a neural network in which weights are the replacements of array elements. The verification of the proposed algorithm was carried out. As a result, 248 out of 10,000 measurements were wrong, which corresponds to a 2.48% error. Some possible causes of this error rate are also discussed in the paper.