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
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.
- JDK 25 or later
- Maven 3.9+
mvn compile
mvn test # unit tests
mvn verify # unit tests + the integration test suite (golden-master regression test for the core algorithm)
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.
- Since there's no bundled "fat jar," running outside Maven always needs the classpath built via
mvn dependency:build-classpathfirst (shown above). If you'll run this often outside an IDE, consider adding themaven-shade-pluginormaven-assembly-pluginto produce a single executable jar. - The project targets Java 25 specifically (
maven.compiler.releaseinpom.xml). Ifjava -cp ...fails withUnsupportedClassVersionError, you're invoking an older JDK — point at a JDK 25javabinary explicitly (e.g. viaJAVA_HOMEor an absolute path). mvn verify(not justmvn 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.
dataset— raw Enron email preprocessing into dated snapshots (not on the default run path; seeCLAUDE.md)utils— snapshot loading, run metrics, shared enumslouvain— the core algorithm: Gephi-backed Louvain clustering, the dynamic snapshot-reduction logic, and the Degree/PageRank destroyed-node strategiesmain— the CLI entry point
@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}}