Paris is a hierarchical graph clustering algorithm described in the paper:
Hierarchical Graph Clustering using Node Pair Sampling
by Thomas Bonald, Bertrand Charpentier, Alexis Galland and Alexandre Hollocou
This Python module depends on the networkx
package,
which can be installed using pip
.
sudo pip install networkx
Hierarchical clustering of a simple graph
import networkx as nx
from paris import paris
Generate a simple network:
G = nx.erdos_renyi_graph(n = 50, p = 0.2)
Compute the hierarchical clustering (as a dendrogram):
D = paris(G)
Visualize the dendrogram:
from utils import plot_dendrogram
plot_dendrogram(D)
Tests on both synthetic and real data are available as a Jupyter notebook:
hierarchical_clustering.ipynb
Released under the 3-clause BSD license.