# Evaluating Algorithm Efficiency for Optimizing Experimental Designs with Correlated Data
## Materials and Methods
### Algorithms
Steps for this algorithm are: (1) randomly generate \(m\) initial designs and select the best (\(\Omega_{i}\)) with the smallest trace, \(\tau_{i}\) ; (2) randomly select a treatment \(t_{l}\) from \(\Omega_{i}\); (3) identify the genetic correlation coefficients from the numerator relationship matrix for all experimental units within the nearest neighborhood of \(\tau_{l}\) ; (4) if there exists a pairwise genetic relationship of 0.25 or higher between \(\tau_{l}\) and any other treatment \(\tau_{k}\) for \(l\
eq k\) within the neighbouring matrix, then replace either one of the treatments with a another treatment that is at a distance of more than a unit (row or column) away; (5) if there are no treatments further than a unit away even though these neighbours are genetically correlated, randomly interchange \(\tau_{l}\) with \(\tau_{k}\) ; (6) calculate the new criterion value, \(\tau_{j}\), based on the new design layout \(\Omega_{j}\); (7) if \(\tau_{i}>\tau_{j}\), accept \(\Omega_{j}\), otherwise reject \(\Omega_{j}\); and (8) repeat steps 2 to 7 for a total of \(p\) iterations. Note that if all the experimental units from a neighbourhood are genetically unrelated, then the SP is applied. SA is a probabilistic meta-heuristic and stochastic optimization procedure that prevents the search from getting trapped in a local optima by accepting some solutions with a set probability and lowering the temperature with time to make sure that poorer solutions are accepted with lower probabilities [14]. The SA algorithm implemented in this study is described as follows: (1) randomly interchange a pair of treatments within a randomly selected block to produce a new layout, \(\Omega_{j}\) and re-calculate a criterion value, \(\tau_{j}\); (2) if \(\tau_{i}>\tau_{j}\), accept \(\Omega_{j}\) as the new layout with probability 1.0; else do the following step, (3) calculate \(\triangle=\tau_{j}-\tau_{i}\) and set a cooling temperature \(T_{c}[i]=1/i\), for the \(i\)-th iteration, and calculate \(v=\exp{(-\triangle\ /T_{c}[i])}\); (4) draw a random value \(u\) from a uniform distribution, and if \(u<v\) accept \(\Omega_{j}\); and (5) repeat steps 1 to 4 for a total of \(p\) iterations. The SA method has two parameters that have to be tuned, i.e., initial temperature and cooling rate. In this study, the initial temperatures are the initial criterion values (that is, traces or determinants) of the initial designs before optimization process. The starting initial temperature was chosen to be the best criterion value among the initial designs. For instance, under the \(A\)-optimality criterion, choose a design that has the smallest trace (equivalent to starting temperature) as the main initial design to be optimized further. The cooling rate was viewed as part of step 3 above, and also, it can be viewed as a stopping rule. For example, the stopping rule can be the difference between the current criterion value and the previously calculated value (say, a difference of 0.05) observed for a consecutive number of iterations. The stopping rule for the motivating example was set to be the number of iterations \(p\) = 20,000 and for all other illustrations, it was set to \(p\) = 5000 interactions.