<?xml version="1.0" encoding="UTF-8"?>
<TEI xml:space="preserve" xmlns="http://www.tei-c.org/ns/1.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.tei-c.org/ns/1.0 https://raw.githubusercontent.com/kermitt2/grobid/master/grobid-home/schemas/xsd/Grobid.xsd"
 xmlns:xlink="http://www.w3.org/1999/xlink">
	<teiHeader xml:lang="en">
		<fileDesc>
			<titleStmt>
				<title level="a" type="main">Structural Adaptation of Sorting Algorithms Based on Constructive Fragments</title>
			</titleStmt>
			<publicationStmt>
				<publisher/>
				<availability status="unknown"><licence/></availability>
			</publicationStmt>
			<sourceDesc>
				<biblStruct>
					<analytic>
						<author>
							<persName><forename type="first">Viktor</forename><surname>Shynkarenko</surname></persName>
							<email>shinkarenko_vi@ua.fm</email>
							<affiliation key="aff0">
								<orgName type="institution">Ukrainian State University of Science and Technologies</orgName>
								<address>
									<addrLine>Lazaryana str. 2</addrLine>
									<postCode>49010</postCode>
									<settlement>Dnipro</settlement>
									<country key="UA">Ukraine</country>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Oleksii</forename><surname>Makarov</surname></persName>
							<email>makarovov@hotmail.com</email>
							<affiliation key="aff0">
								<orgName type="institution">Ukrainian State University of Science and Technologies</orgName>
								<address>
									<addrLine>Lazaryana str. 2</addrLine>
									<postCode>49010</postCode>
									<settlement>Dnipro</settlement>
									<country key="UA">Ukraine</country>
								</address>
							</affiliation>
						</author>
						<title level="a" type="main">Structural Adaptation of Sorting Algorithms Based on Constructive Fragments</title>
					</analytic>
					<monogr>
						<idno type="ISSN">1613-0073</idno>
					</monogr>
					<idno type="MD5">9B15FA8AF19058BBD955DA0795FAFF20</idno>
				</biblStruct>
			</sourceDesc>
		</fileDesc>
		<encodingDesc>
			<appInfo>
				<application version="0.7.2" ident="GROBID" when="2025-04-23T18:45+0000">
					<desc>GROBID - A machine learning software for extracting information from scholarly documents</desc>
					<ref target="https://github.com/kermitt2/grobid"/>
				</application>
			</appInfo>
		</encodingDesc>
		<profileDesc>
			<textClass>
				<keywords>
					<term>Information Technology</term>
					<term>Software</term>
					<term>Sorting</term>
					<term>Constructive-synthesizing Modeling</term>
					<term>Genetic Algorithm</term>
					<term>Binary Tree</term>
				</keywords>
			</textClass>
			<abstract>
