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.7.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (436.4 kB view details)

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

temporalgraphlib-1.7.0-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.7.0-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.7.0-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.7.0-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.7.0-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.7.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for temporalgraphlib-1.7.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9aaf66519874cf67000803e829a3f57652e94686c7c219a6d697c4ae88849f54
MD5 5f435eba9d5d7619f2343125e58689a3
BLAKE2b-256 4f4b597a72e484f7b7958702da066d72d2dc8304764ecc816f28104d500b0343

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for temporalgraphlib-1.7.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ad85c093764902f63b19045791bef2c83a5c8469ebee845fc1b405ebb9255983
MD5 20b6fb1f7dc01076c0d55ac5c29d0847
BLAKE2b-256 290e43fdcecc116eaf118fe326b528c3a8738b71ec19b9ab58b00b17fe519022

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for temporalgraphlib-1.7.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 02aa74ce68b06e8cb2052a29f5d0396b61b976510fce66c6cadee8b887393001
MD5 b2c708c247fc1bb7f1d4ee1eaeafb49b
BLAKE2b-256 d54e1d8f4ab5b6bcd6219e6f2eadef75438811605a03643bfc94e87e614599da

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for temporalgraphlib-1.7.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 81301703c120899be6d3890a09131a0d0292bc700d40d591a1413ea0aad9ba94
MD5 b9beea0432d824add24d200ff35c6e4f
BLAKE2b-256 80e8044c095202860bd2f349d5be588b1a2d221fe9e3c00497a2ed3425c57eff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for temporalgraphlib-1.7.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c31c9496991ee74e3b5fb1b462962cb5cf4f4cea06c034aa4c1cfc9aff60d234
MD5 f64666ddbb325979c63d7197266d0554
BLAKE2b-256 67d8983a70969fd68baca39c640fa15a08c2b5ba98f3f95ee03b97d889dbc21b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for temporalgraphlib-1.7.0-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2cf629855d55aa62f5910637f3b36b62e881635d6e9631c2e07e0c97a5d808b0
MD5 e844f9813544d10bb0724c9331991724
BLAKE2b-256 e6d65abd59c442f3c4798d7839e8053c810fc78f0cecde548beee1b0aec77b03

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