# Evaluating Algorithm Efficiency for Optimizing Experimental Designs with Correlated Data
## Materials and Methods
### Algorithms  
The algorithms implemented to generate improved designs are:  
1. Simple Pairwise (SP), that swaps a single pair of treatments at a time,
2. Greedy Pairwise (GP), that swaps more than a single pair of treatments at a time,
3. Genetic Neighbourhood (GN), that takes into consideration the genetic relatedness of the direct neighbouring of a experimental units to perform swaps, and
4. Simulated Annealing (SA), that swaps a pair of treatments at a time, but accepts poor designs at random with a given probability which diminishes with time. The procedure for these algorithms involves randomly generating \(m\) initial experimental layouts, denoted as \(\Omega_{i}\). For each layout, the variance-covariance matrix of the treatment effects \(\mathbf{M}(\Omega)\) is obtained, and its criterion value is calculated (as trace or determinant (or log(determinant)) with \(A\)- and \(D\)-optimality, respectively). Next, from the \(m\) designs, the \"best\" experimental layout is selected, where \"best\" refers to the design with the smallest trace under \(A\)-optimality and design with the largest determinant under the \(D\)-optimality. After this, an optimization algorithm is applied for \(p\) iterations. For all implemented algorithms, the output is a list of objects including the improved experimental layout, a vector with criterion values and iterations of the sequentially accepted (successful) designs, and a vector of all criterion values from all iterations, whether the swap was successful or not. Following is a description of the implemented algorithms. For the SP algorithm, the following steps are undertaken after selecting the best initial \(\Omega_{i}\) with criteria value \(\tau_{i}:(1)\) randomly interchange a single pair of treatments within a randomly selected block to produce a new layout, \(\tau_{i}\) ; (2) re-calculate a new criterion value \(\tau_{j}\) ; (3) if \(\tau_{i}>\tau_{j}\), accept \(\Omega_{j}\) as the new layout; and (4) repeat steps 1 to 3 for a total of \(p\) iterations and produce the output. GP algorithms are a more aggressive variant of the simple pairwise algorithm (SP) that allow multiple treatments to be randomly interchanged within a block. In order to evaluate a spectrum of alternative implementations, this algorithm was implemented by varying the number of treatments to be swapped simultaneously, denoted as \(G\alpha\), where \(\alpha\) refers to the number of treatments swapped. The implemented algorithm allows specification of any even number of treatments to be swapped at a time. Tested procedures were denoted as GP4, GP14 and GP98 for randomly swapping 4, 14 and 98 treatments simultaneously on each iteration within a randomly selected block, respectively. Numbers 14 and 98 were chosen as a percentage (\(\approx\)50%) of the treatments to be swapped at a time, in an experiment with 30 and 196 treatments, respectively, whereas 4 was chosen as a close value to 2 to detect any small changes in improvement of the design when a single pair or double pairs of treatments are swapped in each iteration. Steps 1 to 4 apply as described under the SP procedure. The GN algorithm is defined as a method that makes use of genetic relatedness of the eight neighbouring experimental units found in a 3 \(\times\) 3 matrix using information provided by the numerator relationship matrix (**A**) of the corresponding genotypes.