Minimal Docker image for NiemaGraphGen using Alpine base
474
NiemaGraphGen (NGG) is a collection of efficient C++ implementations of graph generators for use in sampling contact networks in global-scale pandemic simulations. Importantly, NGG avoids actually storing the graph in memory and instead is intended to be used in a data streaming pipeline. Currently, NGG implements generators for the following types of graphs:
NGG is written in C++ and has no dependencies beyond a modern C++ compiler (and make for convenience). You can simply download the latest release tarball (or clone the repo) and compile with make:
git clone https://github.com/niemasd/NiemaGraphGen.git
cd NiemaGraphGen
make
sudo mv ngg_* /usr/local/bin/ # optional; install NGG executables globally
Each graph generator is implemented as its own ngg_* executable. To view each generator's usage message, simply run the executable with the -h or --help argument:
ngg_barabasi_albert -h # show the usage message for the Barabási–Albert generator
The default compilation options (i.e., by downloading the NGG source code and running make) should be sufficient for most use-cases. However, NGG supports some advanced compilation options that may be of interest.
NGG represents each node using an unsigned integer. By default, NGG uses 32-bit unsigned integers, which supports up to 2^32 - 1 = 4,294,967,295 nodes in a single graph. This is more than half the population of the Earth, so it should be sufficient for most simulation studies, but by changing the compilation flags, you can change this size as desired. In general, the larger the unsigned integer size, the larger networks you can simulate, but the more memory NGG will consume. To change the size of unsigned integers, you can change the following line in the Makefile:
UINTFLAG=-DNGG_UINT_8 # 8-bit (up to 2^8 - 1 = 255 nodes)
UINTFLAG=-DNGG_UINT_16 # 16-bit (up to 2^16 - 1 = 65,535 nodes)
UINTFLAG=-DNGG_UINT_32 # 32-bit (up to 2^32 - 1 = 4,294,967,295 nodes) (default)
UINTFLAG=-DNGG_UINT_64 # 64-bit (up to 2^64 - 1 = 18,446,744,073,709,551,615 nodes)
By default, NGG outputs contact networks in the FAVITES format. However, for ultra-large simulation studies, the resulting files may be massive. To address this, NGG also supports a "compact" binary output format, which is defined as follows:
000000AA)
0 values)AA represents the number of bytes b per integer (00 = 1, 01 = 2, 10 = 4, and 11 = 8)Both output formats should be fairly nicely compressible, which can further reduce output filesize (e.g. by piping to gzip to compress the stream).
To change the output format, you can change the following line in the Makefile:
OUTFLAG=-DOUTFAVITES # FAVITES format
OUTFLAG=-DOUTCOMPACT # compact format
A manuscript is in the works, but until it's released, please cite this GitHub repository.
Content type
Image
Digest
Size
68 MB
Last updated
almost 5 years ago
docker pull niemasd/niemagraphgen