Skip to main content

NetworKit is a toolbox for high-performance network analysis

Project description

NetworKit - Lage-scale Network Analysis

NetworKit is an open-source tool suite for high-performance network analysis. Its aim is to provide tools for the analysis of large networks in the size range from thousands to billions of edges. For this purpose, it implements efficient graph algorithms, many of them parallel to utilize multicore architectures. These are meant to compute standard measures of network analysis. NetworKit is focused on scalability and comprehensiveness. NetworKit is also a testbed for algorithm engineering and contains novel algorithms from recently published research (see list of publications below).

NetworKit is a Python module. High-performance algorithms are written in C++ and exposed to Python via the Cython toolchain. Python in turn gives us the ability to work interactively and a rich environment of tools for data analysis and scientific computing. Furthermore, NetworKit's core can be built and used as a native library if needed.

Requirements

You will need the following software to install NetworKit as a python package:

  • A modern C++ compiler, e.g.: g++ (>= 8.1), clang++ (>= 6.0) or MSVC (>= 14.20)
  • OpenMP for parallelism (usually ships with the compiler)
  • Python3 (3.9 or higher is supported)
    • Development libraries for Python3. The package name depends on your distribution. Examples:
      • Debian/Ubuntu: apt-get install python3-dev
      • RHEL/CentOS: dnf install python3-devel
      • Windows: Use the official release installer from www.python.org
  • Pip
  • CMake version 3.6 or higher (Advised to use system packages if available. Alternative: pip3 install cmake)
  • Build system: Make or Ninja
  • Cython version 0.29 or higher (e.g., pip3 install cython)

Install

In order to use NetworKit, you can either install it via package managers or build the Python module from source.

Install via package manager

While the most recent version is in general available for all package managers, the number of older downloadable versions differ.

pip
pip3 install [--user] networkit
conda (channel conda-forge)
conda config --add channels conda-forge
conda install networkit [-c conda-forge]
brew
brew install networkit
spack
spack install py-networkit

More system-specific information on how to install NetworKit on Linux, macOS (both Intel and M1) and Windows-systems can be found here.

Building the Python module from source

git clone https://github.com/networkit/networkit networkit
cd networkit
python3 setup.py build_ext [-jX]
pip3 install -e .

The script will call cmake and ninja (make as fallback) to compile NetworKit as a library, build the extensions and copy it to the top folder. By default, NetworKit will be built with the amount of available cores in optimized mode. It is possible the add the option -jN the number of threads used for compilation.

Usage example

To get an overview and learn about NetworKit's different functions/classes, have a look at our interactive notebooks-section, especially the Networkit UserGuide. Note: To view and edit the computed output from the notebooks, it is recommended to use Jupyter Notebook. This requires the prior installation of NetworKit. You should really check that out before start working on your network analysis.

We also provide a Binder-instance of our notebooks. To access this service, you can either click on the badge at the top or follow this link. Disclaimer: Due to rebuilds of the underlying image, it can takes some time until your Binder instance is ready for usage.

If you only want to see in short how NetworKit is used - the following example provides a climpse at that. Here we generate a random hyperbolic graph with 100k nodes and compute its communities with the PLM method:

>>> import networkit as nk
>>> g = nk.generators.HyperbolicGenerator(1e5).generate()
>>> communities = nk.community.detectCommunities(g, inspect=True)
PLM(balanced,pc,turbo) detected communities in 0.14577102661132812 [s]
solution properties:
-------------------  -----------
# communities        4536
min community size      1
max community size   2790
avg. community size    22.0459
modularity              0.987243
-------------------  -----------

Install the C++ Core only

In case you only want to work with NetworKit's C++ core, you can either install it via package managers or build it from source.

Install C++ core via package manager

conda (channel conda-forge)
conda config --add channels conda-forge
conda install libnetworkit [-c conda-forge]
brew
brew install libnetworkit
spack
spack install libnetworkit

Building the C++ core from source

We recommend CMake and your preferred build system for building the C++ part of NetworKit.

The following description shows how to use CMake in order to build the C++ Core only:

First you have to create and change to a build directory: (in this case named build)

mkdir build
cd build

Then call CMake to generate files for the make build system, specifying the directory of the root CMakeLists.txt file (e.g., ..). After this make is called to start the build process:

cmake ..
make -jX

To speed up the compilation with make a multi-core machine, you can append -jX where X denotes the number of threads to compile with.

Use NetworKit as a library

This paragraph explains how to use the NetworKit core C++ library in case it has been built from source. For how to use it when installed via package managers, best refer to the official documentation (brew, conda, spack).

In order to use the previous compiled networkit library, you need to have it installed, and link it while compiling your project. Use these instructions to compile and install NetworKit in /usr/local:

cmake ..
make -jX install

Once NetworKit has been installed, you can use include directives in your C++-application as follows:

#include <networkit/graph/Graph.hpp>

You can compile your source as follows:

g++ my_file.cpp -lnetworkit

Unit tests

Building and running NetworKit unit tests is not mandatory. However, as a developer you might want to write and run unit tests for your code, or if you experience any issues with NetworKit, you might want to check if NetworKit runs properly. The unit tests can only be run from a clone or copy of the repository and not from a pip installation. In order to run the unit tests, you need to compile them first. This is done by setting the CMake NETWORKI_BUILD_TESTS flag to ON:

