Giter Club home page Giter Club logo

louvain-igraph's People

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

louvain-igraph's Issues

Installation error

Hi vtraag,
I tried to installed the louvain package by pip install louvain. But it reported an error, it confused me a lot. Here is my error:
Running setup.py clean for louvain
Failed to build louvain
Installing collected packages: louvain
Running setup.py install for louvain ... error
ERROR: Complete output from command /Users/huangxingnan/anaconda3/bin/python -u -c 'import setuptools, tokenize;file='"'"'/private/var/folders/rx/gl3grkfd4pv0zvvs5h2l0pvr0000gn/T/pip-install-k310zhra/louvain/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/rx/gl3grkfd4pv0zvvs5h2l0pvr0000gn/T/pip-record-qyr2h3sa/install-record.txt --single-version-externally-managed --compile:
ERROR: running install
running build
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-3.7
creating build/lib.macosx-10.7-x86_64-3.7/louvain
copying src/functions.py -> build/lib.macosx-10.7-x86_64-3.7/louvain
copying src/Optimiser.py -> build/lib.macosx-10.7-x86_64-3.7/louvain
copying src/VertexPartition.py -> build/lib.macosx-10.7-x86_64-3.7/louvain
copying src/_version.py -> build/lib.macosx-10.7-x86_64-3.7/louvain
copying src/init.py -> build/lib.macosx-10.7-x86_64-3.7/louvain
Fixing build/lib.macosx-10.7-x86_64-3.7/louvain/functions.py build/lib.macosx-10.7-x86_64-3.7/louvain/Optimiser.py build/lib.macosx-10.7-x86_64-3.7/louvain/VertexPartition.py build/lib.macosx-10.7-x86_64-3.7/louvain/_version.py build/lib.macosx-10.7-x86_64-3.7/louvain/init.py
Skipping optional fixer: buffer
Skipping optional fixer: idioms
Skipping optional fixer: set_literal
Skipping optional fixer: ws_comma
Fixing build/lib.macosx-10.7-x86_64-3.7/louvain/functions.py build/lib.macosx-10.7-x86_64-3.7/louvain/Optimiser.py build/lib.macosx-10.7-x86_64-3.7/louvain/VertexPartition.py build/lib.macosx-10.7-x86_64-3.7/louvain/_version.py build/lib.macosx-10.7-x86_64-3.7/louvain/init.py
Skipping optional fixer: buffer
Skipping optional fixer: idioms
Skipping optional fixer: set_literal
Skipping optional fixer: ws_comma
UPDATING build/lib.macosx-10.7-x86_64-3.7/louvain/_version.py
set build/lib.macosx-10.7-x86_64-3.7/louvain/_version.py to '0.6.1'
running build_ext
Cannot find the C core of igraph on this system using pkg-config.
Build type: static extension
Include path: igraphcore/include
Library path: igraphcore/lib /usr/local/lib /usr/lib
Linked dynamic libraries: xml2 z m stdc++
Linked static libraries: igraphcore/lib/libigraph.a
Extra compiler options:
Extra linker options:
building 'louvain._c_louvain' extension
creating build/temp.macosx-10.7-x86_64-3.7
creating build/temp.macosx-10.7-x86_64-3.7/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/huangxingnan/anaconda3/include -arch x86_64 -I/Users/huangxingnan/anaconda3/include -arch x86_64 -Iinclude -Iigraphcore/include -I/Users/huangxingnan/anaconda3/include/python3.7m -c src/SignificanceVertexPartition.cpp -o build/temp.macosx-10.7-x86_64-3.7/src/SignificanceVertexPartition.o
warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
In file included from src/SignificanceVertexPartition.cpp:1:
In file included from include/SignificanceVertexPartition.h:4:
include/MutableVertexPartition.h:4:10: fatal error: 'string' file not found
#include
^~~~~~~~
1 warning and 1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command "/Users/huangxingnan/anaconda3/bin/python -u -c 'import setuptools, tokenize;file='"'"'/private/var/folders/rx/gl3grkfd4pv0zvvs5h2l0pvr0000gn/T/pip-install-k310zhra/louvain/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/rx/gl3grkfd4pv0zvvs5h2l0pvr0000gn/T/pip-record-qyr2h3sa/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/rx/gl3grkfd4pv0zvvs5h2l0pvr0000gn/T/pip-install-k310zhra/louvain/

Compiling without -fPIC option

