D ISSECTING GRAPH MEASURES PERFORMANCE FOR NODE CLUSTERING IN LFR PARAMETER SPACE
Anonymous authors
Paper under double-blind review
A BSTRACT
Graph measures can be used for graph node clustering using metric clustering algorithms.
There are multiple measures applicable to this task, and which one performs better is an open question.
We study the performance of 25 graph measures on generated graphs with different parameters.
While usually measure comparisons are limited to general measure ranking on a particular dataset, we aim to explore the performance of various measures depending on graph features.
Using an LFR graph generator, we create a dataset of ∼ 7500 graphs covering the whole LFR parameter space.
For each graph, we assess the quality of clustering with k -means algorithm for every considered measure.
We determine the best measure for every area of the parameter space.
We ﬁnd that the parameter space consists of distinct zones where one particular measure is the best.
We analyze the geometry of the resulting zones and describe it with simple criteria.
Given particular graph parameters, this allows us to choose the best measure to use for clustering.
I NTRODUCTION
Graph node clustering is one of the central tasks in graph structure analysis.
It provides a partition of nodes into disjoint clusters, which are groups of nodes that are characterized by strong mutual connections.
It can be of practical use for graphs representing real-life systems, such as social networks or industrial processes.
Clustering allows to infer some information about the system: the nodes from one cluster are highly similar, while the nodes from different clusters are dissimilar.
The technique can be applied without any labeled data to extract important insights about a network.
There are different approaches to clustering, including ones based on modularity optimization (Newman & Girvan, 2004; Blondel et al., 2008), label propagation algorithm (Raghavan et al., 2007; Barber & Clark, 2009), Markov cluster process (Van Dongen, 2000; Enright et al., 2002), and spectral clustering (Von Luxburg, 2007).
In this work, we use a different approach based on deﬁning a similarity measure on a graph, which allows one to use any metric clustering algorithm (e.g. Yen et al., 2009).
The choice of the measure signiﬁcantly affects the quality of clustering.
Classical measures are the
Shortest Path (Buckley & Harary, 1990) and the Commute Time (G¨obel & Jagers, 1974) distances.
The former is the minimum number of edges in a path between a given pair of nodes.
The latter is the expected number of steps from one node to the other and back in a random walks on the graph.
There is a number of other measures, including recent ones (e.g. Estrada & Silver, 2017; Jacobsen & Tien, 2018), many of them are parametric.
Despite that graph measures are compatible with any metric algorithm, in this paper we restrict ourselves to the kernel k -means algorithm
(e.g. Fouss et al., 2016).
We base our research on a generated set of graphs.
There are various algorithms to generate graphs with community structures.
The well-known ones are the Stochastic Block Model (Holland et al., 1983) and Lancichinetti–Fortunato–
Radicchi benchmark (Lancichinetti et al., 2008) (hereafter, LFR).
The ﬁrst one is an extension of the Erd˝os–R´enyi model with different intra- and intercluster probablilities of edge creation.
The second one takes into account power law distribution of node degrees and community sizes.
There are other generation models, e.g., Naive Scale-free Clustering (Pasta & Zaidi, 2017).
We choose the LFR model: although it misses key properties of real graphs, like diameter or the clustering coefﬁcient, this model has been proven to be effective in meta-learning (Prokhorenkova, 2019).
There are a lot of measure benchmarking studies considering node classiﬁcation and clustering for both generated graphs and datasets (Fouss et al., 2012; Sommer et al., 2016; 2017; Avrachenkov et al., 2017; Ivashkin & Chebotarev, 2016; Guex et al., 2018; 2019; Aynulin, 2019a;b; Courtain et al., 2020; Leleux et al., 2020), etc.
Although a large number of experimental results, theoretical results still look unattainable.
One of the most important theoretical results for graph measures is a work Luxburg et al.
(2010), where problems of Commute Time on big graphs were shown theoretically, and a substantiated amendment was proposed to correct the problem.
The paper shows how difﬁcult such proves.
Besides difﬁcult proves, there is still no complex empirical understanding of what effects need to be proven. Our empirical work has two main advantages from previous ones. Firstly, we consider the vast amount of graph measures, which for the ﬁrst time gives the full picture. Secondly, unlike these studies concluding with a global leaderboard, we are looking for the leading measures for each set of LFR parameters.
We aim to explore the performance of 25 selected measures in graph clustering problem on a set of generated graphs with different parameters.
We assess the quality of clustering with every considered measure and determine the best measure for every region of the graph parameter space.
Our contributions are summarized as follows:
• We generate a dataset of ∼ 7500 graphs covering all parameter space of LFR generator; • We consider a broad set of measures and rank measures by clustering performance on this dataset; • We ﬁnd regions of certain measure leadership in the graph parameter space; • We determine the graph features that are responsible for measure leadership; • We check applicability of the results on real-world graphs.
Our framework for clustering with graph measures as well as a collected dataset are available on link_is_not_available_during_blind_review .
D EFINITIONS 2. K ERNEL k - MEANS
The original k -means algorithm (Lloyd, 1982; MacQueen et al., 1967) clusters objects in Euclidean space.
It requires coordinates of the objects to determine the distances between them and centroids.
The algorithm can be generalized to use the degree of closeness between the objects without deﬁning a particular space.
This technique is called the kernel trick , usually it is used to bring non-linearity to linear algorithms.
The algorithm that uses the kernel trick is called kernel k -means (see, e.g.,
Fouss et al., 2016).
For graph node clustering scenario, we can use graph measures as kernels for the kernel k -means.
Initially, the number of clusters is known and we need to set initial state of centroids.
The results of the clustering with k -means are very sensitive to it.
Usually, the algorithm runs several times with different initial states (trials) and chooses the best trial.
There are different approaches to the initialization, we consider three of them: random data points, k -means++ (Arthur & Vassilvitskii, 2006) and random partition.
We combine all these strategies to reduce the impact of the initialization strategy on the result.
2. S IMILARITY MEASURES
For a given graph G , V ( G ) is the set of its vertices and A is its adjacency matrix.
A measure on G is a function κ : V ( G ) × V ( G ) → R , which gets two nodes and returns similarity (bigger means closer) or dissimilarity (bigger means farther).
Distances are dissimilarity measures.
A kernel on a graph is a graph nodes similarity measure that has an inner product representation.
Any symmetric positive semideﬁnite matrix is an inner product matrix (also called Gram matrix).
A kernel matrix K is a square matrix that contains similarities for all pairs of nodes in a graph.
To use kernel k -means, we need kernels.
Despite that not all similarity measures we consider are
Gram matrices, we treat them as kernels.
Possibility of the approach was mentioned in Fouss et al.
For the list of measures bellow, we use the word “kernel” only for the measures that satisfy the kernel deﬁnition.
Classical measures are Shortest Path distance (Buckley & Harary, 1990) (SP) and Commute Time distance (G¨obel & Jagers, 1974) (CT).
SP is the minimum number of edges in a path between a given pair of nodes.
CT is the expected lengths of random walks between two nodes.
SP and CT are deﬁned as distances, so we need to transform them into similarities to use as kernels.
We use the following distance to similarity measure transformation (Chebotarev & Shamis, 1998a; Borg &
Groenen, 2005):
[Equation]
where D is a distance matrix, E is the matrix of ones, I is the identity matrix, and n is the number of nodes.
In this paper, we examine 25 graph measures.
We present these measures grouped by type similarly to (Avrachenkov et al., 2017):
• Adjacency Matrix A based kernels and measures.
– Katz kernel : K Katz α
=
( I − αA ) − 1 , 0 < α < ρ − 1 , where ρ is the spectral radius of A .
(Katz, 1953) (also known as Walk proximity (Chebotarev & Shamis, 1998b) or von Neumann diffusion kernel
(Kandola et al., 2003; Shawe-Taylor et al., 2004))
– Communicability kernel K Comm t = expm( tA ) , t > 0 .
expm means matrix exponential.
(Fouss et al., 2006; Estrada & Hatano, 2007; 2008) – Double Factorial similarity : K DF t = (cid:80) inf k =
t k k !!
A k , t > 0 (Estrada & Silver, 2017).
• Laplacian Matrix L = D − A based kernels and measures.
D =
Diag( A · 1 ) is the degree matrix of G , Diag( x ) is the diagonal matrix with vector x on the main diagonal.
– Forest kernel : K For t
= ( I + tL ) − 1 , t > 0 (also known as Regularized Laplacian kernel)
(Chebotarev & Shamis, 1995).
– Heat kernel : K Heat t = expm( − tL ) , t > 0 (Chung & Yau, 1998). – Normalized Heat kernel : K NHeat t = expm( − t L ) , [Equation]
= D − [Equation] LD − 12 , t > 0 (Chung & Graham, 1997).
– Absorption kernel : K Abs t =
( tA + L ) − 1 , t > 0 (Jacobsen & Tien, 2018).
• Markov Matrix P
=
D − 1 A based Kernels and Measures.
– Personalized PageRank similarity measure : K PPR α
=
( I − αP ) − 1 , 0 < α <
(Page et al., 1999).
– Modiﬁed Personalized PageRank : K MPPR α
[Equation]
0 < α < 1 (Kirkland & Neumann, 2012).
– PageRank heat similarity measure : K HPR t [Equation] (Chung, 2007).
– Randomized Shortest Path distance .
Using P and the matrix of the SP distances C ﬁrst get Z
(Yen et al., 2008):
[Equation]
Then S =
( Z ( C ◦ W ) Z )
÷
Z ; ¯ C = S − e diag( S ) T , and ﬁnally, D RSP =
( ¯ C + ¯ C T ) / 2 .
Here ◦
and ÷ are element-wise multiplication and division.
Kernel version K RSP ( t ) can be obtained with equation 1.
– Free Energy distance .
Using Z from equation 2: Z h =
Z Diag( Z ) − 1 ; Φ = − 1 /β log Z h ; D FE =
(Φ + Φ T ) / 2 (Kivim¨aki et al., 2014).
Kernel version K FE ( t ) can be obtained with equation 1.
• Sigmoid Commute Time kernels.
– Sigmoid Commute Time
kernel :
[Equation]
where σ is an element-wise sigmoid function σ ( x ) =
1 / (1 + e − x ) (Yen et al., 2007).
[Table]
SCCT
[Table]
kernel
SP
[Table]
CTlinear combination of SP and CT –
Sigmoid Corrected Commute Time kernel .
First of all, we need Corrected Commute
Time kernel (Luxburg et al., 2010):
[Equation]
where H is the centering matrix H
=
I − E/n , (cid:126) d is the vector of diagonal elements of D and vol( G ) is the sum of all elements of A .
Then, apply equation 3 replacing
K CT with K CCT to obtain K SCCT .
Occasionally, element-wise logarithm is applied to the resulting kernel matrix (Chebotarev, 2013;
Ivashkin & Chebotarev, 2016).
We apply it to almost all investigated measures and consider the resulting measures separately from their plain versions (see Table 1).
For some measures, like Forest kernel, this is well-known practice (Chebotarev, 2013), while for others, like Double Factorial similarity, this transformation, to the best of our knowledge, is applied for the ﬁrst time.
The considered measures and their short names are summarized in Table 1.
D ATASET
We collected a paired dataset of graphs and the corresponding results of clustering with each measure mentioned in Table 1.
In this section, we describe the graph generator, the sampling strategy, the calculated graph features, and the pipeline for the measure score calculation.
We use Lancichinetti–Fortunato–Radicchi (LFR) graph generator.
It generates non-weighted graphs with ground truth non-overlapped communities.
The model has mandatory parameters: the number of nodes n ( n > 0 ), the power law exponent for the degree distribution τ 1 ( τ 1 > 1 ), the power law exponent for the community size distribution τ 2 ( τ 2 > 1 ), the fraction of intra-community edges incident to each node µ ( 0 ≤ µ ≤ 1 ), and either minimum degree (min degree) or average degree (avg degree). There are also extra parameters: maximum degree (max degree), minimum community size (min community), maximum community size (max community).
Not all LFR parameters space corresponds real world graphs, usually real graphs correspond to τ 1 ∈ [1 , 4] and µ < 0 .
However, there is also separated interesting case of bisect graphs ( µ > 0 . 5 ). We still consider the entire parameter space to cover all the cases.
For the generation, we consider 10 < n < 1500 .
It is impossible to generate a dataset with a uniform distribution of all LFR parameters, because τ 1 and τ 2 parameters are located on rays.
We choose to transform τ 1 and τ 2 to ˜ τ i = 1 − (1 / √ τ i ) , i = 1 , 2 to bring their scope to [0 , 1] interval.
In this case, realistic setting τ 1 ∈ [1 , 4] has 50% of all variable range.
Also, as avg degree feature is limited by n [Figure] of particular graph, we decided to replace it with density (avg degree / ( n − 1) ).
It is not dependent on n and belongs to [0 , 1] .
Using all these considerations, we collected our dataset by uniformly sampling parameters for LFR generator from the set [ n , ˜ τ 1 , ˜ τ 2 , µ , density] and generating graphs with these parameters.
Additionally, we ﬁlter out non-connected graphs.
In total [Figure] we generate 7396 graphs.
It is worth noting that the generator fails for some sets of parameters, so the resulting dataset is not uniform (see Fig. 1).
In our study, non-uniformity is not a very important issue, because we are interested in local effects, not global leadership.
Moreover, true uniformity for LFR parameter space is impossible [Figure] due to the unlimited scope of parameters.
For our research [Figure] we choose a minimum set of the features that describe particular properties of graphs and are not interchangeable [Figure]
The LFR parameters can be divided in three groups by the graph properties they reﬂect
: • The size of the graph and the communities: n , τ 1 , min community, max community; • The density and uniformity of the node degrees distribution: τ 2 , min degree, avg degree, max degree.
As avg degree depends on n , it is distributed exponentially, so we use log( avg degree ) instead; • The cluster separability: µ .
As µ parameter considers only the ratio between the number of inter-cluster edges and the number of nodes but ignores overall density, we use modularity ( Newman & Girvan ) as a more appropriate measure for cluster separability.
Thus, the deﬁned set of features [ n , τ 1 , τ 2 , avg degree, modularity] is enough to consider all graph properties mentioned above.
Although modularity is widely used measure, it suffers from resolution limit problems (Fortunato & Barthelemy, 2007).
We acknowledge that the use of this measure may negatively affect the quality of our method.
For every generated graph we calculate the top ARI score for every measure (Hubert & Arabie, 1985).
We choose ARI as a clustering score which is both popular and unbiased (G¨osgens et al., [Table]
As soon as every measure has a parameter, we perform clustering for a range of parameter values (we transform the parameter to be deﬁned on [0, 1] interval and then choose 16 values linearly spaced from 0 to 1).
For each value, we run 6+6+6 trials of k -means (6 trials for each of three initialization methods).
Fig.
2 shows the pipeline we use to calculate ARI score for a given LFR parameter set, a measure, and a measure parameter.
Measure parameters are not the subject of our experiments, so for every measure we just take the result of the measure with the value of the parameter that gives the best
ARI score.
Due to the fact that in the task it is necessary to iterate over the graphs, measures, parameter values, initializations—the task is computationally difﬁcult. Overall computation time is 20 days on
CPU cores and 6 GPUs.
R ESULTS 4. G LOBAL LEADERSHIP IN LFR SPACE
We range the measures by their ARI score on every graph of the dataset.
The rank is deﬁned as the position of the measure in this list, averaged over the dataset (see Table 2).
It is important to note that the global leadership does not give a comprehensive advice on which measure is better to use, because for a particular graph, the global leader can perform worse than the others.
Here we consider the entire LFR space, not just its zone corresponding to real graphs, so the ranking may differ from similar works.
As SCCT is the winner for both ranking and percentage of wins, we can say for sure that it is the global winner for all LFR space graphs.
Other measures still can be leaders in some zones of the feature space.
4. F EATURE IMPORTANCE STUDY
First of all, we ﬁnd which graph features are important for the choice of the best measure and which are not.
To do that, we use Linear Discriminant Analysis (Mika et al., 1999)
(LDA).
This method ﬁnds a new basis in feature space to classify dataset in the best way.
It also shows how many components of basis are required to ﬁt the majority of data.
Fig.
3a shows that the ﬁrst two components take about 90% of the explained variance.
Fig.
3b shows that these components include only τ 1 , avg degree, and modularity.
The fact that n is not used means that the size of the graph as well as the density are not important for choosing the best measure.
The fact that τ 2 is not used means that the difference in sizes of clusters is not important, too.
[Figure]
r c e n t E x p l a i n e d V a r i a n c e
[Figure]
[Figure] n
[Figure] [Figure] [Figure] [Figure]
Fig. 4 shows the point cloud projected on the space of the two main components of LDA.
We see a conﬁrmation that the measures are indeed zoned, but the areas are quite noisy.
To detect zones of measure leadership, we need to know the leadership on average in every area of space, rather than the wins in particular points.
To deﬁne the local measure leadership in the whole space, we need to introduce a ﬁltering algorithm that for every point of space returns the measure leadership depending on the closest data points.
As the choice of measure is actually dependent only on three features, we can limit our feature space to [ τ 1 , avg degree, modularity]
[Figure]
4. G AUSSIAN FILTER IN FEATURE SPACE
With a ﬁlter in feature space, we can suppress the noise and ﬁnd actual zones of leadership for the measures.
We use Gaussian ﬁlter with a scale parameter σ .
For every requested point of space, it takes data points that are closer than 3 σ and averages ARIs of the chosen points with a weight e − dist 2 / 2 σ 2 .
This allows to give larger weights to closer points.
If there are less than 3 data points inside the sphere with a 3 σ radius, the ﬁlter returns nothing, allowing to ignore the points with insufﬁcient data.
Before applying the ﬁlter, we prepare the dataset.
First, we only take the points with only one winning measure, because multiple winners can confuse the ﬁlter.
Then we normalize the standard deviation of every feature distribution to one.
Finally, we cut off long tail of distant data points The resulting number of graphs is 5201.
To choose σ , we apply the ﬁlter with different sigma and look at the number of connected components in the feature space.
Sigma should be large enough to suppress the noise, however, it should not suppress small zones.
Guided by this heuristic, we choose σ = 0 .
[Table]
After the ﬁltering with σ = 0 . 5 , the leaderboard of measure wins is changed (see Table 3).
Onlymeasures keep their positions: SCCT, NHeat, logComm, Comm, logDF, and RSP.
This means that these measures do have zones of leadership, otherwise they would be ﬁltered out.
We can plot the entire feature space colored by the leadership zones of the measures (see Fig. 5).
As the ﬁnal space is 3D, we show slices of it by each of the three coordinates.
[Figure]
[Table] [Figure] [Table] [Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
[Table]
[Figure]
in the space.
D ATASETS
Even though LFR lacks some characteristics of real-world graphs, there is evidence that the optimal parameter of the Louvain clustering for a real graph is close to the parameter for LFR graphs gen- erated from the parameters of a real one (Prokhorenkova, 2019).
So, there is a chance that learned space might be helpful for choosing measures in the wild.
For evaluation, we use 29 graphs of standard datasets: Dolphins (Lusseau et al., 2003), Football (Newman & Girvan, 2004), Karate club (Zachary, 1977), Newsgroup (9 subsets, weights are binarized with threshold 0.1)
(Yen et al., 2007), Political blogs (Adamic & Glance, 2005), Political books (Newman, 2006), SocioPatterns Primary school day (2 graphs) (Stehl´e et al., 2011), Cora ( subsets) (McCallum et al., 2000), Eu-core (Leskovec et al., 2007), EuroSIS (WebAtlas, 2009). Parameters of graphs are marked on Fig. For each graph, we found the best ARI for every measure (iterating over the measure parameter value). Now we can check the quality of measure choice, based on calculated LFR data.
Result of recommendation is the measure which will be chosen for particular set of parameters.
[Table]
The best measures on datasets are SCCT (by mean ARI) and SCT (by rank).
It is close to the results obtained for LFR.
Moreover, the correlation between ranks of measures for datasets and for corresponding LFR recommendations is 0.90.
Let us use “always use SCCT” as our baseline strategy.
In Table 4 we compare it with strategies based on LFR space.
We obtain LFR recommendation using knn as a well-proven method for metalearning.
Since each graph is unique, the result of 1nn can be very noisy, so that we will use 5nn.
Table 4 shows that recommendation approach slightly beat the baseline.
However, it is not enough to draw conﬁdent conclusions about the applicability of the method.
Using this fact and the fact that the ranks of datasets and recommendations are highly correlated, we conclude that building a meta-learning procedure is adequate to give a robust recommendation, but not precise enough to beat baseline conﬁdently.
It could be connected with the fact that node labels of real graphs do not obey a certain system since they were created in the wild.
A larger dataset could help separate the signal from the noise and pinpoint where the limits of the method are.
At least, the good news is that the conclusions made on the LFR do not contradict the results that can be obtained on the datasets.
C ONCLUSIONS
In this work, we show that the global leadership of measures doesn’t give comprehension knowledge about graph measures.
We demonstrate that among 25 measures, SCCT is the best measure for LFR graphs both by winning rate and ranking.
But there are also smaller conﬁdent zones of leadership for NHeat, Comm, logComm, logDF, and RSP.
Our work do not contradict with other experimental papers, but expands them and gives new ﬁndings.
LogComm was ﬁrst introduced in Ivashkin & Chebotarev (2016) and won in the competitions on graphs generated with a ﬁxed set of Stochastic Block Model parameters.
This study conﬁrms its leadership, but only for a certain type of graphs.
Another interesting ﬁnding is logDF, which unexpectedly shows good performance for the graphs with low modularity and low average degree.
This study is based on LFR benchmark data.
An attempt to apply the results to real data gives quality at the baseline level.
However, there is a strong correlation between the ranking of measures for datasets and the ranking of LFR recommendation, which indicates that that the leadership measures are the same, but the recommendations are not accurate.
We note that our study insensitive to non-uniformity of the dataset.
While the manipulations with dataset can change the global leaderboard, they do not affect the local leadership investigated in our study.