# NetworkData

This data contains synthetic contact networks among Austrian households, which was created using an agent-based COVID-19 model. The data is foundation to the work published in [Model-Based Optimisation of Outbreak Detection via Wastewater Probing](https://doi.org/10.34726/9004) where it was used as input to a multipopulation-SIR compartment model.

The synthetic household coordinates, their inhabitant counts as well as their contacts with other households via school, workplace and leisuretime are randomly sampled by the agent-based model, but are **statistically representative** for Austria for that date w.r. to data about population census, household distribution, regional number and size of work-places and school(classes), and average number (Polymod survey) and location (mobile phone data) for leisuretime contacts. For more details on the underlying data sources we refer to the SI of [10.1177/0272989X211013306](https://journals.sagepub.com/doi/10.1177/0272989X211013306), where the agent-based epidemics model and its underlying data sources are described. For the generation of the household-household contact data, the agent-based epidemic model is run for 10 days counting the number of sampled contacts between members of different households.

In addition, (almost) every synthetic household is linked to a wastewater treatment plant. The assignment of these plants is based on actual Austrian wastewater treatment plants and their catchment areas - see https://www.data.gv.at/datasets/a6bf5b08-04cb-412c-8a65-85af1a31bf0f?locale=en for details.

The different datasets differ in terms of the network's scale:
- **Network_100** is an unscaled version with roughly 4.5 Million households. This reflects quite accurately the actual number of households in Austria on 2020-01-01.
- **Network_0XX** are scaled-down versions (factor 0.XX), wherein the number of agents (as well as work-places, schools, etc.) in the agent-based are scaled-down by the correponding factor.

Each network dataset is available in two versions: a human-readable CSV version and a version specifically designed to be loaded with Python3 and numpy.

## csv
- **nodes_households.csv** contains data about the synthetic household nodes.
  - *id*: id of the household
  - *latitude/longitude*: sampled place of residence (WSG84 coordinate)
  - *regionId*: municipality ID corresponding to the place (area status 2020).
  - *inhabitants*: number of household members
- **nodes_wastewater.csv** contains data about the purification plant nodes.
  - *id*: id of the plant
  - *latitude/longitude*: place of the plant (WSG84 coordinate)
  - *regionId*: municipality ID corresponding to the place (area status 2020).
- **edges_household_XXXX.csv** for **school, work** and **leisuretime** contains the edges of the household-household-network corresponding to the contact location XXXX.
  - *id1*,*id2*: ids of the contact household (match with the *id* column in nodes_households.csv)
  - *avgContacts*: average number of daily contacts between the two households within the 10-day simulation period of the agent-based model.
- **edges_wastewater.csv** contains the edges of the household-purification plant-assignment.
  - *id1*: id of the household (match with the *id* column in nodes_households.csv)
  - *id2*: id of the purification plant associated with the household (match with the *id* column in nodes_wastewater.csv)

## numpy
The following data was exported with Python (pickle) 3.12.2 and numpy 2.4.2
- **adjacency_households_households.npz** contains an adjacency matrix of the household-household contacts (size NxN) as sparse-numpy array (.npz format). The non-zero entry for index (i,j) means that household i has contacts with household j, whereas the value of the matrix is the sum of all corresponding *avgContacts* fields in *edges_household_XXXX.csv* for *school*, *work* and *leisuretime*. Note that the indices in the matrix are not identical with the ids of the household as defined in the CSV - see *metadata.pickle*.
- **adjacency_households_wastewater.npz** contains an adjacency matrix of the household-plant assignment (size NxM) as sparse-numpy array (.npz format). A non-zero (always 1) entry for index (i,j) means that household i is assigned to plant j. Note that the indices in the matrix are not identical with the ids of the household/plant as defined in the CSVs - see *metadata.pickle*.
- **metadata.pickle** contains a tuple of two pickled (Python 3.12) dictionaries:
  - the first one maps the (numpy-)index of the household to the corresponding metadata - itself a dict with keys:
    - *id*: id of the household (as of *nodes_households.csv* field *id*)
    - *lat/long*: sampled place of residence (WSG84 coordinate)
    - *regionId*: municipality ID corresponding to the place (area status 2020).
    - *inhabitants*: number of household members
  - the second one maps the (numpy-)index of the purification plant to the corresponding metadata - itself a dict with keys:
    - *id*: id of the plant (as of *nodes_wastewater.csv* field *id*)
    - *latitude/longitude*: place of the plant (WSG84 coordinate)
    - *regionId*: municipality ID corresponding to the place (area status 2020).


## Authors
The data was generated by Martin Bicher, martin.bicher@tuwien.ac.at, TU Wien, Instute of Information Systems Engineering, RA Data Science.

## License
CC-BC-NC-4.0 - see [LICENSE].