Skip to content
MahsaSeifikarPublic

About

C-blondel: an efficient louvain-based dynamic community detection algorithm

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C-Blondel: an efficient Louvain-based dynamic community detection algorithm

This repository contains the implementation of C-Blondel, published in IEEE Transactions on Computational Social Systems. The implementation is in Java. The original paper can be found at the following link.

https://ieeexplore.ieee.org/abstract/document/8982190

What it does

C-Blondel detects communities in a graph that evolves over time (e.g. an email network, snapshotted into time periods) more efficiently than re-running static Louvain clustering from scratch on every snapshot. After the first snapshot, it reduces each new snapshot by collapsing communities that haven't changed much into single super-nodes, and only re-clusters the parts that have — using either node degree or PageRank to decide which communities have changed enough to be "destroyed" and re-expanded.

Requirements

  • JDK 25 or later
  • Maven 3.9+

Build

mvn compile

Test

mvn test      # unit tests
mvn verify    # unit tests + the integration test suite (golden-master regression test for the core algorithm)

Run

The CLI expects a directory of snapshot CSVs on disk — one SnapshotN.csv file per time period, each a source,target edge-pair list with a header row. Build a runnable classpath once, then invoke main.Main:

mvn dependency:build-classpath -Dmdep.outputFile=/tmp/cp.txt
java -cp "target/classes:$(cat /tmp/cp.txt)" main.Main \
    --algorithm=PROPOSED --destroyed-node=PR \
    --snapshots-dir=SnapShot_25day --output-dir=.

Flags (--algorithm/--destroyed-node values are case-insensitive):

Flag Values Default Notes
--algorithm LOUVAIN, PROPOSED (required) LOUVAIN re-runs plain Louvain on every snapshot (baseline); PROPOSED is the C-Blondel algorithm
--destroyed-node DEGREE, PR (required if --algorithm=PROPOSED) which metric decides a community is "destroyed"
--snapshots-dir path SnapShot_25day directory containing SnapshotN.csv files
--output-dir path . where information.csv and partitionN.gexf are written

Run java -cp ... main.Main --help for the full option list.

Each run writes information.csv (per-snapshot modularity, partition size, and timing) and a partitionN.gexf file per snapshot (a Gephi-format graph with community assignments, viewable in Gephi) to --output-dir.

Build recommendations

  • Since there's no bundled "fat jar," running outside Maven always needs the classpath built via mvn dependency:build-classpath first (shown above). If you'll run this often outside an IDE, consider adding the maven-shade-plugin or maven-assembly-plugin to produce a single executable jar.
  • The project targets Java 25 specifically (maven.compiler.release in pom.xml). If java -cp ... fails with UnsupportedClassVersionError, you're invoking an older JDK — point at a JDK 25 java binary explicitly (e.g. via JAVA_HOME or an absolute path).
  • mvn verify (not just mvn test) is the one to run before trusting a change to the core algorithm — the integration test (GoldenMasterIT) is the regression check that pins the algorithm's actual numeric output.

Project layout

  • dataset — raw Enron email preprocessing into dated snapshots (not on the default run path; see CLAUDE.md)
  • utils — snapshot loading, run metrics, shared enums
  • louvain — the core algorithm: Gephi-backed Louvain clustering, the dynamic snapshot-reduction logic, and the Degree/PageRank destroyed-node strategies
  • main — the CLI entry point

Citing

@ARTICLE{8982190,  author={Seifikar, Mahsa and Farzi, Saeed and Barati, Masoud},  journal={IEEE Transactions on Computational Social Systems},   title={C-Blondel: An Efficient Louvain-Based Dynamic Community Detection Algorithm},   year={2020},  volume={7},  number={2},  pages={308-318},  doi={10.1109/TCSS.2020.2964197}}

About

C-blondel: an efficient louvain-based dynamic community detection algorithm

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages