GithubHelp home page GithubHelp logo

networkit / networkit Goto Github PK

View Code? Open in Web Editor NEW
737.0 28.0 221.0 262.44 MB

NetworKit is a growing open-source toolkit for large-scale network analysis.

Home Page: https://networkit.github.io

License: MIT License

Jupyter Notebook 5.42% Python 6.75% CSS 1.44% HTML 0.33% Shell 0.01% TeX 0.11% C++ 71.58% JavaScript 0.24% CMake 0.94% Dockerfile 0.03% Cython 13.14%
complex-networks graph-algorithms network-analysis cpp graph-analysis graph-generation dynamic-networks parallel-algorithm python

networkit's Introduction

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.8 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.

networkit's People

Contributors

angriman avatar arie3301 avatar avdgrinten avatar bernlu avatar charjon avatar clstaudt avatar cndolo avatar darabos avatar dysnomia avatar ebergamini avatar fabratu avatar fiona-j-w avatar franz-benjamin avatar klarareichard avatar kolja-esders avatar larsgottesbueren avatar manpen avatar marvin182 avatar marvinpogoda avatar maxvogel avatar michitux avatar mlooz avatar petholza avatar rbange avatar rionda avatar skoeldpadda avatar tillahoffmann avatar tinfoilhat0 avatar tinloaf avatar yanikolev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

networkit's Issues

OpenMP and clang travis setup

I'm currently trying to reproduce the segfault in the LFR test case (see Job #6.3). Unfortunately I'm unable to reproduce it locally. While comparing the setup I noticed two things:

  • travis is using clang 3.7 without OpenMP support
  • travis uses the trunk version (i.e., the current development version) of the OpenMP library of clang

Locally, I have clang 3.9.1 which includes OpenMP support.

Just to exclude the possibility that the crash is due to some bug in the current development branch of OpenMP - is there anything that speaks against using at least a stable version of the OpenMP support library or directly switch to at least clang 3.8 which includes OpenMP support?

Reduce test execution time

Make sure all tests run in a reasonable amount of time (<< 1s per test) if possible.
This might be accomplished by

  • Adjusting the parameters of the algorithms
  • Reducing/Eliminating the use of external graph files (except for read/write tests)

Automatically remove incident edges on removeNode(u)

During the last meeting we decided to simplify the deletion process of a node by automatically removing the adjacent edges.

I encountered the following note in the Graph.h file:

@note Although it would be convenient to remove all incident edges at the same time, this causes complications for dynamic applications. Therefore, removeNode is an atomic event. All incident edges need to be removed first and an exception is thrown otherwise.

Does anyone know how these specific complications look like? Should we proceed with the task or cancel it? @hmeyerhenke

Hyperbolic Generator -- Returning Embedding Information

Hi there,

I'm trying to extend the functionality of the HyperbolicGenerator code found in cpp/generators/HyperbolicGenerator.cpp . The code itself (starting with the generate function) generates two vectors (angles and radii) describing polar coordinates corresponding to the angular and radial coordinates of each point within the randomly generated hyperbolic graph.

