dpasch01 / signed-community-detection

A tool for community detection and evaluation in weighted networks with positive and negative edges

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduction

This package is a tool for community detection and evaluation in signed and weighted networks. This is an implementation of our paper on community detection, which extends Constant Potts Model (CPM) objective function optimized using Louvain algorithm, and uses the extended Map Equation for signed networks to find the scale parameter of CPM. Quality of arbitrary communities can be evaluated using the Map Equation as a more robust variant of Modularity; see this experimental and theoretical results.

Installation

Download the jar file from here (v1.0.0, 188kb). Start using the program by running java -jar <filename> -h.

This project is developed as a maven project. Run mvn package to build the jar file.

Community detection

Input graph format is required to be:

id1     id2     weight
...

where each line represents a link from id1 to id2; graph is considered undirected by default.

To detect the communities of graph.txt, run the command below:

mdl --verbose -g graph.txt -o partition.txt

each line of partition.txt will be node_id partition_id.

To detect communities at a specific resolution (or scale) 0.001, run:

mdl --verbose -r 0.001 -g graph.txt -o partition.txt

To detect communities at a specific interval-accuracy of resolution, run:

mdl --verbose -i 0.01 0.05 -a 0.01 -g graph.txt -o partition.txt

Generally, by sliding the resolution from 0 to 1, detected communities become smaller and denser.

Setting r = 0 is equivalent to Correlation Clustering that aims to minimize the number of negative (positive) edges inside (between) clusters regardless of the edge density.

Community evaluation

To evaluate the quality of an arbitrary partition partition.txt and write the evaluation result to mdl.txt, run:

mdl -g graph.txt -p partition.txt -o mdl.txt

If a graph is directed add --directed parameter. Evaluation is based on extended Map Equation (MDL) which supports directed links.

To evaluate a group of partition files partition-*.txt at once, run:

mdl -g graph.txt -p partition-*.txt -o mdl.txt

Other options can be viewed by:

mdl -h

For pre-processing a graph, such as extracting its positive or negative subgraphs, run:

preprocess -h

Performance

This algorithm requires O(E) memory space and O(ElogE) execution time for the detection of communities in a signed network having O(E) links.

Side note

This implementation differs from our main Matlab-MEX implementation that used an extended version of Louvain algorithm proposed by M. Rosvall and C. T. Bergstrom. In future, we will try to implement one of the Louvain's recent variants to improve the performance of algorithm.

Citation

If you find this project useful, please cite the paper as follows:

Esmailian, P. and Jalili, M., 2015. Community detection in signed networks: the role of negative ties in different scales. Scientific reports, 5, p.14339.

About

A tool for community detection and evaluation in weighted networks with positive and negative edges

License:Apache License 2.0


Languages

Language:Java 100.0%