# Dynamic Infection Spread Model Based Group Testing
## 5 Numerical Results  
In our numerical results, we implement the algorithms that we proposed: dynamic Dorfman type group testing algorithm, dynamic individual testing algorithm and the weak versions of these algorithms. In all of our simulations, we start with \(n\) individuals with all of them susceptible. Then, at time \(t=0\), we realize the initial infections in the system uniformly randomly with probability \(p\). At each time instance that follows, for the infection spread phase, we simulate the random infection spread from the non-isolated infections to the susceptible individuals. For the testing phase, we simulate the random selection of individuals to be tested and perform the tests. Depending on the test results, we simulate the isolation of the detected infections. We repeat these phases at each time instance until time \(t=500\), and obtain the sample paths of the random processes \(\alpha(t)\), \(\lambda(t)\) and \(\gamma(t)\). We iterate this whole process \(1000\) times to obtain \(1000\) sample paths of the random processes, and then we calculate the average of the sample paths to obtain the expected values of \(\alpha(t)\), \(\lambda(t)\) and \(\gamma(t)\), numerically. In Figures 1-3, we plot these expected values of \(\alpha(t)\), \(\lambda(t)\) and \(\gamma(t)\) for the algorithms that we propose. In our simulations, we also consider the value of the theoretical approximation result that we obtained in Theorem 1. For each sample path, at each time instance, we numerically calculate the values of \(p^{\prime}(t)\) for both dynamic individual testing and dynamic [PERSON] type group testing algorithms, and then use the expression that we obtained in Theorem 1 to calculate the \(\alpha(t)\) approximation curve. We calculate and plot the average of the \(\alpha(t)\) approximation curve. For the weak versions of the proposed algorithms, we use the results of Theorems 2 and 3 to directly calculate and plot the steady state approximations of \(\alpha(t)\). Pseudo-code of the simulations that we perform is given below in Algorithm 1. ```
\(i\gets 1\)\(\triangleright\) Simulations are repeated to obtain average sample paths. while\(i\leq i_{max}\)do \(t\gets 0\) \(U\gets 0_{nx1}\) for individual \(j\) in \([n]\)do ifrandom roll in \([0,1]\leq p\)then \(U_{j}\gets 1\) endif endfor \(t\gets 1\)\(\triangleright\) Initial infections are realized while\(t\leq t_{max}\)do for individual \(j\) in infections do for individual \(k\) in susceptibles do ifrandom roll in \([0,1]\leq q\)then \(U_{k}\gets 1\) endif endfor endfor for for test \(\tau\) in \([T]\)do \(y_{\tau}\leftarrow\bigvee_{j\in[n]}\mathbf{X}_{\tau j}\mathbb{1}_{\{\lambda_{ j}=1\}}\)  endfor \(\triangleright\) Testing is done for individual \(j\) in [n]do if\(j\) has infection and detected then \(U_{j}\gets 2\) endif endfor \(t\gets t+1\)\(\triangleright\) Recovery is done  endwhile endwhile \(\triangleright\) Averages of \(\alpha(t),\lambda(t),\gamma(t)\) are calculated over iterations \(i\)
```  
**Algorithm 1** Simulations to Obtain Numerical Results. Figure 1: \(Cont.\)  
Figure 1: Average values of the random processes \(\alpha(t)\), \(\lambda(t)\) and \(\gamma(t)\), with obtained theoretical approximations given in Theorems 1–3 when \(n=1000\), \(T=80\), \(q=0.00003\), \(p=0.2\), for (**a**) dynamic Dorfman type group testing algorithm, (**b**) dynamic individual testing algorithm, (**c**) weak dynamic Dorfman type group testing algorithm, (**d**) weak dynamic individual testing algorithm. Figure 2: Average values of the random processes \(\alpha(t)\), \(\lambda(t)\) and \(\gamma(t)\), with obtained theoretical approximations given in Theorem 1 when \(n=1000\), \(T=80\), \(q=0.0001\), \(p=0.01\), for (**a**) dynamic Dorfman type group testing algorithm, (**b**) dynamic individual testing algorithm, (**c**) weak dynamic Dorfman type group testing algorithm, (**d**) weak dynamic individual testing algorithm. In Figure 1, we present numerical results for the system with the parameters \(n=1000\), \(T=80\), \(q=0.00003\) and \(p=0.2\).