It then uses those coordinates (with some smart heuristics outlined within this paper for the T=0 case I'm working with) to determine if two nodes are linked based on the hyperbolic distance between the nodes ( P(connection) goes to 1 as the distance between the nodes goes to 0 )

Currently, the code just returns the NetworKit Graph object generated by this process, without any information about where the nodes exist within the hyperbolic space, and I want to modify the code so it returns the angles and radii vectors associated with each point in the generated graph (I'm doing research related to greedy routing, so this information is helpful).

I could just modify the Cython code to export as a csv the two vectors for each node, but I'm sure there are other use cases in which returning embedding information from graphs generated within NetworKit would be useful.

To that end, is there a canonical way to write this out for NetworKit generators, and would that be a worthwhile contribution? Should I add a boolean parameter specifying whether or not the embedded polar coordinates should be returned?

Thanks

Extending NetworKit more efficiently

I'm currently trying to extend NetworKit by adding code to networkit/_NetworKit.pyx directly.

Then, I run python setup.py build_ext --inline to compile the.pyx file.

However, it takes quite some time for this step (~ 10 secs).

Is there any way to speed up the process?

One way I tried is to separating my code with _NetworKit.pyx.

However, my code depends on some definitions in _NetworKit.pyx. I tried to copy them to the new file but the dependency chain seems too long so I gave up.

Any suggestions?

(Happy holiday! BTW)

Cannot represent MultiDiGraphs

I am doing a machine learning project on a road network and have been unable to find a suitable replacement for the networkx MultiDiGraph type. In the road network from OpenStreetMap that I am using legitimate multi-edges occurs.

As far as I can tell, there is no way to distinguish two (parallel) edges with the same source and target nodes in NetworKit which becomes problematic when I need to associate attributes with such edges.

windows install networkit via pip always errors

i use python3.6.1 and install minGW gcc version 7.2.0,but pip install networkit error

C:\Users\chen>pip install networkit
Collecting networkit
Using cached networkit-4.4.tar.gz
Complete output from command python setup.py egg_info:
'pip3' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
Requirement already satisfied: ipython in d:\anaconda\lib\site-packages
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\chen\AppData\Local\Temp\pip-build-p4lcwpal\networkit\setup.
py", line 127, in
cppcompiler, stdflag = determineCompiler(candidates, ["c++14","c++11"])
File "C:\Users\chen\AppData\Local\Temp\pip-build-p4lcwpal\networkit\setup_
util.py", line 149, in determineCompiler
os.remove("test_build")
FileNotFoundError: [WinError 2] 系统找不到指定的文件。: 'test_build'


Command "python setup.py egg_info" failed with error code 1 in C:\Users\chen\App
Data\Local\Temp\pip-build-p4lcwpal\networkit\

SCONS build failed

Hey, I'm trying to build the c++ shared library.
I ran the latest stable version of scons and got an error that tabs/spacing was messed up on line 71
So I fixed that and then got an error that the command argument "-std=None" was provided

g++: error: unrecognized command line option '-std=None'
scons: *** [.buildOpt/algebraic/CSRMatrix.os] Error 1

testTopClosenessDirected randomly failing

Set random seed or adjust boundaries.

[ RUN      ] CentralityGTest.testTopClosenessDirected
networkit/cpp/centrality/test/CentralityGTest.cpp:871: Failure
The difference between cc.ranking()[i].second and topcc.topkScoresList()[i] is 0.014224715958173262, which exceeds tol, where
cc.ranking()[i].second evaluates to 0.3233387358184765,
topcc.topkScoresList()[i] evaluates to 0.33756345177664976, and
tol evaluates to 9.9999999999999995e-08.
networkit/cpp/centrality/test/CentralityGTest.cpp:871: Failure
The difference between cc.ranking()[i].second and topcc.topkScoresList()[i] is 0.0031140167173528965, which exceeds tol, where
cc.ranking()[i].second evaluates to 0.3202247191011236,
topcc.topkScoresList()[i] evaluates to 0.3233387358184765, and
tol evaluates to 9.9999999999999995e-08.
networkit/cpp/centrality/test/CentralityGTest.cpp:871: Failure
The difference between cc.ranking()[i].second and topcc.topkScoresList()[i] is 0.016802665869184441, which exceeds tol, where
cc.ranking()[i].second evaluates to 0.30342205323193916,
topcc.topkScoresList()[i] evaluates to 0.3202247191011236, and
tol evaluates to 9.9999999999999995e-08.
[  FAILED  ] CentralityGTest.testTopClosenessDirected (20 ms)

Cannot import Networkit after successful installation

After struggling a bit I managed to pip-install Networkit in a Python 3.6 Anaconda environment (I'm on OsX High Sierra). I was able to import it only once though, I tried to do it again immediately after but I got this error:

ImportError: dlopen(//anaconda/envs/py36/lib/python3.6/site-packages/_NetworKit.cpython-36m-darwin.so, 2): Symbol not found: _GOMP_parallel
  Referenced from: //anaconda/envs/py36/lib/python3.6/site-packages/_NetworKit.cpython-36m-darwin.so
  Expected in: flat namespace
 in //anaconda/envs/py36/lib/python3.6/site-packages/_NetworKit.cpython-36m-darwin.so

I think it has something to do with gcc but I don't know how to solve it.

Resolve ApproxBetweeness(2) naming

Proposed solution:

ApproxBetweeness2 --> EstimateBetweeness
ApproxBetweeness won't change.

TBH I think the new naming is only slightly better. I believe the names are not really clear enough and make it harder for people to decide what to choose.

Adding documentation for top-level python functions

Currently I can not find the top-level python functions in the Python Documentation. It would be helpful if they would be added there.

Those functions/objects are currently getLogLevel, setLogLevel, setPrintLocation, enableNestedParallelism, setNumberOfThreads, getCurrentNumberOfThreads, getMaxNumberOfThreads, none, setSeed.

Travis setup for Dev branch

Is there a reason why the travis setup is only present in the master branch? I wanted to suggest a few changes to fix test failures in travis, however according to my understanding the Dev-branch is still the development branch and therefore these changes should go to the Dev-branch. As the Dev-branch contains no travis setup I'm not sure if I should just merge the master branch in the Dev branch for testing my changes or if the master branch is the new development branch (but then the recent changes from the Dev branch should be merged).

[edit] See also this travis Job which shows that travis doesn't use the configuration from the master branch.

Graph.forEdges() iterator documentation

Referring to this question on stackoverflow, I would suggest to add some simple example for the usage of the forEdges iterator, because the documentation doesn't really explain a lot and no example can be found anywhere. This iterator may actually be very useful, maybe with some further explanation in the Jupyter Notebook guide!

numpy/scipy adjacency matrix to Graph

I have a large ~60K rows/cols adjacency matrix (either as a np.array or a scipy.sparse.csr_matrix, depending on the density of edges) that I'd like to call communities on. Is there a convenient way to convert either of these objects to a networkit.graph.Graph?

Thanks!

Rename SSSP::getStack to reflect current functionality

SSSP::getStack is currently not returning a stack but a vector of nodes in increasing distance from the source.

getStack should be deprecated and instead there should be a getDistanceVector method that has the same functionality.

Profiling module broken due to renaming?

I pulled the latest Dev branch this morning, compiled, and started a new local Jupyter NB with the user guide. The user guide does not perform profiling successfully due to the missing ApproxBetweenness2.

Aren't there wrapper functions to not run into this issue? We should have that at least for one release together with a "deprecated" statement.

Missing function: all simple paths between a source and a target node

In networkx, we find the function all_simple_paths which returns a generator of lists, each list specifying a path from a source node to a target node, with a given cutoff length to specify the maximum number of hops. The returned list includes the source (first) and target (last) nodes: https://networkx.github.io/documentation/networkx-1.9/reference/generated/networkx.algorithms.simple_paths.all_simple_paths.html

While in networkit we find related functions such as networkit.distance.APSP (which computes the All-Pairs Shortest-Paths for all nodes in the graph), a function equivalent to networkx.all_simple_paths is missing.

Given the large performance advantage of networkit over networkx, it would be fantastic to provide a similar function in networkit. We would use it to replace networkx in our application (see: catmaid/CATMAID#1611). Our use case: to discover directed paths of a given length in neuronal circuits (in the jargon: polysynaptic pathways of a given length).

Thanks so much for developing networkit!

Enable assertions on travis

Currently the tests on travis are executed without assertions as far as I can see. I think it would make a lot of sense to enable them (while keeping optimizations on) as many of them check important internal properties of algorithms.

overview(G) failing for directed graphs

Produces the following error:

RuntimeError: Not implemented: Local clustering coefficient is currently not implemted for directed graphs

We should make sure that overview is not failing for directed graphs. I would propose to check whether the graph is directed or not and in case it is directed the clustering coefficient would be omitted. Thoughts?

QuadNodeCartesianEuclid/QuadNodePolarEuclid::getCellID uses wrong integer types

As clang notices, QuadNodeCartesianEuclid/QuadNodePolarEuclid::getCellID expect that an integer of type index might be -1, but this type is unsigned. Note also that this method tries to return -1 in some cases even though its result type is index, which is unsigned. Here the compiler warnings:

networkit/cpp/io/test/../../generators/quadtree/QuadNodePolarEuclid.h:665:21: warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare]
                                if (childresult >= 0) return childresult;
                                    ~~~~~~~~~~~ ^  ~
networkit/cpp/io/test/../../generators/quadtree/QuadNodeCartesianEuclid.h:532:21: warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare]
                                if (childresult >= 0) return childresult;
                                    ~~~~~~~~~~~ ^  ~

[Edit]: Actually, it seems there are even more methods affected by the same bug. Have a look at the compiler log of this travis job.

Problem installing networkit on Windows 10

I was having trouble installing networkit on Windows 10 using WSL as described on your website - https://networkit.iti.kit.edu/get_started.html#id5. I kept getting this error, even when installing from source:

 g++ -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c networkit/_NetworKit.cpp -o build/temp.linux-x86_64-3.5/networkit/_NetworKit.o -fopenmp -std=c++14 -O3 -DNOGTEST
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
    networkit/_NetworKit.cpp:4:20: fatal error: Python.h: No such file or directory
    compilation terminated.

Installing the python dev tools fixed the problem and I'm now able to use networkit. I'm opening this issues to suggest adding sudo apt-get install python3-dev to the instructions on your website and possibly to the README here.

Clean up on top level directory

I believe we should clean up the root directory of the project since it seems that there are a number of files that got there by accident or are no longer really needed.

Would like to get some feedback on whether we need to keep any of the following files in the root directory:

  • .pydevproject
  • LibDemo.cpp
  • README.rst
  • Run.py
  • benchmark.sh*
  • clean.sh*
  • mbe.py
  • optional_dependencies.txt
  • plot.sh*
  • requirements.txt
  • template.gnuplot
  • test.py*

The files marked with an asterisk could for example be kept in a separate scripts/ folder.

Thoughts?

Segfault while destructing network

I successfully built the CPP library, but whenever I deconstruct a NetworKit::Graph object I get a segfault.

I have tried everything from the graph builder to making empty graphs, no matter what, they all break

Closeness centrality: normalization and maximum misleading / wrong ?!

I recommend that normalization should actually be the default option for closeness centrality as it is in line with most common definitions of closeness.

Also, I believe that the maximum() method is wrong since the maximum value that can be obtained is 1, not 1/(n-1). Or am I missing something?

H.

Node labels in networkit

I need use networkit to deal with my graph like this:

  graph [
  node [
    id 0
    label "1"
  ]
  node [
    id 1
    label "2"
  ]
  node [
    id 2
    label "3"
  ]
  node [
    id 3
    label "5"
  ]
  node [
    id 4
    label "20"
  ]
  edge [
    source 0
    target 1
  ]
  edge [
    source 0
    target 2
  ]
  edge [
    source 0
    target 3
  ]
  edge [
    source 0
    target 4
  ]
]

I use python to deal with my data:

from networkit import * 
G = graphio.readGraph("test.gml",Format.GML) 
print(G.nodes())

I get:

[0, 1, 2, 3, 4]

My questions is-is there any way to deal with the node labels in my data? I need to use this label as an 'ID' to correspond with my whole data set for further analysis.

Counting number of shortest paths in SSSP algos

While looking at the fix of #98, I noticed the following bug: In Dijkstra.cpp we optionally count the number of shortest paths to all nodes. We do this by checking

distances[v] == distances[u] + w

this is actually wrong if the weights are not integer (e.g. 0.1 + 0.2 does not compare equal to 0.3 for double-precision floats).

I do not think there is an obvious fix for this problem. Things that we could do are:

  • Keep the code. It is simple and works for integers. Document that the code does not work for floating point numbers and/or emit a warning if we encounter this case.

  • Perform an epsilon comparison (i.e. consider two paths equal if their length only differs by some epsilon). This will require more complex changes to the case where the distance to a node is updated: We can no longer throw away all predecessors as we have to keep those that are still within epsilon of the new distance. This needs non-constant time. Furthermore, epsilon errors can accumulate along a path.

I am not sure how important path counting is and if there are any users of this feature (especially for floating point weights). Please comment on if you think that a real fix to this problem is worthwhile.

Bipartite graphs on Networkit

I am working with a huge bipartite graph, and the calculation of the projections is computationally very demanding. On the cluster I usually use Networkit, which of course is much more efficient than anything else when you have a lot of cores at your disposal, but I couldn't find any algorithm or function related to bipartite graphs. So I had to stick to the networkx.algorithms.bipartite module, but if I specify even a simple function for the calculation of the weights to be used in the projections with the bipartite.generic_weighted_projected_graph() function, the (quite powerful) cluster I am using simply won't make it.
Are you planning on extending Networkit to bipartite graphs? Is there any function or algorithm that already exists that maybe I missed?

LAMG testSmallGraphs is runtime-dependent

Currently, the testSmallGraphs test for LAMG requires the solver to converge within a given time frame. Depending on the execution environment (e.g. Travis) this might lead to a failed test. Should probably be a benchmark instead.

Update publications on website

Many publications on the NetworKit website are still marked "to appear" , although they have been out there for months. Please update, correct and add the links to the publishers!

testTopCloseness(Un)directed fails randomly

The test cases CentralityGTest.testTopClosenessUndirected and CentralityGTest.testTopClosenessDirected fail randomly and cannot be fixed by providing a random seed at the beginning of the test case. Code for testing:

while ./NetworKit-Tests-Opt --gtest_filter=\*testTopClosenessUndirected; do echo ; done

Probably this is due to the parallel algorithms used. With just one thread I cannot reproduce the problem. Is this an expected behaviour of the used algorithms, i.e. should we expect larger errors in when using multiple threads?

Remove uses of getStack()

Recently, getStack() was renamed to something else, but there are still a lot of uses of getStack in the tree, which generate annoying warnings.

Error messages could be made more helpful (or add verbose option?)

I had some problems with my c++ headers.

The setup.py simply tries to compile a sample.cpp file, but swallows all compilation errors:

Line 135:

subprocess.call([candidates[v],"-o","test_build","-std={}".format(stdFlags[i]),"-fopenmp","sample.cpp"],stdout=DEVNULL,stderr=DEVNULL)

I manually removed the stdout=DEVNULL,stderr=DEVNULL part and finally got a useful error message other than "ERROR: Test compilation with the following binary names was unsuccessful:..."

There are even some prints (lines 144, 141) in the comments that might be helpful.

I propose the addition of a verbose option, or additional prints of compilation errors to save people some time debugging.

If anyone with a similar problem finds this post, here is the SO article that helped me:
https://stackoverflow.com/questions/19575956/building-c-not-working-in-osx-10-9#19577599

Memory bug

Hello networkit developers,

I'm performing many shortest path computations in a large graph, |V| = 330675 and |E| =5152607. After 971 calls to networkit.distance.Dijkstra from python, networkit crashes with this traceback. It appears the memory buffer in networkit isn't being cleared after each call and is instead storing the paths from each call.

/home/clint/networkit/networkit/_NetworKit.pyx in _NetworKit.SSSP.getPath (networkit/_NetworKit.cpp:17405)()
1256 A shortest path from source to `t or an empty path.
1257 """
-> 1258 return (<_SSSP*>(self._this)).getPath(t, forward)
1259
1260 def getPaths(self, t, forward=True):

MemoryError: std::bad_alloc

Thanks,
Clint

NetworKit as an Anaconda package?

Hi,
I'm not sure it's the right place to ask or not, but do you have any plans to publish NetworKit as an anaconda package in the future?

Thanks.

networkit.generators

I am trying to run the function networkit.generators.BTERReplicator() but i am facing the following issue

error: 'tricnt_mex' undefined near line 83 column 9
error: called from
    tricnt at line 83 column 7
    ccperdeg at line 97 column 12
    /tmp/tmpz9d47pum/bter_wrapper.m at line 7 column 11
Traceback (most recent call last):
  File "test_other_generators.py", line 93, in <module>
    mesh_G_replica = BTER_generator(mesh_G)
  File "test_other_generators.py", line 16, in BTER_generator
    G_replica = gen.generate()
  File "/home/varsha/.local/lib/python3.5/site-packages/networkit/generators.py", line 65, in generate
    G_bter = graphio.readMat(tempFileOut, key='G_bter')
  File "/home/varsha/.local/lib/python3.5/site-packages/networkit/graphio.py", line 181, in readMat
    matlabObject = scipy.io.loadmat(path)
  File "/home/varsha/.local/lib/python3.5/site-packages/scipy/io/matlab/mio.py", line 141, in loadmat
    MR, file_opened = mat_reader_factory(file_name, appendmat, **kwargs)
  File "/home/varsha/.local/lib/python3.5/site-packages/scipy/io/matlab/mio.py", line 64, in mat_reader_factory
    byte_stream, file_opened = _open_file(file_name, appendmat)
TypeError: 'NoneType' object is not iterable

I am also trying to use `networkit.generators.RmatGenerator' i am not sure what path is required in setPath

Traceback (most recent call last):
  File "test_other_generators.py", line 95, in <module>
    mesh_G_replica = RMAT_generator(mesh_G)
  File "test_other_generators.py", line 28, in RMAT_generator
    gen.fit(G, scale=1)
  File "networkit/_NetworKit.pyx", line 2520, in networkit._NetworKit.RmatGenerator.fit (networkit/_NetworKit.cpp:29158)
  File "networkit/_NetworKit.pyx", line 2522, in networkit._NetworKit.RmatGenerator.fit (networkit/_NetworKit.cpp:28233)
RuntimeError: call setPaths class method first to configure

Could you please help me with same.
Thanks in advance

NetworKit as a shared library

Right now it is only possible to build a static library by executing scons --target=Lib --optimize=Opt.

Add another another target (e.g. Shared or SharedLib) which ensures NetworKit will be build as a shared library.

Use of functions deprecated in C++17

With C++17 almost here, any use of functions removed (and possibly even deprecated) in this version of the standard should be removed from the tree.

Luckily, the only such function in the NetworKit tree is "std::random_shuffle", which is used in two places, plus one commented out.

Of the two non-commented-out uses, one is in RandomSpanningTree and on in PseudoRandomSpanningTree. Both these classes are marked as deprecated and should probably be removed. The commented-out use is in NeighborhoodFunctionHeuristic.

Removing the two above classes *SpanningTree result in successful compilation with --std=c++17 (after 19005a1).

GraphGTest.testRemoveNode fails

#30 changed the behavior of Graph::removeNode but the corresponding test still expects the old behavior and is failing now (which is why e.g. #34 has failing tests now).

GraphGTest.testRemoveNode fails

#30 changed the behavior of Graph::removeNode but the corresponding test still expects the old behavior and is failing now (which is why e.g. #34 has failing tests now).

Set random seed: testDynamicHyperbolicGeneratorOnMovedNodes

Make sure the random number generators are properly seeded in the test.

networkit/cpp/generators/test/GeneratorsGTest.cpp:248: Failure
The difference between initialEdgeCount and expected is 607, which exceeds expected/5, where
initialEdgeCount evaluates to 3606,
expected evaluates to 2999, and
expected/5 evaluates to 599.
[  FAILED  ] GeneratorsGTest.testDynamicHyperbolicGeneratorOnMovedNodes (164 ms)

Git history broken

I've just noticed that somehow during the import of the repository into Git, a lot of commits didn't get any parent information which leaves us with a lot of commits that start with an empty repository. This makes git blame basically useless because it just points to one of these commits that appears to have added everything even though it did not. For example ee76da9 is one of these commits that I'm now getting as the commit that introduced everything even though this commit actually changed only a few lines in setup_util.py.

I fear it is now too late as several people already started working on this Git repository. But just in case we should consider re-importing the history I would suggest to use a tool for importing that imports such commits correctly. I would suggest git-remote-hg, e.g. in the fork https://github.com/mnauw/git-remote-hg. This is the tool I've used in the past to use NetworKit with git and it imports such commits correctly.

Profiling displays wrong results with deleted nodes

The profiling module considers deleted nodes as nodes with centrality 0 in many cases which leads to wrong plots. The notebook at http://nbviewer.jupyter.org/gist/michitux/c70f61c350b7de81a7e0e937ea31cb96 shows a very simple example. The graphs G and H are identical apart from 1000 deleted nodes (added and removed again). However, their profiles are very different. While for these graphs the problem is quite obvious, for graphs with skewed degree distributions the problem might go unnoticed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.