# Dynamic SAFFRON: Disease Control Over Time via Group Testing
## 4 Numerical Results  
In our simulations, we implement the dynamic discrete SIR-based infection spread system. We initialize our system with random independent initial infections with probability \(p\) and in following time instances, we simulate the random disease spread from non-isolated infections to susceptible individuals, independently with probability \(q\). For both dynamic algorithms, we run our system for 500 time instances and iterate realizing this dynamic system for 1000 times. We save the sample path trajectories of the random processes \(\alpha(t)\), \(\lambda(t)\) and \(\gamma(t)\), take their averages and plot.  
To control disease spread, in our first simulation, we implement the dynamic individual testing algorithm, where randomly selected \(T\) individuals are individually tested at each time instance. Here, by using our theoretical result in Theorem 2, we have \(\tilde{t}_{e}=235.57\) when \(\epsilon=1\). This is consistent with the numerical results plotted in Figure 1. In our second simulation, we implement a hybrid version of the dynamic SAFFRON-based group testing algorithm. At each time instance, we randomly select groups of people where each group has one infection in average, where we use the expected \(\lambda(t)\) that we calculate by using Lemma 3, to obtain the group size. Then, we construct SAFFRON scheme-based test sub-matrices for each of these groups and perform tests, with maximum \(T\) tests in total. In practice, SAFFRON scheme-based construction can have a non-utilized testing capacity at each discrete time instance due to the fact that the testing capacity \(T\) may not be divisible by the calculated group size. We further utilize these available testing capacities and perform random individual testing when non-utilized tests remain. Moreover, later in the testing process, since the expected \(\lambda(t)\) becomes smaller, the calculated group size grows larger and the required number of tests for SAFFRON-based construction exceeds the testing capacity \(T\). For these later times in the testing process, we switch to the dynamic individual testing algorithm to detect and isolate the remaining infections. We also plot the theoretical calculation of expected \(\lambda(t)\) in Figure 2, where we use Lemma 3 for calculation, which align with the numerical results that we obtain, as we plot in Figure 2. We observe that the steady state mean number of susceptible individuals is slightly higher in the dynamic individual testing algorithm while the convergence time is slightly lower in the dynamic SAFFRON-based group testing algorithm. This observation for this set of parameters suggests that both algorithms can be used to optimize different performance metrics, depending on the system requirements and parameters, as well as hybrid usage of the dynamic algorithms is also possible as in our hybrid dynamic SAFFRON-based group testing algorithm implementation.  
Figure 1: Numerical averages of the random processes \(\alpha(t)\), \(\lambda(t)\) and \(\gamma(t)\) for the system parameters \(n=1000\), \(T=30\), \(q=0.00001\), \(p=0.2\), for dynamic individual testing algorithm.