Tiny and efficient graph abstractions
tinygraph is a modern and idiomatic library optimized for compact and efficient graphs using succinct data structures.
See our website at tinygraph.org
See our technical design document for the technical background and design decisions for tinygraph.
See the example in tinygraph/tinygraph-example.c
See the documentation in tinygraph/tinygraph.h for the library interface.
The tinygraph library requires 64bit Linux (gcc or clang).
By default we compile for the x86-64-v3 microarchitecture which allows us to target hardware instruction sets such as POPCNT, BMI2, and the AVX2 vector instruction set.
If you want to compile the library for your specific hardware you can pass -march=native instead in the Makefile.
On AMD CPUs before Zen 3 (released 2020) the PDEP instruction we rely on is implemented in microcode and you will notice a performance penalty.
To compile the library
makeTo install the library run
make installThen
- compile your own program against
tinygraph.h - link your own program against
libtinygraph.so
We provide a self-contained and reproducible docker environment for development with a tried and tested compiler and make setup.
In the tinygraph directory run
make shIn the self-contained and reproducible environment you can then compile the tests with
make tinygraph-tests
./tinygraph/tinygraph-testsCopyright © 2021-2025 Daniel J. Hofmann
Distributed under the MIT License (MIT).