## Main

As of 30 March 2020, the outbreak of COVID-19, which is caused by the severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2), has resulted in 693,282 confirmed cases and 33,106 deaths across the world6. As the disease has only recently emerged, effective pharmaceutical interventions are not expected to be available for months7, and healthcare resources will be limited for treating all cases. Non-pharmaceutical interventions (NPIs) are therefore essential components of the public health response to COVID-19 outbreaks6,8,9,10. These include the isolation of individuals who are ill, contact tracing, quarantine of exposed individuals, travel restrictions, school and workplace closures, cancellation of mass gatherings, and hand-washing, among others8,9,10. Such measures aim to reduce the transmission of the virus by delaying the timing and reducing the size of the peak of the epidemic, thus buying time for preparations to be made in the healthcare system and creating the potential for vaccines and drugs to be used at a later stage8.

Three major groups of NPIs have been implemented to contain the spread and reduce the size of the outbreak of COVID-19 across China11. First, intercity travel restrictions were used to prevent further seeding of the virus during the Chinese New Year holiday period. A cordon sanitaire of Wuhan and surrounding cities in Hubei province was put in place on 23 January 2020, two days before the Chinese New Year, which started on 25 January 2020. After this date, travel restrictions were also put in place in other provinces across the country. Second, the early identification and isolation of cases was prioritized, including improving the screening, identification, diagnosis, isolation, reporting and contact tracing of people who were suspected or confirmed to have the disease11. Local governments across China encouraged and supported the routine screening and quarantine of travellers from Hubei province in an attempt to detect COVID-19 infections as early as possible. The average interval from the onset of symptoms to laboratory confirmation dropped from 12 days in the early stages of the outbreak to 3 days in early February, indicating that these efforts improved detection and diagnosis3,12. Third, contact restrictions and social distancing measures, together with personal preventive actions such as hand-washing, were implemented to reduce the risk of exposure at the community level. As part of these social distancing policies, the Chinese government encouraged people to stay at home as much as possible, cancelled or postponed large public events and mass gatherings, and closed libraries, museums and workplaces13,14. School holidays were also extended, with the end date of the Chinese New Year holiday period changed from 30 January 2020 to 10 March 2020 for Hubei province, and to 9 February 2020 for many other provinces15,16.

The implementation of these NPIs coincided with a rapid decline in the number of new cases across China, albeit at high economic and social costs3,12. Previous studies have examined the effects of the lockdown of Wuhan17,18, travel restrictions19, airport screening20, isolation of cases and contact tracing on the containment of the disease21. However, a comprehensive and quantitative comparison of the effectiveness of different NPIs, and the time at which they were implemented, for containing the outbreak of COVID-19 in China is lacking. On the basis of epidemiological data on COVID-19 and historical and near-real-time anonymized data on human movement, we developed a stochastic susceptible–exposed–infectious–removed (SEIR) modelling framework based on travel networks to simulate the spread of COVID-19 across 340 prefecture-level cities in mainland China. Within each city, we estimated the numbers of susceptible, exposed, infectious, and recovered/removed (‘removed’ refers to the individuals who were isolated to prevent further transmission, and deceased individuals) people per day from 1 December 2019. Using this modelling framework, we conducted before-and-after comparable analyses to quantify the relative effect of the three major groups of NPIs—that is, the restriction of intercity population movement, the identification and isolation of cases, and the reduction of travel and contact within cities to increase social distance—in China. We also assessed the risk of COVID-19 transmission since the lifting of travel restrictions on 17 February 2020.

## Reconstructing the spread of COVID-19

The epidemiological parameters that were estimated for the early stage of the outbreak in Wuhan were initially used to parameterize the epidemic before interventions were widely implemented5. The three major groups of NPIs outlined above were derived and measured using data on population movement between and within cities (obtained from smartphone users of Baidu location-based services4) and data on the delay between the onset of illness and the reporting of cases across the country. Population travel and contact patterns changed substantially after the implementation of interventions, and the timeliness of case reporting also improved (Fig. 1, Supplementary Tables 1, 2). These indicators were then incorporated into the model (see Methods).

We estimated that there were a total of 114,325 cases of COVID-19 (interquartile range (IQR) 76,776–164,576) in mainland China as of 29 February 2020, 85% of which were in Hubei province (Extended Data Table 1). The outbreak increased exponentially before Chinese New Year, but the peaks of epidemics across the country quickly appeared around the time of Chinese New Year after the implementation of NPIs. The estimated epidemics and peaks were consistent with patterns of reported data by onset date, with strong correlations between daily estimates and reported data across time and regions (Extended Data Fig. 1). The overall correlation between the estimated number of cases and the reported number by province, as of 29 February 2020, was also significant (P < 0.001, R2 = 0.86), with a high sensitivity (91%, 280/308) and specificity (69%, 22/32) in predicting cities with or without cases of COVID-19 (Extended Data Fig. 1a, b).