pip install louvain
...
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++    g++ -pthread -shared build/temp.linux-x86_64-3.4/src/Optimiser.o build/temp.linux-x86_64-3.4/src/RBConfigurationVertexPartition.o build/temp.linux-x86_64-3.4/src/SignificanceVertexPartition.o build/temp.linux-x86_64-3.4/src/GraphHelper.o build/temp.linux-x86_64-3.4/src/pynterface.o build/temp.linux-x86_64-3.4/src/MutableVertexPartition.o build/temp.linux-x86_64-3.4/src/ModularityVertexPartition.o build/temp.linux-x86_64-3.4/src/CPMVertexPartition.o build/temp.linux-x86_64-3.4/src/RBERVertexPartition.o build/temp.linux-x86_64-3.4/src/SurpriseVertexPartition.o build/temp.linux-x86_64-3.4/src/LinearResolutionParameterVertexPartition.o igraphcore/lib/libigraph.a /usr/lib64/libm.a -Ligraphcore/lib -L/usr/local/lib64 -L/usr/local/lib -L/usr/lib64 -L/usr/lib -L/lib64 -L/lib -L/home/jeffrey_alstott/anaconda3/lib -lxml2 -lz -lstdc++ -lpython3.4m -o build/lib.linux-x86_64-3.4/louvain/_c_louvain.cpython-34m.so    /usr/bin/ld: /usr/lib64/libm.a(s_sin.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
    /usr/lib64/libm.a: could not read symbols: Bad value    collect2: ld returned 1 exit status
    error: command 'g++' failed with exit status 1

    ----------------------------------------Command "/home/jeffrey_alstott/anaconda3/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-xyr3bqj7/louvain/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-7mrpn5yv-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-xyr3bqj7/louvain

This is probably analogous to here:
https://lists.nongnu.org/archive/html/igraph-help/2014-09/msg00041.html
(I know it's analogous, because I'm the same poor soul in the mailing list working on a machine without admin rights, whose libraries were compiled without the -fPIC option.)

Evidently there's a workaround that python-igraph implemented starting in 0.7.1 or so.

Install fails on ArchLinux

Hi.
I use ArchLinux, and can't install library. I run
pip install louvain
And got this:

g++ -pthread -shared -Wl,-O1,--sort-common,--as-needed,-z,relro build/temp.linux-x86_64-3.4/src/GraphHelper.o build/temp.linux-x86_64-3.4/src/MutableVertexPartition.o build/temp.linux-x86_64-3.4/src/pynterface.o build/temp.linux-x86_64-3.4/src/RBConfigurationVertexPartition.o build/temp.linux-x86_64-3.4/src/Optimiser.o build/temp.linux-x86_64-3.4/src/LinearResolutionParameterVertexPartition.o build/temp.linux-x86_64-3.4/src/RBERVertexPartition.o build/temp.linux-x86_64-3.4/src/SurpriseVertexPartition.o build/temp.linux-x86_64-3.4/src/ModularityVertexPartition.o build/temp.linux-x86_64-3.4/src/SignificanceVertexPartition.o build/temp.linux-x86_64-3.4/src/CPMVertexPartition.o igraphcore/lib/libigraph.a /usr/lib64/libz.a /usr/lib64/libm.a /usr/lib64/libstdc++.a -Ligraphcore/lib -L/usr/local/lib -L/usr/lib64 -L/usr/lib -L/lib64 -L/lib -L/usr/lib -lxml2 -lpython3.4m -o build/lib.linux-x86_64-3.4/louvain/_c_louvain.cpython-34m.so
    /usr/bin/ld: /usr/lib64/libm.a(s_sin.o): relocation R_X86_64_32S against `__sincostab' can not be used when making a shared object; recompile with -fPIC
    /usr/lib64/libm.a: error adding symbols: Bad value
    collect2: error: ld returned 1 exit status
    error: command 'g++' failed with exit status 1
gcc version 4.9.2 20150304 (prerelease) (GCC)
Python 3.4.3

Any thought why could this happen? Maybe it is distro issue or something else?

Thanks.

Weighted graph parameter

Hi, I was wondering whether you need to explicitly pass a list of weights into the function: louvain.find_partition(G, louvain.ModularityVertexPartition, weights = list_weights)
or whether you can first construct a weighted graph in igraph and pass this directly into find_partition:
e.g.
G_sim = ig.Graph(list(new_edgelist), edge_attrs={'weight': sim_list_new})
partitions = louvain.find_partition(G_sim, louvain.ModularityVertexPartition)
Thank you

Reuse Graph object across various runs

Currently, the Graph object is reallocated on every call to find_partition from python, which can be either memory or CPU intensive, depending on the use case. If one could allocate this once and then reuse it on subsequent calls, it would be better.

Can I get the number of output partitions customly?

Hi, vtraag:
Thanks for your works.
I have a little question that i just get three partitions about my data. So, I want to change the number of clustering output of the louvain methods. Is there any setting I can change to make this work?

Unhandled exception in Graph::collapse_graph (GraphHelper.cpp:563)

Here there is a check for total_collapsed_weight being equal to this->total_weight. As they both are floats, check is done by comparing difference to small epsilon (1e-6).

Unfortunately when I'm louvain on the big graph with real weights precision errors accumulate and this comparison fails.

What makes it worse is that it rises C++ exception which is not handled anywhere, and therefore causes core dump to my Python program.

install louvain issue for macOS

Hi,

I have some issue with installation of louvain for macOS. I have installed python-igraph version 0.8.0 and it works well. When there is some issue to install louvain by using the command: sudo pip install louvain. The details are attached as follows. Could you please help me to solve this. Thank you so much in advance. Looking forward to your reply.

wc-dhcp38d180:~ user$ python
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 12:04:33)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import igraph
print(igraph.version)
0.8.0
import louvain
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'louvain'

[1]+ Stopped python
wc-dhcp38d180:~ user$ sudo pip install louvain
Password:
WARNING: The directory '/Users/user/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting louvain
Downloading louvain-0.6.1.tar.gz (84 kB)
|████████████████████████████████| 84 kB 3.7 MB/s
Requirement already satisfied: python-igraph>=0.7.1.0 in /anaconda3/lib/python3.6/site-packages (from louvain) (0.8.0)
Requirement already satisfied: texttable>=1.6.2 in /anaconda3/lib/python3.6/site-packages (from python-igraph>=0.7.1.0->louvain) (1.6.2)
Building wheels for collected packages: louvain
Building wheel for louvain (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-h9qyyj5m/louvain/setup.py'"'"'; file='"'"'/private/tmp/pip-install-h9qyyj5m/louvain/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /private/tmp/pip-wheel-0d36i606
cwd: /private/tmp/pip-install-h9qyyj5m/louvain/
Complete output (85 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-3.6
creating build/lib.macosx-10.7-x86_64-3.6/louvain
copying src/functions.py -> build/lib.macosx-10.7-x86_64-3.6/louvain
copying src/Optimiser.py -> build/lib.macosx-10.7-x86_64-3.6/louvain
copying src/VertexPartition.py -> build/lib.macosx-10.7-x86_64-3.6/louvain
copying src/_version.py -> build/lib.macosx-10.7-x86_64-3.6/louvain
copying src/init.py -> build/lib.macosx-10.7-x86_64-3.6/louvain
Fixing build/lib.macosx-10.7-x86_64-3.6/louvain/functions.py build/lib.macosx-10.7-x86_64-3.6/louvain/Optimiser.py build/lib.macosx-10.7-x86_64-3.6/louvain/VertexPartition.py build/lib.macosx-10.7-x86_64-3.6/louvain/_version.py build/lib.macosx-10.7-x86_64-3.6/louvain/init.py
Skipping optional fixer: buffer
Skipping optional fixer: idioms
Skipping optional fixer: set_literal
Skipping optional fixer: ws_comma
Fixing build/lib.macosx-10.7-x86_64-3.6/louvain/functions.py build/lib.macosx-10.7-x86_64-3.6/louvain/Optimiser.py build/lib.macosx-10.7-x86_64-3.6/louvain/VertexPartition.py build/lib.macosx-10.7-x86_64-3.6/louvain/_version.py build/lib.macosx-10.7-x86_64-3.6/louvain/init.py
Skipping optional fixer: buffer
Skipping optional fixer: idioms
Skipping optional fixer: set_literal
Skipping optional fixer: ws_comma
UPDATING build/lib.macosx-10.7-x86_64-3.6/louvain/_version.py
set build/lib.macosx-10.7-x86_64-3.6/louvain/_version.py to '0.6.1'
running build_ext
Cannot find the C core of igraph on this system using pkg-config.
We will now try to download and compile the C core from scratch.
Version number of the C core: 0.7.1

Downloading igraph-0.7.1.tar.gz... 100.00%
Extracting igraph-0.7.1.tar.gz...
Configuring igraph...
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in /private/tmp/igraph.lvg7m9kg/igraph-0.7.1': configure: error: cannot run C compiled programs. If you meant to cross compile, use --host'.
See `config.log' for more details
Could not download and compile the C core of igraph.

WARNING: we were not able to detect where igraph is installed on
your machine (if it is installed at all). We will use the fallback
library and include paths hardcoded in setup.py and hope that the
C core of igraph is installed there.

If the compilation fails and you are sure that igraph is installed
on your machine, adjust the following two variables in setup.py
accordingly and try again:

  • LIBIGRAPH_FALLBACK_INCLUDE_DIRS ['/usr/include/igraph', '/usr/local/include/igraph']
  • LIBIGRAPH_FALLBACK_LIBRARY_DIRS []

Build type: dynamic extension
Include path: /usr/include/igraph /usr/local/include/igraph
Library path:
Linked dynamic libraries: igraph
Linked static libraries:
Extra compiler options:
Extra linker options:
building 'louvain._c_louvain' extension
creating build/temp.macosx-10.7-x86_64-3.6
creating build/temp.macosx-10.7-x86_64-3.6/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/include -arch x86_64 -I/anaconda3/include -arch x86_64 -Iinclude -I/usr/include/igraph -I/usr/local/include/igraph -I/anaconda3/include/python3.6m -c src/SignificanceVertexPartition.cpp -o build/temp.macosx-10.7-x86_64-3.6/src/SignificanceVertexPartition.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from /usr/local/include/c++/7.1.0/bits/postypes.h:40:0,
from /usr/local/include/c++/7.1.0/bits/char_traits.h:40,
from /usr/local/include/c++/7.1.0/string:40,
from include/MutableVertexPartition.h:4,
from include/SignificanceVertexPartition.h:4,
from src/SignificanceVertexPartition.cpp:1:
/usr/local/include/c++/7.1.0/cwchar:44:10: fatal error: wchar.h: No such file or directory
#include <wchar.h>
^~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1

ERROR: Failed building wheel for louvain
Running setup.py clean for louvain
Failed to build louvain
Installing collected packages: louvain
Running setup.py install for louvain ... error
ERROR: Command errored out with exit status 1:
command: /anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-h9qyyj5m/louvain/setup.py'"'"'; file='"'"'/private/tmp/pip-install-h9qyyj5m/louvain/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/tmp/pip-record-245ts40g/install-record.txt --single-version-externally-managed --compile --install-headers /anaconda3/include/python3.6m/louvain
cwd: /private/tmp/pip-install-h9qyyj5m/louvain/
Complete output (85 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-3.6
creating build/lib.macosx-10.7-x86_64-3.6/louvain
copying src/functions.py -> build/lib.macosx-10.7-x86_64-3.6/louvain
copying src/Optimiser.py -> build/lib.macosx-10.7-x86_64-3.6/louvain
copying src/VertexPartition.py -> build/lib.macosx-10.7-x86_64-3.6/louvain
copying src/_version.py -> build/lib.macosx-10.7-x86_64-3.6/louvain
copying src/init.py -> build/lib.macosx-10.7-x86_64-3.6/louvain
Fixing build/lib.macosx-10.7-x86_64-3.6/louvain/functions.py build/lib.macosx-10.7-x86_64-3.6/louvain/Optimiser.py build/lib.macosx-10.7-x86_64-3.6/louvain/VertexPartition.py build/lib.macosx-10.7-x86_64-3.6/louvain/_version.py build/lib.macosx-10.7-x86_64-3.6/louvain/init.py
Skipping optional fixer: buffer
Skipping optional fixer: idioms
Skipping optional fixer: set_literal
Skipping optional fixer: ws_comma
Fixing build/lib.macosx-10.7-x86_64-3.6/louvain/functions.py build/lib.macosx-10.7-x86_64-3.6/louvain/Optimiser.py build/lib.macosx-10.7-x86_64-3.6/louvain/VertexPartition.py build/lib.macosx-10.7-x86_64-3.6/louvain/_version.py build/lib.macosx-10.7-x86_64-3.6/louvain/init.py
Skipping optional fixer: buffer
Skipping optional fixer: idioms
Skipping optional fixer: set_literal
Skipping optional fixer: ws_comma
UPDATING build/lib.macosx-10.7-x86_64-3.6/louvain/_version.py
set build/lib.macosx-10.7-x86_64-3.6/louvain/_version.py to '0.6.1'
running build_ext
Cannot find the C core of igraph on this system using pkg-config.
We will now try to download and compile the C core from scratch.
Version number of the C core: 0.7.1

Downloading igraph-0.7.1.tar.gz... 100.00%
Extracting igraph-0.7.1.tar.gz...
Configuring igraph...
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/private/tmp/igraph.1hbwqc6m/igraph-0.7.1':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
Could not download and compile the C core of igraph.

WARNING: we were not able to detect where igraph is installed on
your machine (if it is installed at all). We will use the fallback
library and include paths hardcoded in setup.py and hope that the
C core of igraph is installed there.

If the compilation fails and you are sure that igraph is installed
on your machine, adjust the following two variables in setup.py
accordingly and try again:

- LIBIGRAPH_FALLBACK_INCLUDE_DIRS ['/usr/include/igraph', '/usr/local/include/igraph']
- LIBIGRAPH_FALLBACK_LIBRARY_DIRS []

Build type: dynamic extension                                    
Include path: /usr/include/igraph /usr/local/include/igraph
Library path:
Linked dynamic libraries: igraph
Linked static libraries:
Extra compiler options:
Extra linker options:
building 'louvain._c_louvain' extension
creating build/temp.macosx-10.7-x86_64-3.6
creating build/temp.macosx-10.7-x86_64-3.6/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/include -arch x86_64 -I/anaconda3/include -arch x86_64 -Iinclude -I/usr/include/igraph -I/usr/local/include/igraph -I/anaconda3/include/python3.6m -c src/SignificanceVertexPartition.cpp -o build/temp.macosx-10.7-x86_64-3.6/src/SignificanceVertexPartition.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from /usr/local/include/c++/7.1.0/bits/postypes.h:40:0,
                 from /usr/local/include/c++/7.1.0/bits/char_traits.h:40,
                 from /usr/local/include/c++/7.1.0/string:40,
                 from include/MutableVertexPartition.h:4,
                 from include/SignificanceVertexPartition.h:4,
                 from src/SignificanceVertexPartition.cpp:1:
/usr/local/include/c++/7.1.0/cwchar:44:10: fatal error: wchar.h: No such file or directory
 #include <wchar.h>
          ^~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------

ERROR: Command errored out with exit status 1: /anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-h9qyyj5m/louvain/setup.py'"'"'; file='"'"'/private/tmp/pip-install-h9qyyj5m/louvain/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/tmp/pip-record-245ts40g/install-record.txt --single-version-externally-managed --compile --install-headers /anaconda3/include/python3.6m/louvain Check the logs for full command output.

Matching seurat's louvain clustering

I am new to graph based clustering algorithms and I was hoping you could help me out. I want to use this package to try to match the louvain clustering used in an R pacakge called seurat. They use modularity optimizer (http://www.ludowaltman.nl/slm/). They say:
"the Modularity Optimizer also provides an implementation of the well-known Louvain algorithm for large-scale community detection developed by Blondel, Guillaume, Lambiotte, and Lefebvre (2008). An extension of the Louvain algorithm with a multilevel refinement procedure, as proposed by Rotta and Noack (2011), is implemented as well"

I am not sure which of the partitioners you have provided (if any) match the implementation described above, could you provide any insight? Or point me towards resources about louvain clustering methods?

I appreciate any help you can provide. Thanks for the great package!

With 'Modularity', communities aren't stable to scale of weights

I have a fully connected, undirected graph of 121 nodes. The community structure that louvain returns is heavily affected by the scale of the weights. At the original weight values, all the nodes are placed in their own individual communities. But by simply multiplying all the weights by 100, we can change the community structure. Is this expected?

from numpy import *
import louvain
g = Graph.Full(121)
weight_sequence = rand(g.ecount())
g.es['weight'] = weight_sequence
h = louvain.find_partition(g, method='Modularity', weight='weight')
print(len(h.sizes())) ### Returns 121 communities

g.es['weight'] = weight_sequence*100
h = louvain.find_partition(g, method='Modularity', weight='weight')
print(len(h.sizes())) ### Returns 6 communities

I would have thought the Modularity method compares to a null model with the same total amount of weight on the links. Is that not the case?

Reproducibility: option 'random_state'?

Hi!

I've made very good experiences with the package so far, but exact reproducibility of detected communities is an issue for me. Is it possible to fix srand or whatever causes the non-determinism in the algorithm via an option random_state, which sets an integer value for the seed (this is the scikit-learn convention). Or something similar?

Thank you very much!
Alex

`louvain.set_rng_seed` throws error in current release

It looks like the current version of louvain has a bug in the set_rng_seed function:

import louvain
print(louvain.__version__)
# 0.6.2
louvain.set_rng_seed(1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/isaac/miniconda3/envs/louvain-install/lib/python3.7/site-packages/louvain/functions.py", line 25, in set_rng_seed
    _c_louvain._set_rng_seed(seed)
AttributeError: module 'louvain._c_louvain' has no attribute '_set_rng_seed'

Previously reported here: scverse/scanpy#1191

Non-negative weights

The weighted sampling only works with non-negative weights. There should be an option that can explicitly passed to either use or not use that functionality.

Weighted modularity not correct?

I noticed louvain-igraph gave different modularity values than I expected, and I found a small example where it seems the package is not taking the weights into account:

import igraph
import louvain
import numpy as np

A = np.array([[ 0.,  2.,  2.,  0.,  0.,  0.],
       [ 2.,  0.,  2.,  0.,  0.,  0.],
       [ 2.,  2.,  0.,  1.,  0.,  0.],
       [ 0.,  0.,  1.,  0.,  2.,  2.],
       [ 0.,  0.,  0.,  2.,  0.,  2.],
       [ 0.,  0.,  0.,  2.,  2.,  0.]])

g = igraph.Graph()
g.add_vertices(len(A))
ix, jx = A.nonzero()
for i,j in zip(ix, jx):
    if i<j:
        g.add_edge(i, j, weight=A[i,j])

part = louvain.find_partition(g, louvain.ModularityVertexPartition, weights='weight')
print(part.membership)
print(part.modularity)

Gives output:

[0, 0, 0, 1, 1, 1]
0.357142857142857

With my own calculations, as well as through other implementations, I find an (optimal) modularity value of 0.423 for this partiton. The modularity value of 0.357 is valid for the non-weighted equivalent of the graph.

Am I overlooking something or is this a bug in the code?

numpy interface

It seems this the Python C API using PyFloat* and PyLong* do not work correctly anymore for numpy in Python 3. It should be dealt with in a different way for python3 using the number protocol I believe. See also numpy/numpy#2951.

Pip setup on osx crashing

Hello,

Attempting to install louvain via pip appears to crash, very rapidly and very uninformatively:

mib111492i:scanpy kp9$ pip install louvain>=0.6
Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-tlgg517a/louvain/

Setting up from the GitHub source works just fine, mind you. Any idea what may be going on here?

Duplicated stdout

A simple python script with:

import louvain
print "hello"

when executed prints twice:

$ python louvain.py
hello
hello

Needless to say that it prints normally without the import.

I installed louvain as suggested: pip install louvain .

Have you observed this behavior before? Thanks!

Installation on Windows

Dear Vincent,

we have found that installing the current louvain-igraph package is difficult on Windows as we couldn't find any igraph binary installers for python 3.6. In particular, the ones on https://www.lfd.uci.edu/~gohlke/pythonlibs/ only support python 3.5.

Would it be possible for you to also provide a wheel for louvain version 0.6.1 for python 3.5. on https://pypi.python.org/pypi/louvain - you did this for the previous louvain version? Or do you have an idea where we can find binary installers for igraph that run with python 3.6?

Thank you very much for your help!
Alex

Optimiser.consider_empty_communities should be initialized

Optimiser::consider_empty_communities is never initialized (unless Optimiser.consider_empty_community is explicitly set from Python).

Hence, the if statement on line 402 of Optimiser.cpp is undefined behavior.

In fact, while Optimiser.py states that this value defaults to True, it is often 0.

I've also seen consider_empty_communities evaluate to 32732 and 1081192448 (among many other "True" values), depending on whatever happened to reside in memory at the time.

A fix is to simply set this->consider_empty_community = true; in the Optimiser constructor (if defaulting to True is indeed intended).

For what it's worth, the valgrind error that initially alerted us to this problem (while writing #34) is as follows:

Conditional jump or move depends on uninitialised value(s)
   at: Optimiser::move_nodes(std::vector<MutableVertexPartition*, std::allocator<MutableVertexPartition*> >, std::vector<double, std::allocator<double> >, int, int) (Optimiser.cpp:402)
   by: Optimiser::move_nodes(std::vector<MutableVertexPartition*, std::allocator<MutableVertexPartition*> >, std::vector<double, std::allocator<double> >) (Optimiser.cpp:273)
   by: Optimiser::optimise_partition(std::vector<MutableVertexPartition*, std::allocator<MutableVertexPartition*> >, std::vector<double, std::allocator<double> >) (Optimiser.cpp:116)

Conditional jump or move depends on uninitialised value(s)
   at: Optimiser::move_nodes(std::vector<MutableVertexPartition*, std::allocator<MutableVertexPartition*> >, std::vector<double, std::allocator<double> >, int, int) (Optimiser.cpp:402)
   by: Optimiser::move_nodes(std::vector<MutableVertexPartition*, std::allocator<MutableVertexPartition*> >, std::vector<double, std::allocator<double> >) (Optimiser.cpp:273)
   by: Optimiser::optimise_partition(std::vector<MutableVertexPartition*, std::allocator<MutableVertexPartition*> >, std::vector<double, std::allocator<double> >) (Optimiser.cpp:116)
   by: Optimiser::optimise_partition(MutableVertexPartition*) (Optimiser.cpp:46)
   by: _Optimiser_optimise_partition (python_optimiser_interface.cpp:76)

Advantages over igraph Louvain algorithm

Hi!

is there an advantage of this implementation over igraph.community_multilevel()? There seem to be differences, e.g., as the latter does not have a resolution parameter.

Thank you!
Alex

Do not know how to install louvain

Hi,

I am using scanpy which also requires louvain to be installed (https://github.com/theislab/scanpy/blob/master/docs/installation.rst). On my own laptop, I would install through anaconda and have louvain.

However, I could not install or use it on my server.

First, I previously used python 3.5.2 and installed louvain (0.6.1) through "pip install louvain --user" as well as python-igraph (0.7.1.post6). When I run the code, I got:

"../site-packages/matplotlib/path.py", line 17, in
from . import _path, rcParams
ImportError: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by
../lib/python3.6/site-packages/matplotlib/_path.cpython-36m-x86_64-linux-gnu.so)

Second, I changed to anaconda virtual environment of python version 3.6 and installed louvain 0.6.1 and python-igraph (0.7.1.post6) and (python-louvain 0.11) . I got:
"
../lib/python3.6/site-packages/matplotlib/path.py", line 17, in
from . import _path, rcParams
ImportError: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by ../.conda/envs/virtual_env/lib/python3.6/site-packages/matplotlib/_path.cpython-36m-x86_64-linux-gnu.so)"

Third, I changed to venv virtual environment built from python 3.6 from anaconda 3. I could not install louvain. When I did "pip install louvain", I got:

../compiler_compat/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
error: command 'g++' failed with exit status 1

Although I could install python-louvain, I got when I run my code:

../lib/python3.6/site-packages/scanpy/tools/louvain.py", line 109, in louvain
import louvain
ModuleNotFoundError: No module named 'louvain'

Do you know what might cause this and how to solve the problem that louvain could not be installed on server?

plotting issue

I have a graph with 279 nodes and when I do
partition = louvain.find_partition(G, louvain.ModularityVertexPartition)
it gives me 11 partitions the problem is ig.plot(partition) does not work, I hve tried with 'Zachary' and it is fine. Is there any limitation for the number of clusters it can plot??

size_t arithmetic

Have to check the size_t arithmetic in the case of a difference of such variables. That might result in errors because the difference of two size_t variables might be negative, hence resulting in too large values (because size_t is unsigned).

How to cite the package

Hi @vtraag, I am using your package for in my research.

I would like to cite this package explicitly if it is possible.
I will definitely cite the various papers you have listed in the README, as they apply.

Have you thought about minting a DOI for this repo using zenodo?

Thanks for the awesome project.

Edge weights nan

There seem to be some issues when edge weights are nan. We should make sure the presence of such weights do not pose a problem.

louvain.__version__ returns 'Please install this project with setup.py'

I have two CentOS 7 instance, one with Python 3.5 and one with Python 3.6.
The performance of louvain-igraph's find_partition method is 3.5x slower on Python 3.6:
louvain.find_partition(g, method='Modularity', weight='weight')

So I am trying to figure out what is the difference between these two, and the only thing I find is the difference in how they react to louvain.__version__:

On the good instance:

>>> louvain.__version__
'0.5.3'

On the bad one:

>>> louvain.__version__
'Please install this project with setup.py'

Now in both cases, even when for the 'bad' one, louvain-igraph has been compiled with setup.py.

Are there some known issues with Python 3.6?
3.5x performance degradation is pretty major.

"library not found for -lSystem" on mac due to old gcc via brew

(noting an issue I faced while installing)

I was seeing this error from pip install louvain on macOS:

ld: library not found for -lSystem
collect2: error: ld returned 1 exit status
error: command 'g++' failed with exit status 1

Turns out I had an old version of gcc linked in brew:

$ ls -l /usr/local/bin/g++*
lrwxr-xr-x 1 … /usr/local/bin/g++ -> g++-4.9
lrwxr-xr-x 1 … /usr/local/bin/g++-4.9 -> ../Cellar/[email protected]/4.9.4_1/bin/g++-4.9
lrwxr-xr-x 1 … /usr/local/bin/g++-7 -> ../Cellar/gcc@7/7.4.0/bin/g++-7
lrwxr-xr-x 1 … /usr/local/bin/g++-8 -> ../Cellar/gcc/8.3.0/bin/g++-8

This fixed it:

sudo ln -sf /usr/local/bin/g++-8 /usr/local/bin/g++

Bisectioning optimality

For an interval (gamma_1, gamma_2) of resolution parameters, the partition with resolution parameter gamma_1 is optimal.

Is there a way to convert igraph.find_partition result in a dictionary with the original node ids in python?

Hello !
I use igraph in order to find the partitions in a given graph G:

InitialPartition = louvain.find_partition(G, louvain.ModularityVertexPartition,initial_membership=None, seed=0)

When I tried to access the partitions obtained above I found out that the initial ids of G nodes have changed from random integers that they were, into ordered integers starting from 0. E.g. when I use print(InitialPartition[104]) I get as result [2666, 2667] while when I use print(InitialPartition) in the position [104] the result is ... [104] 1105622, 430574 ... .

I want to store the InitialPartition result into a dictionary but keeping the original node ids i.e. for partition [104] the ids 1105622, 430574. How can I achieve it?

provide a seed argument to the Optimiser function

Thanks for this great package! I found the louvain clustering gives different clustering result sometimes with the same parameters. I believe this is because louvain clustering requires random seeding. I wonder whether you can provide an argument to explicitly set the seed for the Optimiser function so that the users can get consistent results every time they run if they pass a seed?

buildcfg.replace_static_libraries should avoid libm

On some systems libm.a is not compiled with -fPIC (on purpose). That will lead to link time errors like

CC -pthread -shared -Wl,-rpath,/opt/python/3.6.1.1.102/lib -fPIC build/temp.linux-x86_64-3.6/src/GraphHelper.o build/temp.linux-x86_64-3.6/src/ModularityVertexPartition.o build/temp.linux-x86_64-3.6/src/pynterface.o build/temp.linux-x86_64-3.6/src/LinearResolutionParameterVertexPartition.o build/temp.linux-x86_64-3.6/src/python_optimiser_interface.o build/temp.linux-x86_64-3.6/src/CPMVertexPartition.o build/temp.linux-x86_64-3.6/src/ResolutionParameterVertexPartition.o build/temp.linux-x86_64-3.6/src/SurpriseVertexPartition.o build/temp.linux-x86_64-3.6/src/RBConfigurationVertexPartition.o build/temp.linux-x86_64-3.6/src/python_partition_interface.o build/temp.linux-x86_64-3.6/src/Optimiser.o build/temp.linux-x86_64-3.6/src/MutableVertexPartition.o build/temp.linux-x86_64-3.6/src/RBERVertexPartition.o build/temp.linux-x86_64-3.6/src/SignificanceVertexPartition.o igraphcore/lib/libigraph.a /usr/lib64/libz.a /usr/lib64/libm.a -Ligraphcore/lib -L/usr/local/lib64 -L/usr/local/lib -L/usr/lib64 -L/usr/lib -L/lib64 -L/lib -L/opt/python/3.6.1.1.102/lib -lxml2 -lstdc++ -lpython3.6m -o build/lib.linux-x86_64-3.6/louvain/_c_louvain.cpython-36m-x86_64-linux-gnu.so
    /usr/bin/ld: /usr/lib64/libm.a(s_sin.o): relocation R_X86_64_32S against `__sincostab' can not be used when making a shared object; recompile with -fPIC
    /usr/lib64/libm.a: error adding symbols: Bad value

Of course, the correct solution would be to properly check whether a library has text objects which have been compiled for PIC; that seems to be impossible in a portable manner however.

pyhon-igraph solves the same problem by explicitly excluding libm from the candidates to be replaced; that may be good enough for a start.

#42 implements this

Support for Multi-layered network with cross node couplings

Does this implementation support a network where cross connections between nodes across layers exist? (Example connections like Node1 of Layer1 connected to Node 2 of Layer2) . Although the formula for Modularity does not support this but is there a way around?
I want to do community detection on such a network (basically a fully connected network). Any suggestions on how to achieve this if not supported by this package?

This issue/feature request has already been raised here. Any suggestion or advice is welcomed.

issue installing louvain due to new naming of igraph?

I'm very new at this. I attempted to install louvain with pip and got the error "Cannot find the C core of igraph on this system...." I updated the path in the setup.py file and it still isn't working. I noticed that the error script is referring to igraph as 'python-igraph', though my installation in the Anaconda3 Lib is igraph. Is there a name mismatch? Thanks. This happened on both of my Windows machines (Windows 10 and Windows 7).

How to exactly handle negative weights?

I started using louvain-igraph because of the possibility of using negative weights in community detection. However, I think your documentation is not very clear in some points and if possible I would like some clarification. Maybe I just misunderstood some parts.

  1. First, regarding the attribute consider_comms. From what I understood, I just needed to set this attribute (for example in ModularityVertexPartition) to ALL_COMMS, which I couldn't find how to do. How do I really setup this attribute?

  2. Looking a bit further, I discovered that CPMVertexPartition is prepared for negative weights. Doing some quick tests it seems it does what I want. However, it's not clear whether it uses ALL_COMMS or ALL_NEIGH_COMMS. Which one it uses? And would it be possible to configure this?

  3. Finally, in your pdf documentation you have a small section for negative weights. If I understood correctly, what you suggest there is to separate the graph in 2, where one has the positive weights, and the other the negative weights. So, this would create communities with many negative links which I think it's not what we want: we want negative weights to separate communities, not to have those weights inside one community, right? Did I understand something wrong? What would be the difference between the approach in CPMVertexPartition and the approach in this part of the documentation?

I hope you can clarify this, and maybe include the clarification in the documentation.

failed installation on Mac OS 10.11.6

I have already installed igraph (0.7.1_6) and python_igraph (0.7.1.post6), but still failed to install louvain. See messages below:

$ pip3 install louvain
Collecting louvain
Using cached louvain-0.6.1.tar.gz
Requirement already satisfied: python-igraph>=0.7.1.0 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/python_igraph-0.7.1.post6-py3.6-macosx-10.6-intel.egg (from louvain)
Installing collected packages: louvain
Running setup.py install for louvain ... error
Complete output from command /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;file='/private/var/folders/dz/lxnvmt213gv63__50z7gr0lc000114/T/pip-build-hor2axqc/louvain/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /var/folders/dz/lxnvmt213gv63__50z7gr0lc000114/T/pip-gf_hj07y-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.6-intel-3.6
creating build/lib.macosx-10.6-intel-3.6/louvain
copying src/init.py -> build/lib.macosx-10.6-intel-3.6/louvain
copying src/_version.py -> build/lib.macosx-10.6-intel-3.6/louvain
copying src/functions.py -> build/lib.macosx-10.6-intel-3.6/louvain
copying src/Optimiser.py -> build/lib.macosx-10.6-intel-3.6/louvain
copying src/VertexPartition.py -> build/lib.macosx-10.6-intel-3.6/louvain
Fixing build/lib.macosx-10.6-intel-3.6/louvain/init.py build/lib.macosx-10.6-intel-3.6/louvain/_version.py build/lib.macosx-10.6-intel-3.6/louvain/functions.py build/lib.macosx-10.6-intel-3.6/louvain/Optimiser.py build/lib.macosx-10.6-intel-3.6/louvain/VertexPartition.py
Skipping optional fixer: buffer
Skipping optional fixer: idioms
Skipping optional fixer: set_literal
Skipping optional fixer: ws_comma
Fixing build/lib.macosx-10.6-intel-3.6/louvain/init.py build/lib.macosx-10.6-intel-3.6/louvain/_version.py build/lib.macosx-10.6-intel-3.6/louvain/functions.py build/lib.macosx-10.6-intel-3.6/louvain/Optimiser.py build/lib.macosx-10.6-intel-3.6/louvain/VertexPartition.py
Skipping optional fixer: buffer
Skipping optional fixer: idioms
Skipping optional fixer: set_literal
Skipping optional fixer: ws_comma
UPDATING build/lib.macosx-10.6-intel-3.6/louvain/_version.py
set build/lib.macosx-10.6-intel-3.6/louvain/_version.py to '0.6.1'
running build_ext
Build type: dynamic extension
Include path: /usr/local/Cellar/igraph/0.7.1_6/include/igraph
Library path: /usr/local/Cellar/igraph/0.7.1_6/lib
Linked dynamic libraries: igraph
Linked static libraries:
Extra compiler options:
Extra linker options:
building 'louvain._c_louvain' extension
creating build/temp.macosx-10.6-intel-3.6
creating build/temp.macosx-10.6-intel-3.6/src
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -Iinclude -I/usr/local/Cellar/igraph/0.7.1_6/include/igraph -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c src/CPMVertexPartition.cpp -o build/temp.macosx-10.6-intel-3.6/src/CPMVertexPartition.o
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -Iinclude -I/usr/local/Cellar/igraph/0.7.1_6/include/igraph -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c src/GraphHelper.cpp -o build/temp.macosx-10.6-intel-3.6/src/GraphHelper.o
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -Iinclude -I/usr/local/Cellar/igraph/0.7.1_6/include/igraph -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c src/LinearResolutionParameterVertexPartition.cpp -o build/temp.macosx-10.6-intel-3.6/src/LinearResolutionParameterVertexPartition.o
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -Iinclude -I/usr/local/Cellar/igraph/0.7.1_6/include/igraph -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c src/ModularityVertexPartition.cpp -o build/temp.macosx-10.6-intel-3.6/src/ModularityVertexPartition.o
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -Iinclude -I/usr/local/Cellar/igraph/0.7.1_6/include/igraph -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c src/MutableVertexPartition.cpp -o build/temp.macosx-10.6-intel-3.6/src/MutableVertexPartition.o
In file included from src/MutableVertexPartition.cpp:1:
In file included from include/MutableVertexPartition.h:4:
In file included from /usr/include/c++/4.2.1/string:47:
In file included from /usr/include/c++/4.2.1/bits/char_traits.h:46:
/usr/include/c++/4.2.1/bits/stl_algobase.h:641:15: error: assigning to 'MutableVertexPartition *' from incompatible type 'const int'
*__first = __tmp;
^ ~~~~~
/usr/include/c++/4.2.1/bits/stl_algobase.h:665:39: note: in instantiation of function template specialization 'std::__fill_n::fill_n<MutableVertexPartition **, int, int>' requested here
return std::__fill_n<__scalar>::fill_n(__first, __n, __value);
^
/usr/include/c++/4.2.1/bits/stl_uninitialized.h:184:12: note: in instantiation of function template specialization 'std::fill_n<MutableVertexPartition **, int, int>' requested here
{ std::fill_n(__first, __n, __x); }
^
/usr/include/c++/4.2.1/bits/stl_uninitialized.h:219:12: note: in instantiation of function template specialization 'std::__uninitialized_fill_n_aux<MutableVertexPartition **, int, int>' requested here
std::__uninitialized_fill_n_aux(__first, __n, __x, _Is_POD());
^
/usr/include/c++/4.2.1/bits/stl_uninitialized.h:306:12: note: in instantiation of function template specialization 'std::uninitialized_fill_n<MutableVertexPartition **, int, int>' requested here
{ std::uninitialized_fill_n(__first, __n, __x); }
^
/usr/include/c++/4.2.1/bits/stl_vector.h:790:9: note: in instantiation of function template specialization 'std::__uninitialized_fill_n_a<MutableVertexPartition **, int, int, MutableVertexPartition *>' requested here
std::__uninitialized_fill_n_a(this->_M_impl._M_start, __n, __value,
^
/usr/include/c++/4.2.1/bits/stl_vector.h:261:4: note: in instantiation of function template specialization 'std::vector<MutableVertexPartition *, std::allocator<MutableVertexPartition *> >::_M_initialize_dispatch' requested here
_M_initialize_dispatch(__first, __last, _Integral());
^
src/MutableVertexPartition.cpp:219:35: note: in instantiation of function template specialization 'std::vector<MutableVertexPartition *, std::allocator<MutableVertexPartition > >::vector' requested here
vector<MutableVertexPartition
> partitions(1, NULL);
^
1 error generated.
error: command '/usr/bin/clang' failed with exit status 1

----------------------------------------

Command "/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;file='/private/var/folders/dz/lxnvmt213gv63__50z7gr0lc000114/T/pip-build-hor2axqc/louvain/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /var/folders/dz/lxnvmt213gv63__50z7gr0lc000114/T/pip-gf_hj07y-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/dz/lxnvmt213gv63__50z7gr0lc000114/T/pip-build-hor2axqc/louvain/

Modularity quality value not normalised

Either should be more clearly stated in the document that modularity is returned as a non-normalised value, or it should be normalised to coincide with the traditional definition.

Implementation of new method in Windows

I have installed this Louvain implementation using binary installer from https://www.lfd.uci.edu/~gohlke/pythonlibs/ on my Windows 64 bit OS and Python 2.7. I am interested to make a little improvement for my project. I want to add a new class in the source code. I have read your documentation, but I have no idea for where I can put the new class on Windows 64 bit OS platform. In site-packages where the source code being saved, there are only some python files (init.py, _version.py, functions.py, Optimiser.py, VertexPartition.py) and _c_louvain.pyd. Please help

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.