Created: 2012-03-20 23:14
Updated: 2014-02-11 17:13


This is the implementation of the algorithm ClusterPBD published in Physical Review E

Reference: Pujol, J.M., BĂ©jar, J. and Delgado, J. "Clustering Algorithm for Determining Community Structure in Large Networks". Physical Review E 74 (2007):016107 Paper

#Build from source

The source code is self-contained, no external dependencies. You can build the binary using gcc:

gcc -O2 -Wall -lm -o clusterPBD clusterPBD.c

This will create the executable clusterPBD


In data/ you can find several networks

  • : the typical Karate Club (very small, 34 nodes)
  • : scientist that collaborated with Erdos (small, 6927 nodes)
  • : social network from physicists (medium, 27519 nodes)

ClusterPBD can analyze networks of 500K nodes less than one hour and medium networks like condmat in few seconds.


Several examples (fromt the networks in data/)

./clusterPBD data/ 0 2 0
./clusterPBD data/ 1 2 0
./clusterPBD data/ 0 2 0


You can get them from the binary if you execute it without parameters.

./clusterPBD filename type distance msave

  filename (network in pajek format)
  type {0,1} (pajek format: 0, pajek compact format: 1)
  distance (for the initial seed)
  msave {0,1} (don't save intermediate results: 0, save them: 1)


The executable will generate 4 output files (in the same directory thant the binary, it's hardcoded :/)


Partition with the modularity value, the last partition is the one you probably one, after the last "----", each line is the class of the node i-th, finally, the modularity before, modularity after and finally the number of classes in the partition.


The dendrogram (usable in matlab).


Modularity by iteration of the PBD algorithm.


The joins of the agglomerative algorithm (after the initial seed)

Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more