Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change in handling multilayer to allow for single intra-layer partition object #34

Open
wants to merge 72 commits into
base: master
Choose a base branch
from

Conversation

wweir827
Copy link

We have made some modifications to allow for running multilayer case with only two partition objects : a single igraph with all intralayer edges, and an interlayer igraph. For the intralayer VertexPartition object, the graph and a vector denoting the layer membership for each node is passed for creation. Having a fixed number of partition objects keeps the run time from ballooning for networks with many layers (as shown in the figure below).

To do this, we have modified GraphHelper to keep track of what portion of a given edge is within a layer in a vectorized weight. This allows us to calculate a layer specific null model contribution as is required in the multimodularity framework. We have also overridden several of the methods of MutableVertexPartition.cpp to allow for appropriate book keeping when creating condensed graphs.

image

wweir827 and others added 30 commits May 24, 2018 10:58
modified MutableVertexPartition to make methods virtual
Both these vectors represent properties of the underlying graph (not the
partition) as should be instantiated as such.
Reverted changes to MutableVertexPartition.h, removed raising of Python
exceptions in C++ helper functions, and corrected some references to
nonexistent variables.

init_admin(), move_node(), diff_move(), and quality() have not been
changed and remain broken.
# Conflicts:
#	src/VertexPartition.py
#	src/python_partition_interface.cpp
inserted divide by m in modularity calculation
…o handle caching of neighbors and edge weights by layer for each vertex
wweir827 and others added 19 commits June 5, 2018 09:20
# Conflicts:
#	src/RBConfigurationVertexPartitionWeightedLayers.cpp
#	tests/test_RBCVPweightedlayers.py
Before, much of the multi-layer data would not be initialized if all
nodes were assigned to the same layer (i.e. layer count of 1).
…eLayers

removed print lines
updated diff quality to account for 2* node_size.
…incorporate edge layer weights into the conglomerated graph

made layer_vec argument unnecessary for construction (default is to treat everything as sinlge layer)
modified function getting graph edges, weights, and nodes from the c++ side to create agglomerated version that returns edge weights by layers
…currently no need to do this)

fixed python facing method to get layer_weights
RBConfigurationVertexPartitionWeightedLayers optimization is roughly
100% faster now (i.e. it will take about half the time it used to).

Also removed an extraneous function in GraphHelper and changed the use
of IGRAPH_OUT to IGRAPH_IN in weight_from_comm.
The following files were not significantly changed and have been
reverted to their state in vtraag/louvain-igraph's master branch:
 - ModularityVertexPartition.h
 - Optimiser.h
 - MutableVertexPartition.cpp
 - python_optimiser_interface.cpp
 - RBConfigurationVertexPartition.cpp
@vtraag
Copy link
Owner

vtraag commented Jul 18, 2020

@rabisgon, I was thinking: the improvements you make here for running multilayer stuff could actually more easily implemented in the Leiden algorithm in igraph, which only implements CPM/modularity anyhow. The changes that were proposed in this PR would better fit with that implementation I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants