NetworKit - a toolkit for high-performance network analysis
Username: cls
Name: Christian Staudt
Show by ID
Download as zip
Commit activity by day / author
Stats gathered: 100.00%
Revision Commit message Age Author Refs
Updated documentation for Layouter 11 months and 23 days ago Kolja Esders
Fixed FruchtermanReingold. 11 months and 25 days ago Kolja Esders
Detecting GML and METIS files. 11 months and 26 days ago Kolja Esders
PivotMDS now usable in Python 1 year ago YaniKolev (Yani Kolev)
Added accepts method to Cython 1 year ago Kolja Esders
Draft for readGraph func without format arg 1 year ago Kolja Esders
Interface to determine which reader can be used 1 year ago Kolja Esders
moved APSP sources from `graph` to `distance` f... 1 year ago cls (Christian Staudt)
moved APSP from `graph` to `distance` module 1 year ago cls (Christian Staudt)
Mark size() as const so it can be called on con... 1 year ago matteo (Matteo Riondato)
< 1 2 3 4 5 .. 585 >

Get Started

We support three ways to install NetworKit:

  • NetworKit Virtual Machine: Download and try NetworKit preinstalled on a virtual machine. This is strongly recommended for users using Microsoft Windows.
  • Pip install: Download the NetworKit Python package with pip. This is the easier way to get NetworKit but you can only use NetworKit via Python this way.
  • Build NetworKit from Source: Clone or download the source code of NetworKit and build the C++ and Python modules from source.

With NetworKit as a Python extension module, you get access to native high-performance code and can at the same time work interactively in the Python ecosystem. Although the standard Python interpreter works fine, we recommend IPython as a great environment for scientific workflows. View the IPython Quickstart Guide for installation instructions and how to use NetworKit with IPython.

Once you have installed NetworKit, please make sure to check out our NetworKit UserGuide for an overview of the features provided in NetworKit.

Install the NetworKit Virtual Machine

If you want a quick and easy way to try NetworKit for your purposes or you use a Microsoft Windows operating system, we strongly recommend the installation of our NetworKit virtual machine that can be downloaded here.

Take a look at our installation guide for further instructions on installing the virtual machine on your system.

Install NetworKit via Pip

Install NetworKit

Depending on your system, you might need to install python3-tk.

You can remove NetworKit completely by using the command :code:`pip3 uninstall networkit`.

To check that everything works as expected, open a python terminal and run the following lines:


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

  • A modern C++ compiler, e.g.: g++ (>= 4.8) or clang++ (>= 3.7)
  • Python 3 (>= 3.4 is recommended, 3.3 supported)
  • Pip
  • SCons: Please note that SCons is only available for Python 2. For installation via pip, we have a script that builds the C++ part of NetworKit, so you can try it without SCons.
  • Cython (>= 0.21): Only needed by developers.

Build NetworKit from Source

You can clone NetworKit from AlgoHub with Mercurial or download the source code as a Zip file.


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

  • A modern C++ compiler, e.g.: g++ (>= 4.8) or clang++ (>= 3.7)
  • SCons: Please note that SCons is only available for Python 2. For the different build targets, SCons is mandatory.
  • Google Test (only needed if you want to build the unit tests, which is recommended)

Building NetworKit

This section describes how to build NetworKit including the Python functionality. If you do not wish to install NetworKit as a Python package, please refer to Building Only the C++ Core.

For building NetworKit including the Python functionality, make sure to also install the software from the Python Requirements listed in the Pip install.

After all requirements are installed, switch to the top folder of NetworKit and run the script with the following options:

The script will call SCons to compile NetworKit as a library and then build the extensions in the folder src/python. By default, NetworKit will be built with the amount of available cores in optimized mode. It is possible to add the options :code:`--optimize=V` and :code:`-jN` the same way it can be done to a manual SCons call, to specify the optimization level and the number of threads used for compilation. The setup script provides more functionality and can be used with pip aswell:

will compile NetworKit, build the extensions and on top of that temporarily install NetworKit so that it is available on the whole system. This can be undone by calling :code:`pip3 uninstall networkit`.

will remove the extensions and its build folder as well as call SCons to remove the NetworKit library and its build folder specified by :code:`--optimize=V`.

Note: All of the above installation command may require root privileges depending on your system, so try this accordingly. If you do not have root privileges, add :code:`--user` to your command.

Building Only the C++ Core

In case you do not need NetworKit's Python functionality, this section describes how to build the C++ parts only.

We recommend SCons for building the C++ part of NetworKit. Individual settings for your environment will be read from a configuration file. As an example, the file build.conf.example is provided. Copy this to build.conf and edit your environment settings. Then call Scons.

The call to SCons has the following options:

where :code:`<level>` can be

and :code:`target` can be

  • :code:`Core` build NetworKit as a library, required for the Python extenstion through Cython.
  • :code:`Tests` build executable for the unit tests (requires GoogleTest).
  • :code:`Lib` build NetworKit as a library and create symbolic links.

For example, to build NetworKit as an optimized library, run

To speed up the compilation on a multicore machine, you can append :code:`-jX` where X denotes the number of threads to compile with.

Logging is enabled by default. If you want to disable logging functionality, add the following to your scons call:

Use NetworKit as a library

It is also possible to use NetworKit as a library. Therefore, choose the target Lib when compiling NetworKit. The include directives in your C++-application look like the following

NetworKit in the directory include is a symlink to the directory networkit/cpp, so the directory structure from the repository is valid. To compile your application, you need to add the paths for the header files and the location of the library. Note, that it is possible to link the different builds (debug, profiling, optimized) of the library. There is a simple source file to demonstrate this. Feel free to compile LibDemo.cpp as follows:


You actually do not need to build and run our unit tests. However, if you experience any issues with NetworKit, you might want to check, if NetworKit runs properly. Please refer to the Unit Tests and Testing section in our NetworKit Development Guide.

Known Issues


We would like to encourage contributions to the NetworKit source code. See the NetworKit Development Guide for instructions. For support please contact the mailing list.

Use NetworKit with IPython

First make sure you have installed IPython, e.g. via pip: :code:`pip3 install ipython`.

IPython Terminal

If you want to use NetworKit in the IPython terminal, type the following commands in your OS terminal:

The first line opens the IPython terminal. The second line imports the networkit Python module. After that, you should be able to use NetworKit interactively. For usage examples, refer to the NetworKit UserGuide.

IPython Notebook/jupyter

Additionally, we recommend that you familiarize yourself with NetworKit through experimenting with the interactive IPython Notebook NetworKit_UserGuide.ipynb located in the folder Doc/Notebooks. The user guide also introduces a large portion of NetworKits functionality with usage examples. To display and work with these notebooks, you have to install jupyter and start a local notebook server from the terminal with:

If you run into any problems with jupyter, head over to the jupyter documentation. If the notebook server starts as it is supposed to, your default browser should open a web interface or you have to open it manually. Then you can add NetworKit_UserGuide.ipynb from the above mentioned location or browse to the location through the web interface.

To show plots within the notebooks, place the following two lines at the beginning of your notebook:

Note: Instead of running jupyter, it may still be possible to run :code:`ipython3 notebook`. However, the notebook functionality of the ipython package is deprecated and has been moved to jupyter, which we strongly recommend.

Usage Example

Now that you are done installing NetworKit, you might want to try the following example: