
Networkit-это набор инструментов с открытым исходным кодом для высокопроизводительного анализа сети. Его цель состоит в том, чтобы предоставить инструменты для анализа больших сетей в размерах, от тысяч до миллиардов краев. 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 также является испытательным стендом для Algorithm Engineering и содержит новые алгоритмы из недавно опубликованных исследований (см. Список публикаций ниже).
NetworKit is a Python module. Высокопроизводительные алгоритмы записываются в C ++ и подвергаются воздействию Python через цинтонный инструмент. Python, в свою очередь, дает нам возможность работать интерактивно и богатую среду инструментов для анализа данных и научных вычислений. Кроме того, ядро Networkit может быть построено и используется в качестве собственной библиотеки, если это необходимо.
Вам понадобится следующее программное обеспечение для установки Networkit в качестве пакета Python:
apt-get install python3-devdnf install python3-develpip3 install cmake )pip3 install cython ) Чтобы использовать Networkit, вы можете либо установить его через менеджеров пакетов, либо создать модуль Python из Source.
Хотя самая последняя версия в целом доступна для всех менеджеров пакетов, количество старых загружаемых версий отличается.
pip3 install [--user] networkit
conda config --add channels conda-forge
conda install networkit [-c conda-forge]
brew install networkit
spack install py-networkit
Можно найти более специфичную для системы информацию о том, как установить Networkit на Linux, MacOS (как Intel, так и M1) и Windows-Systems.
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.
Чтобы получить обзор и узнать о различных функциях/классах 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. Вы должны действительно проверить это до начала работы над анализом вашего сети.
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
------------------- -----------
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.
conda config --add channels conda-forge
conda install libnetworkit [-c conda-forge]
brew install libnetworkit
spack install libnetworkit
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 (eg, .. ). 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.
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).
Чтобы использовать предыдущую скомпилированную библиотеку Networkit, вам необходимо установить ее и связать ее при составлении своего проекта. 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
Building and running NetworKit unit tests is not mandatory. Однако, как разработчик, вы можете захотеть написать и запустить модульные тесты для вашего кода, или если вы испытываете какие -либо проблемы с Networkit, вы можете проверить, работает ли Networkit должным образом. The unit tests can only be run from a clone or copy of the repository and not from a pip installation. Чтобы запустить модульные тесты, вам нужно сначала собрать их. 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 .
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.
The most recent version of the documentation can be found online.
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.
We encourage contributions to the NetworKit source code. See the development guide for instructions. Для поддержки, пожалуйста, свяжитесь с списком рассылки.
List of contributors can be found on the NetworKit website credits page.
The program source includes:
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 (cf the publications section below and especially the technical report). Feedback is also welcome.
На странице Networkit Publications перечислены публикации в Networkit в качестве инструментария, на алгоритмах, доступных в Networkit, и просто с использованием Networkit. We ask you to cite the appropriate ones if you found NetworKit useful for your own research.