Skip to main content

No project description provided

Project description

Introduction to TGLib

TGLib is an open-source temporal graph library focusing on temporal distance and centrality computations, and other local and global temporal graph statistics.

TGLib is designed for performance and usability by an efficient and modular C++ implementation of the core data structures and algorithms and an easy-to-use Python front-end provided by PyBind11.

GitLab Repository

Easy Python Usage

New: TGLib is now easily installable via PyPI! You can install it using pip:

pip install temporalgraphlib

This installs the precompiled Python bindings for TGLib, allowing you to use it directly in your Python environment without building from source.

After installation, TGLib can be used in python as follows:

import pytglig as tgl
tgs = tgl.load_ordered_edge_list("example_datasets/example_from_paper.tg")
stats = tgl.get_statistics(tgs)
print(stats)

Easy C++ Usage

The C++ part of TGLib is a header-only template library that can be directly used in other C++ projects by including the headers in your project.

Compilation and Installation

The following describes how to compile the python bindings.

Building the Python library

For compiling the PyBind11 binding and the Doxygen documentation, first clone the repository recursively to obtain the PyBind11 submodule via

git clone --recurse-submodules https://gitlab.com/tgpublic/tglib.git

Then, run the following:

cd tglib/tglib_cpp
mkdir build-release
cd build-release
cmake .. -DCMAKE_BUILD_TYPE=Release
make

After the compilation, the Python binding is in the subfolder build-release/src/python-binding.

Importing the Python library

Running the above commands will produce a binary module file that can be imported to Python. Assuming that the compiled module is located in the current directory, TGLib can be imported in Python with import pytglib as tgl.

Python version

Note that the CMake will try to automatically detect the installed Python version and link against that. You can specify a version by adding -DPYTHON_EXECUTABLE=$(which python) when calling cmake, where $(which python) a path to Python (see PyBind11 documentation).

Building the documentation

In order to additionally generate the C++ documentation, call make doxygen. The documentation can be found in the subfolder build-release/html. Note that you need Doxygen for generating the documentation.

Quick Start

First example

The following Python code loads a temporal graph from the file with name temporal_graph_file and computes basic network statistics by calling get_statistics. The results is printed using the print command.

import pytglib as tgl  
tg = tgl.load_ordered_edge_list("temporal_graph_file")
stats = tgl.get_statistics(tg)
print(stats)

The folder tglib_python contains further examples for the usage of TGLib in Python.

Temporal graph file format

Temporal graphs can be read from text files that contain edge lists in which each line represents the information of the edge. Each edge can consists of three or four values: u v t or u v t tt where u is the tail, v the head, t the time stamp (availability time), and tt an optional transition time.

The folder example_datasets contains examples.

Implemented Data Structures and Algorithms

Data structures

TGLib supports the temporal edge stream data structure from Wu et al., the incident lists data structure used in Oettershagen and Mutzel, and the time-respecting static graph representation introduced in Gheibi et al.. Furthermore, TGLib supports further static graph representations, e.g., the weighted aggregated underlying graph or directed line graph representation.

Algorithms and network properties

So far, we implemented the following algorithms and measures, e.g.,

C++ Documentation

The C++ code is fully documented using Doxygen. You can read the documentation online here.

Contact and Cite

Contact information can be found here.

Please cite our paper (arxiv version), and the respective papers of the methods used, if you use TGLib:

@inproceedings{oettershagen2022tglib,
  title={Tglib: an open-source library for temporal graph analysis},
  author={Oettershagen, Lutz and Mutzel, Petra},
  booktitle={2022 IEEE International Conference on Data Mining Workshops (ICDMW)},
  pages={1240--1245},
  year={2022},
  organization={IEEE}
}

License

TGLib is released under MIT license. See LICENSE.md for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

temporalgraphlib-1.6.6-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (436.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

temporalgraphlib-1.6.6-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (436.8 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

temporalgraphlib-1.6.6-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (436.8 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

temporalgraphlib-1.6.6-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (436.9 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

temporalgraphlib-1.6.6-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (436.6 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file temporalgraphlib-1.6.6-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for temporalgraphlib-1.6.6-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 451d9c03583469143c679c4b642986bf90a01a40771e0636524d112d16775702
MD5 3c57e6b3fb30853a0cfaf777f98107b0
BLAKE2b-256 0981c48e48c985110a7dfb79836ac2fb829b562617166e9c78d02cbea621899d

See more details on using hashes here.

File details

Details for the file temporalgraphlib-1.6.6-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for temporalgraphlib-1.6.6-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 118e38f1c38c41f55517d85067911fea66d50acd37f7cbdfce99c4898ed3fef0
MD5 ceaa1a3759dbf700c468889d408b1643
BLAKE2b-256 fc6768859a1c8d557c05fc2b49abd8b9f5d1de77ce577fb9810764c485152ca6

See more details on using hashes here.

File details

Details for the file temporalgraphlib-1.6.6-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for temporalgraphlib-1.6.6-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 668c6ec886bd2f5c1d1d84f4f98369e048feacfa983800f4bbad2ca73d5e370f
MD5 9bbb001658420286bfe4c2644a82de78
BLAKE2b-256 641eddad0b72305fbf620007902ee4b2503de8f255bb4c54c14de574a83502b6

See more details on using hashes here.

File details

Details for the file temporalgraphlib-1.6.6-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for temporalgraphlib-1.6.6-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 eb3746853c2cec5b6721263f3794263cad32425a2428a4e86e1403969e6d7138
MD5 593fa578569cc9db315d5d6b3add481d
BLAKE2b-256 d2e6041f534e66370c827748a389affd4488a6fb8dd04c57f753b4644f109e2a

See more details on using hashes here.

File details

Details for the file temporalgraphlib-1.6.6-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for temporalgraphlib-1.6.6-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cdb73e3558a35656906c6e28f6e6539b4bbbf140d4d596c86a0ca02a6557c6c5
MD5 02774dde4f3d977b16d3ed9a2eaf45af
BLAKE2b-256 5e8dada6d51624b8d29a20658557edc92675598f7a4d44bc2e9cdf5c400ed591

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page