Tiny and efficient graph abstractions
The tinygraph library is a modern approach for working with compact graphs.
See our website at tinygraph.org
const uint32_t sources[5] = {0, 0, 1, 1, 2};
const uint32_t targets[5] = {1, 2, 0, 2, 1};
tinygraph_s graph = tinygraph_construct_from_sorted_edges(sources, targets, 5);
if (!graph) {
fprintf(stderr, "error: unable to construct graph\n");
return EXIT_FAILURE;
}
tinygraph_print(graph);
tinygraph_destruct(graph);
See the example in tinygraph/tinygraph-example.c
See the documentation in tinygraph/tinygraph.h for the interface the library provides.
The tinygraph library requires 64bit Linux (gcc or clang).
To compile the library, its tests, and the example run
make
To install the library run
make install
Then
- 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 sh
In the self-contained and reproducible environment you can then compile with
make
or for watching file modification events, re-compiling automatically
make watch
Copyright © 2021-2024 Daniel J. Hofmann
Distributed under the MIT License (MIT).