<div xmlns="http://www.tei-c.org/ns/1.0"><p>Modern information technologies are based on processing large volumes of data. At the same time, the task of developing and applying effective algorithms for data processing, in particular sorting, remains relevant. Constructive-synthesizing modeling was applied to form the sorting algorithm code. The metaalgorithm of program code generation is presented. Parts of existing sorting algorithms and auxiliary utilities are used for generation. A genetic algorithm was used to select the algorithm with the maximum time efficiency under the given conditions of use. The use of a standard genetic algorithm faces a problem caused by a different number of elementary sorting operations, which leads to the use of chromosomes of different lengths. To solve the problem, a representation of the chromosome in the form of a binary tree is proposed. To form an algorithm that is guaranteed to sort the array, all leaf nodes include the final sorting gene at the end of the initial sequence of genes. This gene is decoded by calling the existing sorting algorithm, which is guaranteed to perform the sorting. Mechanisms of coding and decoding of the sorting algorithm from chromosome have been implemented. Linearization is performed for decoding and formation of the appropriate sorting algorithm: formation of a textual representation using a depth-first tree traversal algorithm. The fitness function is defined as the median sorting time of randomly generated sorting arrays (the same arrays for all chromosomes) in some stable environment, taking into account certain features of these arrays. The use of other fitness functions related to the number of calculations, comparisons or permutations is foreseen. The developed software should be applied in adapting sorting algorithms to stable input data streams and usage environments. An experiment was performed to verify the ability of the developed method and the corresponding software to form time-efficient sorting algorithms in different hardware and software environments. In the performed experiments, one component of the hardware and software environment was varied, namely the features of the data to be sorted.</p></div>
			</abstract>
		</profileDesc>
	</teiHeader>
	<text xml:lang="en">
		<body>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1.">Introduction</head><p>With the development of the Internet and information technology in general, the volumes of data generated and stored are growing rapidly <ref type="bibr">[1]</ref>. With the digitization of most areas of life -from business and science to personal communications -there is a need for effective management of this data. The growing volume of data presents us with challenges related to storage, processing, analysis and interpretation.</p><p>In this context, the relevance of efficient sorting algorithms becomes critical. To effectively work with large volumes of data, it is necessary to quickly and efficiently handle their processing. Even the simplest operations, such as sorting, can become time-and resource-consuming if inefficient methods are used.</p><p>Efficient sorting algorithms <ref type="bibr" target="#b1">[2]</ref> make it possible to quickly process large amounts of data, which is critical for many applications. In some network devices, data sorting can be used to optimize the processing of data packets and manage network traffic. Database management systems (DBMS) use sorting algorithms to perform queries, merge data and other operations <ref type="bibr" target="#b2">[3]</ref>. In distributed data storage systems, such as Hadoop or Apache Spark <ref type="bibr" target="#b3">[4]</ref>, sorting algorithms are used to process large amounts of information and ensure speed.</p><p>The evolution of sorting algorithms is a fascinating journey in the history of computer science that began with simple but effective methods. Those algorithms were studied with theoretical <ref type="bibr" target="#b4">[5]</ref> and experimental <ref type="bibr" target="#b5">[6]</ref> methods. For example, Bubble sort or Insertion sort with computational complexity O(n 2 ) <ref type="bibr" target="#b6">[7,</ref><ref type="bibr" target="#b7">8]</ref>. Later, more complex and optimized algorithms appeared, more suitable for sorting large volumes of data. Such as Quick sort or Merge sort, with an average computational complexity of O(n*log(n)). Numerous attempts have been made to improve and optimize existing algorithms <ref type="bibr" target="#b8">[9,</ref><ref type="bibr" target="#b9">10,</ref><ref type="bibr" target="#b10">11]</ref>. In the subsequent growth of requirements for stability <ref type="bibr" target="#b11">[12]</ref> and speed of sorting led to the appearance of combined algorithms. The most famous representatives of which are Timsort <ref type="bibr" target="#b12">[13]</ref> -a symbiosis of Insertion sort and Merge sort. Introsort <ref type="bibr" target="#b13">[14]</ref> starts with a Quick sort, then, under certain conditions, switches to a Heapsort, and calls an Insertion sort for small sequences <ref type="bibr" target="#b14">[15]</ref>.</p><p>Combined algorithms include the advantages of the components to increase efficiency. In <ref type="bibr" target="#b15">[16,</ref><ref type="bibr" target="#b16">17]</ref>, the newest approach to the formation, transformation, and analysis of structures using the operations of linking, substitution, inference, etc. is considered.</p><p>For the formation of structures (components and their mutual arrangement) of sorting algorithms, the approach of constructive-synthesizing modeling is applied. This ensures the following tasks are solved:</p><p>• creation of new sorting algorithms from parts of existing ones;</p><p>• adaptation of sorting algorithms to sorted data; • adaptation of data structures in RAM. This work does not consider a theoretical model, but only its practical application based on this model.</p><p>The purpose of this work is to develop a genetic algorithm <ref type="bibr" target="#b17">[18,</ref><ref type="bibr" target="#b18">19]</ref> for structural adaptation of sorting algorithms. Structural adaptation of sorting algorithms consists in forming an adapted algorithm from some parts of known algorithms in such a way that it will be no worse in time indicators than other sorting algorithms in some stable usage environment.</p><p>A feature of the genetic algorithm for this task is the formation of chromosomes of undetermined length and composition with the possibility of both encoding and decoding into a sorting algorithm.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.">Construction of sorting algorithms</head><p>To construct sorting algorithms, we will use parts of existing well-known sorting algorithms. The following basic (atomic) operations from these algorithms were used in the current version of the program:</p><p>• Quick sort. Splitting an array of data into two parts relative to a selected element, called a pivot. All elements smaller than the pivot element are moved to the left of it, and all larger elements are to the right; • Insertion sort. Insertion of one element from the unsorted part of the array into the sorted subarray; • Selection sort. Search for the minimum or maximum element in an unsorted subarray and permutation; • Cocktail shaker sort. Passing through the array in the forward or reverse direction and permuting all pairs of elements standing in the reverse order;</p><p>• Merge sort. Merging two sorted arrays into one.</p><p>Also, a possible operation is the conditional division of the array into two parts and the sorting of each separately. After each part is sorted, it is necessary to merge it into a single sorted array.</p><p>The model involves the addition of other basic operations. These can be parts of existing sorting algorithms. For example, the insertion of an element with a certain step, used in the Shell sort. It is also advisable to use deterministic and stochastic preprocessing algorithms <ref type="bibr" target="#b15">[16]</ref>, or their component operations. This can improve the efficiency of the final algorithm.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.1.">Algorithm formation rules</head><p>To form the algorithm (Figure <ref type="figure">.</ref> 1), the component basic operations are chosen randomly. Thus, any combinations of atomic algorithms are possible and, as a result, many unique constructed sorting algorithms. Some basic algorithms have special requirements for their use. If the requirements are not met, the generation will be impossible or the constructed algorithm will not complete the array sorting. For example, when dividing an array into two parts and sorting each part separately, the merge operation into one sorted array should be called.</p><p>Consider problems with a combination of sorting algorithms. The atomic parts of the Selection and Bubble sort algorithms divide the array into an unsorted (or not yet processed) part and a sorted part. If forward and reverse passes are performed, then the array is divided into two sorted parts, at the beginning and end of the array, and unsorted. Due to the peculiarities of the logic of the algorithms, the sorted parts have elements that are strictly smaller (at the beginning) or larger (at the end of the array) than those remaining in the unsorted middle part. If we pass through array only in one direction, then we will get classic Selection or Bubble sort. In this case, the array will be completely sorted. If passes in different directions are used, then the sorted parts at the beginning and at the end will grow until they meet and form a single sorted array.</p><p>For classic Insertion sort -when all insertions are performed only in the left (or only in the right) part -the result will be a fully sorted array. But if we perform insertions at the beginning and end of the array, we will form two sorted arrays, respectively. Moreover, there are no guarantees that the elements of the right array are strictly greater than or equal to the elements on the left. To merge two sorted subarrays into one, you need to call the Merge operation.</p><p>Additional complexity arises combining the algorithms described above. Suppose that an array of length N is being sorted. After performing M operations of selection to the beginning or passes through with the bubble sort in the reverse direction, we are guaranteed to have a sorted subarray [0, M-1] on the left, all elements of which are strictly less than or equal to the remaining elements in the unsorted part. If we now insert an element under index M in the left part, we will have a sorted array [0, M], but now its elements will not be less than or equal to those remaining in the unsorted part.</p><p>Subsequent calls of selection operations may not be efficient because the smallest element from the unsorted part of the array may be smaller than the one added by the Insertion sort. And the left sorted part after adding this element becomes unsorted, which means the inefficiency of the created algorithm.</p><p>For Bubble sort, one insert operation is not critical. If the element added by insertion under index M is greater than the next (M+1) that will be added by Bubble sort, then at the first step they will be swapped and the subarray will be sorted. However, if an insert and at least one selection operation were performed, then the Bubble sort loses its effectiveness and the array may remain in an unsorted state (Figure <ref type="figure">.</ref> 2).</p><p>To solve the above-mentioned problem, we will introduce new atomic operations -merge from the left (ML) and merge from the right (MR). Additional indicators will be used to track calls to insert operations. If an insert to the beginning (left) operation was used, the appropriate indicator will be set. Before you next call the Bubble sort or select operations on the current array, you will need to call the merge from the left operation first. That is, save the pointers of the sorted part on the left and the rest of the array for further merging. For a similar situation, the merge operation on the right will be called at the end of the array.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.">Application of the genetic algorithm to select the most effective sorting algorithm</head><p>A chromosome consists of a sequence of genes -basic sorting algorithms and auxiliary utilities. To represent a chromosome in text form, we set a text representation for each gene. Thus, the chromosome will have a sequence of genes separated by the symbol ",". Since each gene represents a function, we will use its abbreviation for the text representation. Consider existing genes:</p><p>• BSB (Bubble sort backward) -one pass through the array from the end to the beginning with the permutation of pairs of elements in the reverse order; • BSF (Bubble sort forward) -the same as BSB, only passing from the beginning to the end of the array; • FSB (Find swap biggest element) -search for the largest element in the unsorted part of the array and swap it to the current place; • FSS (Find swap smallest element) -the same as FSB, only the search for the smallest element is performed; • SEEI (Single element end insertion) -insertion of the current element into the sorted part at the end of the array; • SEI (Single element insertion) -insertion of the current element into the sorted part at the beginning of the array; • SIS (Split in subarrays) -dividing the unsorted part of the array into two equal parts for further sorting of each of them separately. Also storage of pointers and sizes of arrays for further execution of the merge operation; • FS (Final sort) -one of the well-known standard sorting algorithms, which is guaranteed to perform sorting; • PUA (Pop unsorted array) -get the pointer and size of the next unsorted part for sorting.</p><p>Executed for each part saved by the SIS operation; • ESS (End subarray sort) -an auxiliary operation that closes curly brackets opened by previous operations to check the sorting indicator. Executed for each PUA operation after the sort gene sequence; • ML (Merge left) -saving pointers to the sorted part at the beginning and the rest of the array for further merging into one sorted array; • MR (Merge right) -the same as ML only for the sorted part at the end of the array; • P (Partition) -choosing the pivot element, moving elements smaller than the pivot to the left and larger elements to the right. • An example of a formed chromosome in text form: • SEEI, MR, FSB, SIS, PUA, BSF, FSS, FS, ESS, PUA, SEI, ML, FSS, FS, ESS, ESS.</p><p>• To limit the length of the chromosome, we will introduce certain restrictions.</p><p>Initially, when sorting the input array, the depth is equal to one. When dividing the array and proceeding to sorting any of its parts, the depth increases by one. In this way, the number of partitioning of the array into parts is limited.</p><p>A separate parameter limits the number of basic sorting operations for each subarray. When the maximum value is reached, a split or final sort is called.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.1.">A genetic algorithm for generating sorting algorithms</head><p>Each individual represents a sorting algorithm. Atomic operations that are components of existing sorting algorithms and auxiliary utilities are represented by genes.</p><p>The fitness function that evaluates the quality of each individual is the time efficiency. But there can also be the following: the number of comparisons, the number of permutations or a weighted combination of those factors. Generation of the next population is carried out with the help of crossover and mutations. Crossover exchanges parts between two parents to create a new individual.</p><p>A mutation randomly changes some elements of the genetic sequence. Some parts of the chromosome are generated anew and atomic operations are randomly selected.</p><p>Individuals are selected for the next generation based on their fitness. Individuals with greater fitness are more likely to survive and participate in the creation of new individuals.</p><p>A certain number of individuals, with the best indicators, are transferred to the next generation without changes. Others are formed by crossing individuals of the existing population. Individuals for crossing can be chosen randomly or according to certain rules. It is also possible to crossover the best individuals according to the rules and the rest randomly. To diversify the population, a certain number of randomly generated individuals are added, just as in the first population.</p><p>Genetic algorithm parameters such as population size, mutation probability, number of generations, etc. are set. A stopping condition is defined, for example, the maximum number of generations or reaching a certain level of fitness.</p><p>Several iterations of the genetic search are performed, parameters and the fitness function are optimized to improve the results.</p><p>The application of the genetic algorithm to the generation of sorting algorithms allows for the automatic evolution of solutions intended for different scenarios and their adaptation to constantly changing conditions.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.2.">Representation of a chromosome in the form of a tree</head><p>The input array can have any percentage of sorting. Once the data in the array has been sorted, it is a good idea to terminate the execution to avoid degradation of time efficiency. We implement tracking of such a situation by using the array sorting flag, which will be checked after each basic sorting operation.</p><p>Constant updating and checking of the array sorting flag introduces additional rules and restrictions into the process of chromosome generation. In the code, each subsequent check adds a new level of nesting and scope, delimited by curly braces "{" and "}". Checking the sorting flag and opening the scope has each gene representing the basic sorting operation. Accordingly, the final section of the chromosome should have curly braces that close in the number equal to the number of open braces. When dividing the array into subarrays and sorting each separately, we will have a sequence of basic sorting operations and the corresponding number of closed brackets. The optimal data structure for representing the above-described approach is a binary tree (Figure <ref type="figure">.</ref> 3) Each node represents a part of the chromosome (sequence of genes) that corresponds to the sorting of a certain part of the array. Start and end gene sequences are stored separately. Child nodes are created when the array is partitioned and the parts of the array are sorted separately. For example, when an array is split into two equal parts, two descendant nodes are created. Each created node will have a part of the chromosome that implements the sorting of the corresponding part of the array. The end gene array will include a merge of sorted arrays and a current array sort finish gene, which includes closing curly braces and zeroing variables.</p><p>The generation of the algorithm from the chromosome should be based on the principle of the Depth-first traversal of the tree <ref type="bibr" target="#b19">[20]</ref>. That is, for each node, the genes are in the following sequence: 1. start genes; 2. genes of the first child node; 3. genes of the second child node; 4. end genes.</p><p>The tree chromosome crossover operation is performed as a node exchange. To preserve the depth of the chromosome tree, the exchange can be carried out only between nodes of the corresponding level. However, due to the fact that the leaf nodes at the last level have a final sorting gene, which is guaranteed to sort the array, it is possible to exchange between nodes of different levels.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.">Experiments</head><p>The purpose of the experiment is to check the ability of the developed method and the corresponding software to form time-efficient sorting algorithms in different hardware and software environments. In the performed experiments, one component of the hardware and software environment was varied, namely the features of the data to be sorted.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.1.">Software instrumental means of the experiment</head><p>An algorithm using different combinations of fragments of basic algorithms can have a fairly large number of their calls. If they are called as separate functions in the program, overhead costs can significantly affect the overall time of the algorithm. An alternative option for creating a combined algorithm was applied -the generation of the program text. This approach minimizes the number of function calls.</p><p>The program developed for experiments consists of modules:</p><p>• implementation of the genetic algorithm;</p><p>• formation of the text of the sorting program by the coded chromosome;</p><p>• compilation of the formed combined sorting algorithm;</p><p>• sorting of data arrays with execution time measurement.</p><p>Compilation of the formed sorting algorithm is performed using an external script -a .bat file which:</p><p>• copies the .cpp file to the appropriate directory;</p><p>• performs compilation and assembly, resulting in the formation of an .exe file. Starts the execution of the generated combined sorting algorithm.</p><p>Since the median sorting time of one algorithm for many data is measured, the same set of input arrays for all combined and control standard algorithms is used for sorting.</p><p>The results of each experiment are recorded by the auxiliary program in a text file</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.1.">Types of test data</head><p>Arrays of integers of various structures and volumes were created for conducting experiments. Structure 1 -an array of random numbers. It was filled with random numbers in the range [0, N], (N is the length of the array).</p><p>Structure 2 -the array is fully sorted. Structure 3 -the array is partially sorted. Sorting percentage. In a fully sorted array of length N, the unsorted percentage m is specified. The number of unsorted elements will be M=N*m. M is divided into k random numbers greater than or equal to 2, which will be written into the array K. Then, for each K[i], a random index j in the initial array is selected, such that j &lt; N-K[i]. Next, within the subarray N[j, j+K[i]], K[i] permutations of randomly selected elements are performed.</p><p>Structure 4 -the array is partially sorted. Several permutations. In a fully sorted array of length N, two indices (i and j) are selected, and the elements located at these indices are swapped. The operation is repeated k times. The indicator k is calculated by the formula k=std::min(int(arrayLength/1e5), 3).</p><p>Structure 5 -the array is sorted in reverse order. Experiments were performed on arrays with volumes ranging from one hundred thousand to one million elements in steps of one hundred thousand.</p><p>For each population, 51 arrays of sorted data of the appropriate structure were generated. They were stored in 51 binary files. Each individual of the population, which is a specific sorting algorithm, read the array of data from the file. Performed the sorting, checked that the sorting was completed successfully and saved the result (execution time) in an array. After sorting all input arrays, the median time was calculated and stored in a separate binary file. Thus, identical data were used for each individual.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.3.">Features of the genetic algorithm</head><p>The experiments were performed with the following parameters of the genetic algorithm:</p><p>• number of populations -10;</p><p>• number of individuals in each population -10;</p><p>• percentage of the best chromosomes that are transferred to the next population without changes -30; • the number of standard tested algorithms included in each population is 4: Quick sort, Merge sort, Insertion sort and Heapsort; • final sorting -Quick sort.</p><p>In order to limit the length of the chromosome, and accordingly the length of the generated sorting function, the chromosome generation process was controlled using the following parameters:</p><p>• the maximum number of algorithms before splitting. This parameter determined the maximum number of genes (algorithms) upon reaching which the gene for the final sorting or partitioning of the array was guaranteed to be selected depending on the current depth of the chromosome tree. In the case of selecting a gene for the array partition, two child nodes were added to the current node of the chromosome, and the gene selection process continued for them with a depth increased by one; • the maximum depth of the chromosome tree. At the beginning of the chromosome generation, the depth for the root node was zero. When selecting the array partitioning gene, two descendant nodes with a depth greater than that of the current node by one were added to the current node. If the depth is less than the maximum, the final sorting gene cannot be selected. Instead, the array partitioning gene is chosen. When the maximum depth is reached, instead of the array partitioning gene, the final sorting gene is selected and the child nodes are not added. In this way, a balanced chromosome tree with a given depth is constructed.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.">Results of experimental research</head><p>In the course of the experimental study, the six best chromosomes were determined, which showed the smallest sorting time under the given conditions. The execution time of the sorting algorithms corresponding to the selected chromosomes was compared with the execution time of the "standard" sorting algorithms: Quick sort, Heapsort, Insertion sort and Merge sort.</p><p>Figure <ref type="figure">.</ref> 4 shows the results of the experiment for arrays of structure 1 with a length of one million elements. Quick sort has the best sort time with a median time of 56 ms. The next are algorithms based on the best chromosomes with execution time of 60-70 ms. The next time has a Heapsort -96-97 ms. The penultimate result has Merge sort -139-142 ms. And the worst result, as expected, was shown by Insertion sort, which has a quadratic complexity -59-60 s. Due to the extremely large distance from the indicators of the rest of the algorithms, Insertion sort was not added to the graph. The same situation is observed on arrays of tested data with a length of 100,000-900,000. Quick sort always finishes first. Next, with indicators higher by 2-10%, there are algorithms formed by the best chromosomes. At the end of the list is a Heapsort, Merge sort and Insertion sort.</p><p>The chromosome with the best performance in the last population is SEI_ML_SIS_PUA_BSB_SIS_PUA_FS_ESS_PUA_SEEI_FSS_MR_FS_ESS_ESS_PUA_P_PUA_SEEI_M R_FSB_SEI_ML_FS_ESS_PUA_BSB_FS_ESS_ESS_ESS.</p><p>Chromosome decoding (each next level is an indentation -genes performed for the subarray after partitioning): The results of the experiment with data according to structure 2. Some algorithms execution time is less than one millisecond, so for this data type all results are presented in microseconds. Algorithms based on the best chromosomes starting with BSB (BubbleSortBackwards) and BSF (BubbleSortForward) genes turned out to be the fastest on small amounts of tested data. The speed is achieved by the fact that the algorithm makes one pass through the array in the forward (BSF) or reverse (BSB) direction, checking all pairs of elements. Since the array is sorted, no permutation is performed and the execution of the function ends immediately. Next, with the worst time indicators, there are standard algorithms in the following order: Insertion sort, Quick sort, Heapsort, and Merge sort. We can observe the same results on arrays of medium length. However, a slightly different picture is observed on large arrays.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Table 3</head><p>Median sorting time by structure 2 with a volume of 1000000 elements in microseconds The best time shows the Insertion sort. Then there are algorithms that are formed according to the best chromosomes. They all start with the SEI_BSF_ML gene sequence. That is, first an attempt is made to insert the second element into the sorted subarray on the left. Because of this, the indices increase and BSF will not process the entire array. The merge left (ML) helper function will then be called. In this way, redundant operations will be performed, which will increase the total time of the algorithm. Because the initial population did not have chromosomes starting with the BSB or BSF genes, and they were not generated when each new population was constructed, the bestchromosome-based algorithms performed worse in time than the standard Insertion sort.</p><p>For arrays according to structure 3, the results are quite similar for all array volumes. Quick sort is always better than others. The next by time efficiency are algorithms formed according to the best chromosomes, in which genes for split into subarrays (SIS) or Partition (P) are located at the beginning. Standard sorting algorithms have the largest time indicators: Heapsort, Merge sort and Insertion sort.  Insertion sort has the best result among all populations. Next comes Quick sorting. A little less efficiency (by 10-20%) was shown by constructed algorithms that were formed according to the best chromosomes. Heapsort and Mergesort turned out to be the worst.</p><p>On the different volumes of tested data arrays by structure 5 different chromosomes were selected. However, the general picture is the same for all data volumes The best time has the Quick sort. The next by time efficiency, with a significant lag (50-90%), there are algorithms based on the best chromosomes. And Heapsort, Merge sort and Insertion sort have significantly worse time efficiency under the given conditions.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.">Conclusions</head><p>Modern information technologies are based on processing large volumes of data. At the same time, the task of developing and applying effective algorithms for data processing, in particular sorting, remains relevant.</p><p>A genetic algorithm for structural adaptation of sorting algorithms was developed. Its use allows to carry out structural adaptation and choose the most effective and adapted to stable usage environments.</p><p>The presented approach to the formation of a chromosome in the form of a tree allows solving existing problems. It allows you to efficiently form chromosomes, the result of decoding of which will be an algorithm that is guaranteed to perform sorting.</p><p>The formalized model of the formation of sorting algorithms by means of constructivesynthesizing modeling is quite voluminous and will be presented in a separate article.</p><p>The developed software should be applied to adaptation of sorting algorithms to stable input data streams and usage environments.</p><p>The ability of the developed method and the corresponding software to form time-efficient sorting algorithms in various hardware and software environments has been experimentally confirmed.</p></div><figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_0"><head>Figure 1 :</head><label>1</label><figDesc>Figure 1: Block diagram of the meta-algorithm of program code generation/</figDesc><graphic coords="3,76.37,212.02,467.76,346.32" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_1"><head>Figure 2 :</head><label>2</label><figDesc>Figure 2: An example of an incorrect sequence of basic algorithms.</figDesc><graphic coords="4,67.00,430.53,433.44,125.52" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_2"><head>Figure 3 :</head><label>3</label><figDesc>Figure 3: Chromosome in tree shape diagram.</figDesc><graphic coords="6,94.32,504.82,362.64,300.72" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_3"><head>Figure 4 :</head><label>4</label><figDesc>Figure 4: Median sorting time by structure 1 with different sorting algorithms.</figDesc><graphic coords="10,93.88,92.52,433.44,216.48" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_1"><head>Table 1</head><label>1</label><figDesc>Median sorting time by structure 2 with a volume of 100000 elements in microseconds</figDesc><table><row><cell></cell><cell cols="4">Algorithms for the best chromosomes</cell><cell></cell><cell cols="4">Control standard algorithms</cell></row><row><cell>Chrom osome 1</cell><cell>Chrom osome 2</cell><cell>Chrom osome 3</cell><cell>Chrom osome 4</cell><cell>Chrom osome 5</cell><cell>Chrom osome 6</cell><cell>Quick sort</cell><cell>Heap sort</cell><cell>Merge sort</cell><cell>Insertion sort</cell></row><row><cell>23</cell><cell>23</cell><cell>24</cell><cell>25</cell><cell>29</cell><cell>34</cell><cell>752</cell><cell>4112</cell><cell>7867</cell><cell>44</cell></row></table></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_2"><head>Table 2</head><label>2</label><figDesc>Median sorting time by structure 2 with a volume of 500000 elements in microseconds</figDesc><table><row><cell></cell><cell cols="4">Algorithms for the best chromosomes</cell><cell></cell><cell cols="4">Control standard algorithms</cell></row><row><cell>Chrom osome 1</cell><cell>Chrom osome 2</cell><cell>Chrom osome 3</cell><cell>Chrom osome 4</cell><cell>Chrom osome 5</cell><cell>Chrom osome 6</cell><cell>Quick sort</cell><cell>Heap sort</cell><cell>Merge sort</cell><cell>Insertion sort</cell></row><row><cell>117</cell><cell>138</cell><cell>140</cell><cell>151</cell><cell>152</cell><cell>154</cell><cell cols="3">3962 22970 41716</cell><cell>229</cell></row></table></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_3"><head>Table 4</head><label>4</label><figDesc>Median sorting time by structure 3 with a volume of 100000 elements in milliseconds</figDesc><table><row><cell></cell><cell cols="4">Algorithms for the best chromosomes</cell><cell></cell><cell cols="4">Control standard algorithms</cell></row><row><cell>Chrom osome 1</cell><cell>Chrom osome 2</cell><cell>Chrom osome 3</cell><cell>Chrom osome 4</cell><cell>Chrom osome 5</cell><cell>Chrom osome 6</cell><cell>Quick sort</cell><cell>Heap sort</cell><cell>Merge sort</cell><cell>Insertion sort</cell></row><row><cell>17</cell><cell>17</cell><cell>17</cell><cell>17</cell><cell>17</cell><cell>17</cell><cell>15</cell><cell>51</cell><cell>82</cell><cell>105</cell></row><row><cell cols="10">For arrays according to structure 4 with a length of one million, 10 permutations were performed.</cell></row><row><cell cols="4">The results of the experiment are shown in</cell><cell></cell><cell></cell><cell></cell><cell></cell><cell></cell><cell></cell></row></table></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_4"><head>Table 5</head><label>5</label><figDesc></figDesc><table /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_5"><head>Table 5</head><label>5</label><figDesc>Median sorting time by structure 4 with a volume of 1000000 elements in milliseconds</figDesc><table><row><cell></cell><cell cols="4">Algorithms for the best chromosomes</cell><cell></cell><cell cols="4">Control standard algorithms</cell></row><row><cell>Chrom osome 1</cell><cell>Chrom osome 2</cell><cell>Chrom osome 3</cell><cell>Chrom osome 4</cell><cell>Chrom osome 5</cell><cell>Chrom osome 6</cell><cell>Quick sort</cell><cell>Heap sort</cell><cell>Merge sort</cell><cell>Insertion sort</cell></row><row><cell>15</cell><cell>15</cell><cell>16</cell><cell>16</cell><cell>17</cell><cell>18</cell><cell>13</cell><cell>50</cell><cell>83</cell><cell>2</cell></row></table></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_6"><head>Table 6</head><label>6</label><figDesc>Median sorting time by structure 5 with a volume of 1000000 elements in milliseconds Algorithms for the best chromosomes</figDesc><table><row><cell>Control standard algorithms</cell></row></table></figure>
		</body>
		<back>
			<div type="references">

				<listBibl>