## Quantifying the effect of different NPIs

Without NPIs, our model predicted the number of cases of COVID-19 to increase rapidly across China, with a 51-fold (IQR 33–71) increase in Wuhan, a 92-fold (58–133) increase in other cities in Hubei province and a 125-fold (77–180) increase in other provinces by 29 February 2020. However, the apparent effectiveness of different interventions varied (Fig. 2). The lockdown of Wuhan might not have prevented the seeding of the virus from the city, as the travel ban was put in place at the latter stages of population movement out of the city before Chinese New Year22 (Fig. 1b). Nevertheless, if intercity travel restrictions had not been implemented, cities and provinces outside of Wuhan would have received more cases from Wuhan, and the affected geographical range would have expanded to the remote western areas of China (Extended Data Fig. 2c). In general, we estimated that the early detection and isolation of cases quickly and substantially prevented more infections than did the introduction of contact reduction and social distancing measures across the country (5-fold versus 2.6-fold). However, without the contact reduction intervention, in the longer term the epidemics would have increased exponentially across regions (Fig. 2c, f). Therefore, combined NPIs would bring about the strongest and most rapid effect on containment of the COVID-19 outbreak, with an interval of about one week between the introduction of NPIs and the peak of the epidemic (Extended Data Table 1).

## Timing of interventions

Our model suggests that, theoretically, if interventions in China had been implemented one week, two weeks or three weeks earlier than they actually were, the number of cases of COVID-19 could have been reduced by 66% (IQR 50–82%), 86% (81–90%) or 95% (93–97%), respectively (Fig. 3a). The geographical range of affected areas would also shrink from 308 cities to 192, 130 or 61 cities, respectively (Extended Data Fig. 3). However, if NPIs had been introduced one week, two weeks or three weeks later than they were, the number of cases might have increased by 3-fold (IQR 2–4), 7-fold (5–10) or 18-fold (11–26), respectively (Fig. 3b).

## Lifting of travel restrictions

Under the interventions that were implemented from 17 February 2020—that is, the lifting of travel restrictions—the epidemics outside of Hubei province probably reached a low level (fewer than 10 cases per day, excluding imported cases from other countries) in early March, whereas Hubei province might need another four weeks to reach the same level as other provinces. However, if population contact resumed to normal levels, the lifting of travel restrictions might cause case numbers to rise again (Fig. 3c). Accordingly, our simulations suggest that maintaining social distancing even to a limited extent (for example, a 25% reduction in contact between individuals on average) through to late April would help to ensure control of COVID-19 in epicentres such as Wuhan.

Our estimates were sensitive to the basic reproduction number (R0); under a higher R0 value, the peaks of epidemics were higher and later, and more time was needed to contain the outbreak (Extended Data Fig. 3). Sensitivity analyses also suggested that our model could have robustly measured relative changes in the efficacy of interventions under different epidemiological parameters and transmission scenarios (Extended Data Figs. 49).

## Discussion

Our findings show that combined NPIs substantially reduced the transmission of COVID-19 across China. Earlier implementation of NPIs could have notably reduced the magnitude and geographical range of the outbreak, but—equally—a delayed response would have led to a larger outbreak. China’s aggressive, multifaceted response is likely to have prevented a far worse situation, which would have accelerated the spread of the virus globally. The evidence from China provides information that will be of use in efforts to contain the spread of COVID-19 and mitigate the effects of the disease in other regions around the world3,12.

Our results suggest three key points. First, they support and validate the idea that population movement and close contact has a major role in the spread of COVID-19 within and beyond China22,23. As the lockdown of Wuhan happened at the latter stages of population movement before Chinese New Year, travel restrictions did not halt the seeding of the virus from Wuhan, but did prevent cases being exported from Wuhan to a wider area. Second, the importance and effects of the three types of NPIs differed. Compared with travel restrictions, improved detection and isolation of cases, as well as social distancing, probably had a greater effect on the containment of the outbreak. The social distancing intervention reduced contact between people who travelled from the epicentre of the outbreak and other individuals. This is likely to have been especially helpful in curbing the spread of an emerging pathogen to the wider community, and to have reduced the risk of spread from asymptomatic or mild infections8. Third, given that travel and work have begun to resume in China, the country should consider at least the partial continuation of NPIs to ensure that the COVID-19 outbreak is sustainably controlled for the first wave of this outbreak. For example, the early identification and isolation of cases should be maintained—which might also help to prevent and delay the arrival of a second wave, considering the increasing numbers of cases that are imported from other countries and the presence of asymptomatic or subclinical infections in China24.

