Software Open Access

Analysis Code: Digital contact tracing contributes little to COVID-19 outbreak containment

Burdinski, Angelique; Brockmann, Dirk; Maier, Benjamin F

Dublin Core Export

<?xml version='1.0' encoding='utf-8'?>
<oai_dc:dc xmlns:dc="" xmlns:oai_dc="" xmlns:xsi="" xsi:schemaLocation="">
  <dc:creator>Burdinski, Angelique</dc:creator>
  <dc:creator>Brockmann, Dirk</dc:creator>
  <dc:creator>Maier, Benjamin F</dc:creator>
  <dc:description># Digital Contact Tracing

This package provides the simulation, analysis, and figure code for
the manuscript "Digital contact tracing contributes little to COVID-19
outbreak containment" by A. Burdinski, D. Brockmann, and B. F. Maier.

## Prerequisites

The analysis code was used and tested for Python 3.8 on CentOS 6.10, Ubuntui 18.04, and macOS 11.3.
In order to run code in this collection, first install the requirements:

pip install -r requirements.txt

The requirements read


Models are implemented using [epipack]( To run
large-scale simulations, we use [qsuite](, a CLI
to facilitate simulations on HPC clusters. `qsuite` will be installed when
dependencies are installed from `requirements.txt`.

In order to have the simulations run faster, consider installing

The installation process will take a few seconds.

## Main model

The main model, including an example configuration,
can be found in directory `main_model/`.

### Example 

To run the simulation, do

cd main_model/

In this example, 200 simulations are run, each on a
distinctly sampled Erdos-Renyi network of `N = 10,000` nodes
with mean degree `k = 20`,
100 simulations on networks with a 30% app participation rate,
and 100 simulations on networks with no tracing app.

The code is expected to run for about 10 minutes on a "regular"
desktop PC (tested on a 2020 Macbook Pro and a small 8-core webserver). 

This is the expected output (see `main_model/example.png`).


### Usage

Change directory as `cd main_model`. Import simulation code as

from simulation import simulation code

Then, set the model parameters


N = 10_000 # number of nodes

model_parameters = dict(
    N = N,
    q = 0.3, # probability to identify&amp;quarantine a symptomatic individual
    a = 0.3, # participation rate
    R0 = 2.5, 
    quarantiningS = True, # wether or not susceptible contacts are traced and isolated
    parameter = {
            'chi':1/2.5, # delay between test and tracing trigger
            'recovery_rate' : 1/7, # 1/(symptomatic infectious period)
            'alpha' : 1/3, # latent period
            'beta' : 1/2,  # presymptomatic infectious period
            'number_of_contacts' : 20,
            'x':0.17, # portion of asymptomatic infectious
            'I_0' : N*0.01, # initial prevalence
            'omega':1/10, # 1/(average isolation period of susceptibles)
            "y" : 0.1, # ratio of people that induce next-generation tracing
            "z": 0.64, # ratio of people sharing their test result
            "R0": 2.5,
            "network_model":'er_network', # choose between
                                          # - er_network
                                          # - confignetwork
                                          # - exp_sw_network
                                          # - swnetwork
    sampling_dt = 1, # sample simulation every day
    time = 1e7,      # maximum simulation time

Obtain simulation timeseries by calling the simulation code as 

t, result = simulation_code(model_parameters)

import matplotlib.pyplot as plt

plt.(t, result['S']+result['Sa'])


## Manuscript analyses 

Almost all simulations and analyses performed in the paper
can be found in `analysis_collection/tracing_sim/`.

All extracted (summarized) data can be found in

Code to produce the figures in the main text from distilled analysis
results and analyses for the locally clustered network with
exponential degree distribution can be found in

Code for plots in the SI can be found in
`analysis_collection/` except for Fig. S7-S8 -- those can
be found in the respective directories 
and `analysis_collection/tracing_sim/results_toy_model/`.

In order to replicate the simulations, change to the directory containing the
respective analysis and run `qsuite local`, e.g. 

cd analysis_collection/tracing_sim/results_exponential_DF_NMEAS_100_ONLYSAVETIME_False/
qsuite local

An illustration to justify the choice of `beta = 10^(-6)` for the small-world long-range
redistribution parameter can be found by running
  <dc:title>Analysis Code: Digital contact tracing contributes little to COVID-19 outbreak containment</dc:title>
All versions This version
Views 255246
Downloads 22
Data volume 160.4 MB160.4 MB
Unique views 246242
Unique downloads 22


Cite as