The simulations for Guangzhou and Beijing scenarios are presented in panels a-d and e-h, respectively. Multiple rounds of testing for detecting infections were implemented using spatial sampling and incorporated into the travel network-based epidemiological model (Additional file 1: Text S6). The epidemiological model simulated the epidemic transmission, measured by the daily cumulative cases, under different sampling approaches and outbreak scenarios. The baseline approach of multi-round testing involved the equal allocation of daily testing resources to all communities within a city. However, simple random sampling (SRS), case flow intensity (CFI), and case transmission intensity (CTI) sampled a given number of communities per day and allocated more resources to sampled communities than unsampled areas. Spatial multiple rounds of testing were executed when a community could be sampled several times. The outbreaks were tested under different settings, including various basic reproduction numbers (R0) of the original SARS-CoV-2, Delta, and Omicron variants, and the timing of testing conduction. Detection testing started on the fifth day of an outbreak for panels a-b and e-f, while it began on the twelfth day of the outbreak for panels c-d and g-h. The shaded regions represent the interquartile ranges of the cumulative number of daily cases in the simulated outbreaks.