The analyses presented here provide a comprehensive quantitative assessment of the effect of NPIs on the transmission of COVID-19. The model framework accounts for daily interactions of populations and interventions between and within cities, as well as the inherent statistical uncertainty that is associated with a paucity of epidemiological parameters before and after the implementation of interventions. The network-based SEIR model is methodologically robust and is built on the basic SEIR models that have been used previously to predict the transmission of COVID-19 in its early stages23. Considering the delays that exist in the reporting of cases, our approach can be used to enable a rapid, ongoing estimation of the effectiveness of various NPIs in different countries, and to aid decision-making relating to the control of outbreaks of COVID-19.

Our study has several limitations. First, our simulations were based on parameters that were estimated for symptomatic cases identified in the early stage of the outbreak in Wuhan, and might not account for asymptomatic and mild infections; we may therefore have underestimated the total number of infections. Second, our findings could be confounded by other factors that changed during the outbreak. Although we have shown that the apparent fall in the incidence of COVID-19 after Chinese New Year (25 January 2020) in China is likely to be attributed to the interventions taken, we cannot rule out the possibility that the decrease was partially attributable to other unknown seasonal factors—for example, temperature and absolute humidity25,26. Third, if the epidemiological parameters of COVID-19 transmission in other cities across China differed from the estimates5—which were based on the data in the early stage of the outbreak, when no NPIs were in place in Wuhan—then our estimates of the effectiveness of interventions in reducing the transmission of COVID-19 could be biased. Fourth, there are probably biases in population coverage, given that our model relies on data from mobile phone and Baidu users. Although a high percentage (from 46.9% in 2013 to 55.3% in 2018) of the population of China owns smartphones27 (https://en.wikipedia.org/wiki/List_of_countries_by_smartphone_penetration), the group of mobile-phone users does not include specific subgroups of the population, particularly children. Therefore, our data on population movement may provide an incomplete picture, and differences between the characteristics of smartphone owners and non-owners may also bias our estimates. In addition, the magnitude and patterns of population movements could change year by year—although previous studies have suggested that travel patterns are consistent in their seasonality across years in China and other countries22. Finally, we only examined three main groups of NPIs, and other interventions might also have contributed to the containment of the outbreak. For example, owing to the sources of data that were available, we did not assess the effect of personal hygiene and protective equipment on containing the spread of COVID-19. Other sources of data and further investigations are needed to measure and evaluate the efficacy of each intervention.

COVID-19 has placed a substantial burden on health systems and society across many countries. From a public health standpoint, our results highlight that countries should consider proactively planning NPIs and relevant strategies for containment and mitigation, as the earlier implementation of NPIs could have led to substantial reductions in the size of the outbreak in China. Our results also provide guidance for countries as to the likely effectiveness of different NPIs at different stages of an outbreak. Suspected and confirmed cases of the disease should be identified, diagnosed, isolated and reported as early as possible to control the source of infection, and the implementation of cordon sanitaires or travel restrictions for areas that are heavily affected might prevent the virus spreading to wider regions. Reducing contact and increasing social distance between individuals, together with improved personal hygiene, can help to protect vulnerable populations and mitigate the spread of COVID-19 at the community level, and these interventions should be promoted throughout the outbreak to avoid resurgence. Our findings suggest that—as advocated by WHO—strategies that involve the early implementation of integrated NPIs should be prepared, deployed and adjusted to maximize the benefits of these interventions and minimize the health, social and economic effects of COVID-19 around the world3.

## Methods

### Data reporting

No statistical methods were used to predetermine sample size. The experiments were not randomized and the investigators were not blinded to allocation during experiments and outcome assessment.

### Model summary

An SEIR model based on travel networks was built to simulate the spread of COVID-19 between and within all prefecture-level cities in mainland China. This model has been made openly available for further use at https://github.com/wpgp/BEARmod. Population movement data across the country were used to estimate the intensity of travel restrictions and contact reductions. Data from illness onset to reporting of the first index case for each county were used to infer the changing timeliness of case identification and isolation across the course of the outbreak. The outputs of the model under NPIs were validated by using daily numbers of new cases reported across all regions in mainland China. On the basis of this modelling framework, the efficacy of applying or lifting non-pharmaceutical measures under various scenarios and timings were tested and quantified.

### Data sources

Three datasets on population movement, which were obtained from Baidu location-based services that provide over 7 billion positioning requests per day4,28, were used in this study to measure travel restrictions and social distancing across time and space. The first is an aggregated and de-identified dataset on near-real-time daily relative outbound and inbound flow of smartphone users for each prefecture-level city in 2020 (340 cities in mainland China were included) to understand patterns of mobility during the outbreak. The daily outflow from each city since the lockdown of Wuhan and the travel restrictions that were applied on 23 January 2020 were rescaled by the mean daily flow for each city from 20 to 22 January 2020 for comparing travel reductions across cities and years (Fig. 1).

The second Baidu dataset is a historical relative movement matrix with daily total number of users at the city level from 26 December 2014 to 26 May 2015, aligning with the 2020 Chinese New Year holiday period, for which the corresponding period is 1 December 2019 to 30 April 2020. We assumed that the pattern of population movements was the same in years when there were no outbreaks and interventions. Adjusted by the level of travel reductions derived from the 2020 dataset where applicable, the second dataset was used to simulate the spread of COVID-19 and predict transmission via population movements under various scenarios, with or without intercity travel restrictions. Corresponding city-level population data in 2015 for modelling were obtained from the Chinese Bureau of Statistics29.

The third Baidu dataset measures daily population movements at the county level (2,862 counties in China) from 26 January to 30 April 2014, as described elsewhere30. On the basis of the assumption that the pattern of population contact was consistent across years when there were no interventions, it was used to estimate within-city travel and contact reduction during the outbreak and interventions. First, we aggregated data from county to city level and rescaled the daily flows from 29 January 2014 by the mean of the daily flow for 26–28 January period, aligning with the date of Wuhan’s lockdown and the 2020 Chinese New Year holiday period. Then, the rescaled first dataset for 2020 under interventions was compared with the 2014 dataset to derive the percentage of travel decline for each city. The percentages for cities were averaged by day to preliminarily quantify the intensity of contact reduction in China under NPIs (Supplementary Table 2), as the policies of travel restriction and social distancing measures were implemented and occurred at the same time across the country.

We also collated data of the first case reported by county across mainland China to measure the delay from illness to case report as a reference of the improved timeliness of case identification, isolation and reporting during the outbreak (Supplementary Table 1). The daily number of COVID-19 cases by date of illness onset in the city of Wuhan, Hubei province and other provinces as of 13 February 2020 were used to further validate the epidemic curves estimated in this study across time. There was an abnormal increase of cases in Wuhan and Hubei province on 1 February 2020, on the basis of the date of illness onset2. We interpolated the number on 1 February 2020 by using the mean of numbers of cases reported on 31 January and 2 February 2020 in the epidemic curve. The number of cases reported by city across mainland China as of 29 February 2020 was used to define the predictability of our model across space. These case data were collated from the websites of national and local health authorities, news media and publications2,3,31 (Supplementary Information).

### Data analysis

We constructed a travel-network-based SEIR modelling framework (BEARmod) for before-and-after comparable analyses on the efficacy of NPIs. This model was extended from a typical SEIR model to specifically incorporate movement between locations that varied with each time step. In this model, each city was represented in the model as a separate subpopulation, with its own susceptible (S), exposed (E), infected (I) and recovered/removed (R) populations.

### Exposure, infection and recovery

During each time step, infected people first recovered or were removed at an average rate r, where r was equal to the inverse of the average infectious period, and removal represents self-isolation and effective removal from the population as a potential transmitter of disease. This was incorporated as a Bernoulli trial for each infected person with a probability of recovering of 1 – exp(−r). We used the median of time lags from illness onset to reported case as a proxy of the average infectious period, indicating the improving identification and isolation of cases under improved interventions (Supplementary Table 1). Then, the model converted exposed people to infectious by similarly incorporating a Bernoulli trial for each exposed individual, where the daily probability of becoming infectious 1 – exp(−ε), where ε was the inverse of the average time spent exposed but not infectious, on the basis of the estimated incubation period (5.2 days, 95% confidence interval (CI) 4.1–7.0)5. Finally, to end the exposure, infection and recovery step of the model, the number of newly exposed people was calculated for each city on the basis of the number of infectious people in the city (Ii) and the average number of daily contacts that lead to transmission that each infectious person has (c). We simulated the number of exposed individuals in a patch on a given day through a random draw from a Poisson distribution for each infectious person, in which the mean number of new infections per person was c, which was then multiplied by the fraction of people in the city that were susceptible. We calculated the daily contact rate c using the basic reproduction rate that has been calculated in other studies (R0 = 2.2 (95% CI 1.4–3.9)) divided by the average days (5.8, 95% CI 4.3–7.5) from onset to first medical visit and isolation5, weighted by the relative level of daily contact where relevant, based on the Baidu movement data (Supplementary Table 2). Because simulation runs were not extended beyond five months, we did not include the addition of new susceptible people, or the conversion of recovered people back to susceptible.

The infection processes within each patch therefore approximate the following deterministic, continuous-time model, where c and r varied through time:

$$\frac{{\rm{d}}S}{{\rm{d}}t}=S-c\frac{SI}{N}$$
$$\frac{{\rm{d}}E}{{\rm{d}}t}=c\frac{SI}{N}-\varepsilon E$$
$$\frac{{\rm{d}}I}{{\rm{d}}t}=\varepsilon E-rI$$
$$\frac{{\rm{d}}R}{{\rm{d}}t}=rI$$

### Movement

After the model completed the infection-related processes, we moved infectious people between cities. To do this, we moved infected people from their current location to each possible destination (including remaining in the same place) using Bernoulli trials for each infected person, and each possible destination city. We parameterized the probability of moving from city i to city j (pij), which was equal to the proportion of smartphone users who went from city i to city j in the corresponding day from the Baidu dataset in 2015, accounting for the travel restrictions in 2020. This included modelling the numbers of people who stayed in the same location using pii, the proportion of users who did not move to a new location on that day. This allowed us to incorporate variance in the actual composition of travellers (infected versus non-infected), but because movement numbers were generated independently, it was possible for the number of infected people who stayed and the number who move in each patch to exceed or be fewer than the number of infected people in the patch. As we only wanted to incorporate variance into relative patterns of movement and not absolute numbers (particularly because the underlying values are proportions of people who moved and therefore cannot influence the total numbers of people infected), in any case in which the number of infected people who moved and the number who stayed differed from the total number of infected people in the origin patch, we rescaled values to the total number of infected people. Rescaling in this way meant the variance introduced by the Bernoulli trials could only influence relative movement patterns, and not actual numbers of infected people. Further, because we explicitly model the number of stayers in the same way as movers, rescaling should not introduce any bias in terms of the final relative movement patterns.

Through this model, stochasticity in the numbers and in the places with COVID-19 infections appears between simulation runs owing to variance in numbers of people becoming exposed, infectious and removed/recovered, as well as variance in numbers of people moving from one city to another. By modelling the COVID-19 epidemic in this way, we could simulate the incidence of COVID-19 cases, accounting for variance in recovery, infection and movement across many simulation runs (1,000). In addition, this allowed for us to account for uncertainty in contact rates after NPIs were implemented or lifted.

### Simulation runs

Using this model, we quantified how the transmission of COVID-19 varied with different intervention scenarios and timings, as well as the potential of further transmission after the lifting of travel restrictions and contact distancing measures on 17 February 2020. As the earliest date of illness onset in cases was 2 December 2020 (ref. 3), considering the underreporting of cases and the delay from infection to onset and identification of this novel virus, we started our simulations by infecting five people in Wuhan on 1 December 2019 and propagating the epidemic through time, varying factors including the timing and types of interventions used, assumed contact and recovery rates, and movement. We initially infected five people as a minimum number of infected people that prevented stochastic extinction of the epidemic during the initial days of simulation, and found no significant difference after three months, over simulation runs that started with three, five and eight people initially infected (though with three people initially infected, 50% of runs led to zero cases over the first week of simulation). When using data from other years we fixed the simulation dates around Chinese New Year and adjusted the start date of the epidemic accordingly.

The estimates of the model for the outbreak under NPIs as the baseline scenario were compared with reported COVID-19 cases across time and space. The sensitivity and specificity were also calculated to examine the performance of the model in predicting the occurrence of COVID-19 cases at the city level across China. The relative effects of NPIs were quantitatively assessed by comparing estimates of cases under various NPIs and timings with that of the baseline scenario. We also conducted a series of sensitivity analyses to understand the effect that changing epidemiological parameters had on the estimates and uncertainties of intervention efficacy. The software R v.3.6.1 (R Foundation for Statistical Computing) was used for data collation and analyses.

### Ethical approval

Ethical clearance for collecting and using secondary data in this study was granted by the institutional review board of the University of Southampton (no. 48002). All data were supplied and analysed in an anonymous format, without access to personal identifying information.

### Reporting summary

Further information on research design is available in the Nature Research Reporting Summary linked to this paper.