cmake -DNETWORKIT_BUILD_TESTS=ON ..

Unit tests are implemented using GTest macros such as TEST_F(CentralityGTest, testBetweennessCentrality). Single tests can be executed with:

./networkit_tests --gtest_filter=CentralityGTest.testBetweennessCentrality

Additionally, one can specify the level of the logs outputs by adding --loglevel <log_level>; supported log levels are: TRACE, DEBUG, INFO, WARN, ERROR, and FATAL.

Compiling with address/leak sanitizers

Sanitizers are great tools to debug your code. NetworKit provides additional Cmake flags to enable address, leak, and undefined behavior sanitizers. To compile your code with sanitizers, set the CMake NETWORKIT_WITH_SANITIZERS to either address or leak:

cmake -DNETWORKIT_WITH_SANITIZERS=leak ..

By setting this flag to address, your code will be compiled with the address and the undefined sanitizers. Setting it to leak also adds the leak sanitizer.

Documentation

The most recent version of the documentation can be found online.

Contact

For questions regarding NetworKit, have a look at our issues-section and see if there is already an open discussion. If not feel free to open a new issue. To stay updated about this project, subscribe to our mailing list.

Contributions

We encourage contributions to the NetworKit source code. See the development guide for instructions. For support please contact the mailing list.

Credits

List of contributors can be found on the NetworKit website credits page.

External Code

The program source includes:

License

The source code of this program is released under the MIT License. We ask you to cite us if you use this code in your project (c.f. the publications section below and especially the technical report). Feedback is also welcome.

Publications

The NetworKit publications page lists the publications on NetworKit as a toolkit, on algorithms available in NetworKit, and simply using NetworKit. We ask you to cite the appropriate ones if you found NetworKit useful for your own research.

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

networkit-11.1.post1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

networkit-11.1.post1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (10.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

networkit-11.1.post1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

networkit-11.1.post1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (10.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

networkit-11.1.post1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

networkit-11.1.post1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (10.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

networkit-11.1.post1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

networkit-11.1.post1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (10.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

File details

Details for the file networkit-11.1.post1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for networkit-11.1.post1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b78536455810d277be07e9b16790f992325be0ffbf0f186ca8d4c74d03c455a1
MD5 e2b24dadc1f13bc0d36b9e2f72c7aeb5
BLAKE2b-256 bce09366add8e566b4b734799d02002f5c77883a4218570d2d197ea46ecdb113

See more details on using hashes here.

File details

Details for the file networkit-11.1.post1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for networkit-11.1.post1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 21ba5d7b24dcfbf849eb79f28117fdd68a0a43b024aeef2e6cc1300f767577fe
MD5 e504ed04c5ca319e45e8ff77641ac310
BLAKE2b-256 0c61aa532aa2188d66ec8d1cdf65c1ddc2b05447e6d74789b0e46703c76a0aad

See more details on using hashes here.

File details

Details for the file networkit-11.1.post1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for networkit-11.1.post1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0e477bd65f9f8b91d1bfec130ea8aa089f4010dc4898bb246a7d3cb312ae0c65
MD5 6013cb700cc987c58144764a2a9bd098
BLAKE2b-256 92b630b6f1c411a01dd3878ab85ba09ee798d61a110eb1094c9d645a50bdbbda

See more details on using hashes here.

File details

Details for the file networkit-11.1.post1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for networkit-11.1.post1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 a1b085b909cc893cbc6d6e0afce993d5a120b6aabd1077cecd799fd1e6954162
MD5 b8b386a3a3bd2c41f060b73f1b802c16
BLAKE2b-256 009e63669f1d87bd780a5b62c40dbf670c9b866818087cefe3510a85714450db

See more details on using hashes here.

File details

Details for the file networkit-11.1.post1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for networkit-11.1.post1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0b3c0ca42bf8b9ca78419bf99d2f09fac7e93583f4e9c97a6a02ea07fc019556
MD5 1c5b0a4ab713b38ba59dc6e2d3b69fe2
BLAKE2b-256 e9818724b2766a088f9b6e0bd5130d820e0ec305b2d126fa98aa8e4b4d171b4e

See more details on using hashes here.

File details

Details for the file networkit-11.1.post1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for networkit-11.1.post1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 1e51202a800380c6759928ae52af9a4d0631caea49861c31f3b6ce0b88a2a4ec
MD5 7b501a2fb274e4070b7f7c5b40bb72fb
BLAKE2b-256 97b50fd6229220a4359667733551614ea2d397b64a5e24fc902048b753a930e9

See more details on using hashes here.

File details

Details for the file networkit-11.1.post1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for networkit-11.1.post1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0544920ab9ebf59f7f3484c99f253451d46f0dfeff1b2523caa0dba0525076b5
MD5 fdd15a5a41fa832dc479e98af51d4db6
BLAKE2b-256 5997c2cdc7951c6f830a70075a3e3b5682eaa57842b6f0c9c21fd0e552122982

See more details on using hashes here.

File details

Details for the file networkit-11.1.post1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for networkit-11.1.post1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 d69eff3d2119775d21e9e721dad36048d81ff62572358664f8f88c832bf66ce1
MD5 75afe6c2f51b237f8b98efbb88d7d8da
BLAKE2b-256 7cc28611ec48bb484c57f7638c91ca05ed67d923d1b37b0e0d2bfd1f0c2f3e27

See more details on using hashes here.

Supported by

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