<biblStruct xml:id="b0">
	<monogr>
		<ptr target="https://www.forbes.com/sites/forbestechcouncil/2023/09/07/20-issues-tech-companies-are-facing-now-and-how-to-address-them/" />
		<title level="m">Issues Tech Companies Are Facing Now (And How To Address Them</title>
				<imprint/>
	</monogr>
</biblStruct>

<biblStruct xml:id="b1">
	<analytic>
		<title level="a" type="main">Zabula Tools of investigation of time and functional efficiency of bionic algorithms for function optimization problems</title>
		<author>
			<persName><forename type="first">V</forename><surname>Shynkarenko</surname></persName>
		</author>
		<author>
			<persName><forename type="first">P</forename><surname>Ilchenko</surname></persName>
		</author>
		<author>
			<persName><forename type="first">H</forename></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Proceedings of the 11th International Conference of Programming (UkrPROG 2018)</title>
		<title level="s">CEUR-WS Team</title>
		<meeting>the 11th International Conference of Programming (UkrPROG 2018)<address><addrLine>Kyiv</addrLine></address></meeting>
		<imprint>
			<date type="published" when="2018">2018</date>
			<biblScope unit="volume">2139</biblScope>
			<biblScope unit="page" from="270" to="280" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b2">
	<monogr>
		<title level="m" type="main">Database Systems: The Complete Book</title>
		<author>
			<persName><forename type="first">H</forename><surname>Garcia-Molina</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><forename type="middle">D</forename><surname>Ullman</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><surname>Widom</surname></persName>
		</author>
		<imprint>
			<date type="published" when="2008">2008</date>
			<publisher>Pearson</publisher>
		</imprint>
	</monogr>
	<note>2nd ed</note>
</biblStruct>

<biblStruct xml:id="b3">
	<monogr>
		<title level="m" type="main">Practical Data Science with Hadoop and Spark</title>
		<author>
			<persName><forename type="first">O</forename><surname>Mendelevitch</surname></persName>
		</author>
		<author>
			<persName><forename type="first">C</forename><surname>Stella</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><surname>Eadline</surname></persName>
		</author>
		<imprint>
			<date type="published" when="2016">2016</date>
			<publisher>Addison-Wesley</publisher>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b4">
	<analytic>
		<title level="a" type="main">Analysis and Comparative of Sorting Algorithms</title>
		<author>
			<persName><forename type="first">H</forename><forename type="middle">H</forename><surname>Aung</surname></persName>
		</author>
		<idno type="DOI">10.31142/ijtsrd26575</idno>
	</analytic>
	<monogr>
		<title level="j">International Journal of Trend in Scientific Research and Development</title>
		<imprint>
			<biblScope unit="volume">3</biblScope>
			<biblScope unit="issue">5</biblScope>
			<biblScope unit="page" from="1049" to="1053" />
			<date type="published" when="2019">2019</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b5">
	<analytic>
		<title level="a" type="main">Establishing pertinence between Sorting Algorithms prevailing in n log (n) time</title>
		<author>
			<persName><forename type="first">M</forename><forename type="middle">R</forename><surname>Choudhury</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Dutta</surname></persName>
		</author>
		<idno type="DOI">10.21203/rs.3.rs-1754555/v1</idno>
	</analytic>
	<monogr>
		<title level="j">J Robot Auto Res</title>
		<imprint>
			<biblScope unit="volume">3</biblScope>
			<biblScope unit="issue">2</biblScope>
			<biblScope unit="page" from="220" to="226" />
			<date type="published" when="2022">2022. 2022</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b6">
	<monogr>
		<author>
			<persName><forename type="first">D</forename><surname>Knuth</surname></persName>
		</author>
		<title level="m">The Art Of Computer Programming</title>
				<imprint>
			<publisher>Addison-Wesley</publisher>
			<date type="published" when="1973">1973</date>
			<biblScope unit="volume">3</biblScope>
		</imprint>
	</monogr>
	<note>Sorting And Searching</note>
</biblStruct>

<biblStruct xml:id="b7">
	<monogr>
		<title level="m" type="main">Stein Introduction to algorithms</title>
		<author>
			<persName><forename type="first">T</forename><forename type="middle">H</forename><surname>Cormen</surname></persName>
		</author>
		<author>
			<persName><forename type="first">C</forename><forename type="middle">E</forename><surname>Leiserson</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><forename type="middle">L</forename><surname>Rivest</surname></persName>
		</author>
		<author>
			<persName><forename type="first">C</forename></persName>
		</author>
		<imprint>
			<date type="published" when="2009">2009</date>
			<publisher>The MIT Press</publisher>
			<pubPlace>Cambridge, MA</pubPlace>
		</imprint>
	</monogr>
	<note>3rd ed</note>
</biblStruct>

<biblStruct xml:id="b8">
	<analytic>
		<title level="a" type="main">Bidirectional Conditional Insertion Sort algorithm; An efficient progress on the classical insertion sort</title>
		<author>
			<persName><forename type="first">A</forename><forename type="middle">S</forename><surname>Mohammed</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Ş</forename><forename type="middle">E</forename><surname>Amrahov</surname></persName>
		</author>
		<author>
			<persName><forename type="first">F</forename><forename type="middle">V</forename><surname>Çelebi</surname></persName>
		</author>
		<idno type="DOI">10.1016/j.future.2017.01.034</idno>
	</analytic>
	<monogr>
		<title level="j">Future Generation Computer Systems</title>
		<imprint>
			<biblScope unit="volume">71</biblScope>
			<biblScope unit="page" from="102" to="112" />
			<date type="published" when="2017">2017. 2017</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b9">
	<analytic>
		<title level="a" type="main">Munro Multi-pivot quicksort: theory and experiments</title>
		<author>
			<persName><forename type="first">S</forename><surname>Kushagra</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>López-Ortiz</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Qiao</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><forename type="middle">I</forename></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Proc. Sixteenth Workshop on Algorithm Engineering and Experiments (ALENEX)</title>
				<meeting>Sixteenth Workshop on Algorithm Engineering and Experiments (ALENEX)</meeting>
		<imprint>
			<date type="published" when="2014">2014</date>
			<biblScope unit="page" from="47" to="60" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b10">
	<analytic>
		<title level="a" type="main">Enhanced quicksort algorithm</title>
		<author>
			<persName><forename type="first">R</forename><surname>Mansi</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Int. Arab J. Inf. Technol</title>
		<imprint>
			<biblScope unit="volume">7</biblScope>
			<biblScope unit="issue">2</biblScope>
			<biblScope unit="page" from="161" to="166" />
			<date type="published" when="2010">2010</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b11">
	<analytic>
		<title level="a" type="main">Gupta Comparative study of various stable and unstable sorting algorithms</title>
		<author>
			<persName><forename type="first">R</forename><surname>Yadav</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><surname>Yadav</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><forename type="middle">B</forename></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Artificial Intelligence and Speech Technology</title>
				<imprint>
			<publisher>CRC Press</publisher>
			<date type="published" when="2021">2021</date>
			<biblScope unit="page" from="463" to="477" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b12">
	<monogr>
		<ptr target="https://svn.python.org/projects/python/trunk/Objects/listsort.txt" />
		<title level="m">Timsort</title>
				<imprint/>
	</monogr>
</biblStruct>

<biblStruct xml:id="b13">
	<analytic>
		<title level="a" type="main">Introspective Sorting and Selection Algorithms</title>
		<author>
			<persName><forename type="first">D</forename><forename type="middle">R</forename><surname>Musser</surname></persName>
		</author>
		<idno type="DOI">10.5555/261387.261395</idno>
	</analytic>
	<monogr>
		<title level="j">Software: Practice and Experience</title>
		<imprint>
			<biblScope unit="issue">27</biblScope>
			<biblScope unit="page" from="983" to="993" />
			<date type="published" when="1997">1997</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b14">
	<analytic>
		<title level="a" type="main">Comparison study of sorting techniques in static data structure</title>
		<author>
			<persName><forename type="first">A</forename><surname>Frak</surname></persName>
		</author>
		<idno type="DOI">10.30880/ijie.2018.10.06.014</idno>
	</analytic>
	<monogr>
		<title level="j">International Journal of Integrated Engineering: Special Issue Data Information Engineering</title>
		<imprint>
			<biblScope unit="volume">10</biblScope>
			<biblScope unit="issue">6</biblScope>
			<biblScope unit="page" from="106" to="112" />
			<date type="published" when="2018">2018</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b15">
	<analytic>
		<title level="a" type="main">Data Stochastic Preprocessing for Sorting Algorithms</title>
		<author>
			<persName><forename type="first">V</forename><forename type="middle">I</forename><surname>Shinkarenko</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Yu</surname></persName>
		</author>
		<author>
			<persName><forename type="first">O</forename><forename type="middle">A</forename><surname>Doroshenko</surname></persName>
		</author>
		<author>
			<persName><forename type="first">V</forename><forename type="middle">V</forename><surname>Yatsenko</surname></persName>
		</author>
		<author>
			<persName><forename type="first">K</forename><forename type="middle">K</forename><surname>Raznosilin</surname></persName>
		</author>
		<author>
			<persName><surname>Galanin</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Proceedings of the 13th International Scientific and Practical Programming Conference UkrPROG</title>
				<meeting>the 13th International Scientific and Practical Programming Conference UkrPROG</meeting>
		<imprint>
			<date type="published" when="2022">2022</date>
			<biblScope unit="volume">3501</biblScope>
			<biblScope unit="page" from="29" to="38" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b16">
	<monogr>
		<author>
			<persName><forename type="first">A</forename><surname>Doroshenko</surname></persName>
		</author>
		<author>
			<persName><forename type="first">O</forename></persName>
		</author>
		<title level="m">Yatsenko Formal and adaptive methods for automation of parallel programs construction: emerging research and opportunities</title>
				<meeting><address><addrLine>Hershey</addrLine></address></meeting>
		<imprint>
			<publisher>IGI Global</publisher>
			<date type="published" when="2021">2021</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b17">
	<monogr>
		<title level="m" type="main">Adaptation in Natural and Artificial Systems</title>
		<author>
			<persName><forename type="first">J</forename><forename type="middle">H</forename><surname>Holland</surname></persName>
		</author>
		<imprint>
			<date type="published" when="1992">1992</date>
			<publisher>The MIT Press</publisher>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b18">
	<analytic>
		<title level="a" type="main">An Overview of Evolutionary Algorithms: Practical Issues and Common Pitfalls</title>
		<author>
			<persName><forename type="first">D</forename><surname>Whitley</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Journal of Information and Software Technology</title>
		<imprint>
			<biblScope unit="volume">43</biblScope>
			<biblScope unit="issue">14</biblScope>
			<biblScope unit="page" from="817" to="831" />
			<date type="published" when="2001">2001</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b19">
	<analytic>
		<title level="a" type="main">Depth-First Search and Linear Graph Algorithms</title>
		<author>
			<persName><forename type="first">R</forename><surname>Tarjan</surname></persName>
		</author>
		<idno type="DOI">10.1137/0201010</idno>
	</analytic>
	<monogr>
		<title level="j">SIAM Journal on Computing</title>
		<imprint>
			<biblScope unit="issue">1</biblScope>
			<date type="published" when="1972">1972</date>
		</imprint>
	</monogr>
</biblStruct>

				</listBibl>
			</div>
		</back>
	</text>
</TEI>
