<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>Graph Encoder Ensemble for Simultaneous Vertex Embedding and Community Detection</title></titleStmt>
			<publicationStmt>
				<publisher>ACM</publisher>
				<date>09/15/2023</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10549036</idno>
					<idno type="doi">10.1145/3625403.3625407</idno>
					
					<author>Cencheng Shen</author><author>Youngser Park</author><author>Carey E Priebe</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[In this paper, we introduce a novel and computationally efficient method for vertex embedding, community detection, and community size determination. Our approach leverages a normalized onehot graph encoder and a rank-based cluster size measure. Through extensive simulations, we demonstrate the excellent numerical performance of our proposed graph encoder ensemble algorithm.
CCS CONCEPTS• Computing methodologies → Ensemble methods; Cluster analysis; • Mathematics of computing → Graph algorithms; Nonparametric statistics.]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1">INTRODUCTION</head><p>Graph data represents pairwise relationships between vertices through a collection of vertices and edges. Typically, a graph (or network) is represented by an adjacency matrix A of size &#119899; &#215; &#119899;, where A(&#119894;, &#119895;) denotes the edge weight between the &#119894;th and &#119895;th vertices. Alternatively, the graph can be stored in an edgelist E of size &#119904; &#215; 3, with the first two columns indicating the vertex indices of each edge and the last column representing the edge weight.</p><p>Community detection, also known as vertex clustering or graph partitioning, is a fundamental problem in graph analysis <ref type="bibr">[6,</ref><ref type="bibr">8,</ref><ref type="bibr">10,</ref><ref type="bibr">13]</ref>. The primary objective is to identify natural groups of vertices where intra-group connections are stronger than inter-group connections. Over the years, various approaches have been proposed, including modularity-based methods <ref type="bibr">[2,</ref><ref type="bibr">22]</ref>, spectral-based methods <ref type="bibr">[15,</ref><ref type="bibr">21]</ref>, and likelihood-based techniques <ref type="bibr">[1,</ref><ref type="bibr">7]</ref>, among others.</p><p>Spectral-based and likelihood-based methods are extensively studied in the statistics community, but they tend to be computationally slow for large graphs. On the other hand, modularity-based methods are faster and widely used in practice, but they lack theoretical investigations and only provide community labels without vertex embedding. Moreover, determining the appropriate community size poses a challenge for any method and is often addressed in an ad-hoc manner or assumed to be known. Therefore, a desirable approach is to develop a method that can achieve community detection, vertex representation, and community size determination under a unified framework.</p><p>In this paper, we propose a graph encoder ensemble algorithm that simultaneously fulfills all these objectives. Our algorithm leverages a normalized one-hot graph encoder <ref type="bibr">[19]</ref>, ensemble learning <ref type="bibr">[3,</ref><ref type="bibr">12]</ref>, k-means clustering <ref type="bibr">[5,</ref><ref type="bibr">11]</ref>, and a novel rank-based cluster size measure called the minimal rank index. The proposed algorithm exhibits linear running time and demonstrates excellent numerical performance. The code for the algorithm is available on GitHub<ref type="foot">foot_0</ref> .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2">METHODS</head><p>We begin by introducing the one-hot graph encoder embedding from <ref type="bibr">[19]</ref>, known for its computational efficiency and theoretical guarantees under random graph models. This embedding forms the foundation of our proposed ensemble method, outlined in Algorithm 1. The ensemble algorithm incorporates crucial enhancements, including &#119871;2 normalization, the minimal rank index, and ensemble embedding, which are elaborated in the subsequent subsections.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.1">Prerequisite</head><p>Given the graph adjacency matrix A &#8712; R &#119899;&#215;&#119899; and a label vector Y &#8712; 1, . . . , &#119870; &#119899; , we define &#119899; &#119896; as the number of observations per class, where</p><p>for &#119896; = 1, . . . , &#119870;. We construct the one-hot encoding matrix W &#8712; R &#119899;&#215;&#119870; on Y, then normalize it by the number of observations perclass. Specifically, for each vertex &#119894; = 1, . . . , &#119899;, we set</p><p>if and only if Y &#119894; = &#119896;, and 0 otherwise. The graph encoder embedding is then obtained by performing a simple matrix multiplication:</p><p>Each row Z(&#119894;, :) represents a &#119870;-dimensional Euclidean representation of vertex &#119894;. The computational advantage of the graph encoder embedding lies in the matrix multiplications, which can be efficiently implemented by iterating over the edge list E only once, without the need for the adjacency matrix <ref type="bibr">[19]</ref>. In Algorithm 1, we denote the above steps as Z = one-hot-emb(E, Y).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.2">Main Algorithm</head><p>The proposed ensemble method is described in detail in Algorithm 1. It can be applied to binary or weighted graphs, as well as directed or undirected graphs. Throughout this paper, we set the number of random replicates &#119903; = 10, the maximum number of iterations &#119898; = 20, and the clustering range is determined based on the specific experiment.</p><p>In the pseudo-code, the &#119871;2 normalization step is represented by Z = normalize(Z), which normalizes each vertex representation to have unit norm (see Section 2.3 for more details). Additionally, given an embedding Z and a label vector Y, the minimal rank index is denoted as MRI(Z, Y) &#8712; [0, 1], which measures the quality of clustering with a lower value indicating better clustering (details in Section 2.4). The k-means clustering step is denoted as k-means(Z, &#119870;), and the adjusted Rand index is denoted as ARI(Y, Y 2 ), which measures the similarity between two label vectors of the same size. The ARI is a popular matching metric that ranges from -&#8734; to 1, with a larger positive value indicating better match quality and a value of 1 representing a perfect match <ref type="bibr">[14]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Algorithm 1 Graph Encoder Ensemble</head><p>Require: An edgelist E, a range of potential cluster size &#119877;, number of random replicates &#119903; , and number of maximum iteration &#119898;. Ensure: The graph embedding Z &#8712; R &#119899;&#215; K for all vertices, the estimated number of clusters K, the cluster indices</p><p>and the minimal rank index &#119894;&#119899;&#119889; &#8712; [0, 1]. function Graph-Encoder-Ensemble(E, &#119877;, &#119903;, &#119898;) &#119894;&#119899;&#119889; = 1; &#8882; initialize the index to pick best cluster size for &#119896; &#8712; &#119877; do &#119894;&#119899;&#119889; 2 = 1; &#8882; initialize the index to pick best random replicate for &#119894; = 1, . . . , &#119903; do &#374;&#119896; = &#119903;&#119886;&#119899;&#119889; (&#119896;, &#119899;); &#8882; randomly initialize a label vector of length &#119899; in [&#119896;]</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.3">Why Normalization</head><p>The normalization step in Algorithm 1 scales each vertex embedding to unit norm. Specifically, for each vertex &#119894;,</p><p>if &#8741;Z(&#119894;, :)&#8741;2 &gt; 0. The normalization step plays a crucial role in achieving improved clustering results, as demonstrated in Figure <ref type="figure">1</ref> using a sparse random graph model with two communities. The normalized embedding is represented on a unit sphere, effectively capturing the connectivity information while mitigating the influence of vertex degrees. In contrast, the un-normalized embedding is significantly affected by the original vertex degrees, resulting in vertices from the same community being widely dispersed. This distinction bears resemblance to the two-truth phenomenon observed in graph adjacency and graph Laplacian, where the Laplacian spectral embedding (LSE) can be seen as a degree-normalized version of the adjacency spectral embedding (ASE). The LSE typically performs better on sparse graphs. Further numerical evaluations on the normalization effect can be found in Section 3.2 and Table <ref type="table">1</ref>. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.4">The Minimal Rank Index</head><p>We introduce a new rank-based measure called the minimal rank index (MRI) to assess the quality of clustering. This measure plays a crucial role in Algorithm 1 as it enables the comparison of multiple embeddings generated from different initializations and community sizes.</p><p>Given the cluster index Y&#119894; of vertex &#119894;, the Euclidean distance function &#119889; (&#8226;, &#8226;), and the mean of the &#119896;th cluster denoted as</p><p>the minimal rank index is computed as:</p><p>The MRI measures how often the vertex embedding is not closest to its corresponding cluster mean. A smaller MRI value indicates better clustering quality, with MRI equal to 0 indicating that every vertex is closest to its cluster mean. In the context of k-means clustering, MRI is non-zero when the k-means algorithm fails to converge.</p><p>In comparison to common cluster size measures such as Silhouette Score, Davies-Bouldin index, Variance Ratio Criterion, and Gap criterion <ref type="bibr">[4,</ref><ref type="bibr">16]</ref>, MRI is rank-based rather than based on actual distances. These other measures compute ratios of within-cluster distances to between-cluster distances. If any of these measures were used in Algorithm 1 instead of MRI, the choice of cluster size would be biased towards the smallest possible value. This is due to the incremental nature of graph encoder embedding in Algorithm 1, where the embedding dimension is equal to the community size &#119896;. Consequently, within-cluster distances become smaller for smaller values of &#119896;, resulting in a bias towards the smallest &#119896; when using actual distance.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.5">Ensemble Embedding and Cluster Size Determination</head><p>Ensemble learning is utilized in Algorithm 1 to improve learning performance and reduce variance by employing multiple models.</p><p>The approach can be summarized as follows: for each value of &#119896; in the cluster range, we generate a set of vertex embeddings and community labels using random label initialization. The model with the smallest MRI is selected as the best model. In cases where multiple models have the same smallest MRI, the average embedding is used.</p><p>Additionally, among all possible choices of cluster size &#119896;, the best embedding with the smallest MRI is selected. If there are multiple embeddings with the same smallest MRI, the one with the largest &#119896; is chosen. For instance, if the MRI values are 0, 0, 0, 0.1, 0.2 for &#119870; = 2, 3, 4, 5, 6, the graph encoder ensemble would select K = 4.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.6">Computational Complexity Analysis</head><p>Algorithm 1 comprises several steps, including one-hot graph encoder embedding, k-means clustering, MRI computation, and ensembles. Let &#119899; be the number of vertices and &#119904; be the number of edges. At any fixed &#119896;, the one-hot graph encoder embedding takes &#119874; (&#119899;&#119896; + &#119904;), k-means takes &#119874; (&#119899;&#119896;), and the MRI computation takes &#119874; (&#119899;&#119896;). Therefore, the overall time complexity of Algorithm 1 is &#119874; (&#119903;&#119898;(&#119899; max(&#119877;) + &#119904;), which is linear with respect to the number of vertices and edges. The storage requirement is also &#119874; (&#119899; max(&#119877;) +&#119904;). In practical terms, the graph encoder ensemble algorithm exhibits remarkable efficiency and scalability. Testing on simulated graphs with default parameters and max(&#119877;) = 10, it takes less than 3 minutes to process 1 million edges and less than 20 minutes for 10 million edges.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3">RESULTS</head><p>In this section, we conduct extensive numerical experiments to demonstrate the advantages of the graph encoder ensemble, as well as the individual benefits of normalization, ensemble, and MRI. We compare these approaches against benchmarks including the algorithm without normalization, without ensemble, with MRI replaced, and using adjacency/Laplacian spectral embedding. The performance is evaluated using the adjusted Rand index (ARI), which measures the degree of agreement between the estimated communities and the ground-truth labels.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.1">Simulation Set-up</head><p>The stochastic block model (SBM) is a widely used random graph model for studying community structure <ref type="bibr">[9,</ref><ref type="bibr">20]</ref>. Each vertex &#119894; is associated with a class label &#119884; &#119894; &#8712; {1, . . . , &#119870; }. The class label may be fixed a-priori, or generated by a categorical distribution with prior probability {&#120587; &#119896; &#8712; (0, 1) with &#119870; &#119896;=1 &#120587; &#119896; = 1}. Then a block probability matrix B = [B(&#119896;, &#119897;)] &#8712; [0, 1] &#119870; &#215;&#119870; specifies the edge probability between a vertex from class &#119896; and a vertex from class &#119897;. For any &#119894; &lt; &#119895;,</p><p>The degree-corrected stochastic block model (DC-SBM) <ref type="bibr">[23]</ref> is a generalization of SBM to better model the sparsity of real graphs. Everything else being the same as SBM, each vertex &#119894; has an additional degree parameter &#120579; &#119894; , and the adjacency matrix is generated by</p><p>In our simulations, we consider three DC-SBM models with increasing community sizes. In all models, the degrees are generated randomly by &#120579; &#119894; &#119894;.&#119894;.&#119889;.</p><p>&#8764; &#119861;&#119890;&#119905;&#119886; <ref type="bibr">(1,</ref><ref type="bibr">4)</ref>. Simulation 1: &#119899; = 3000, &#119870; = 2, &#119884; &#119894; = {1, 2} equally likely, and the block probability matrix is</p><p>Simulation 2: &#119899; = 3000, &#119870; = 4, &#119884; &#119894; = {1, 2, 3, 4} with prior probability [0.2, 0.2, 0.3, 0.3], and the block probability matrix is</p><p>Simulation 3: &#119899; = 3000, &#119870; = 5, &#119884; &#119894; with equally likely prior probability, and the block probability matrix satisfies B(&#119894;, &#119894;) = 0.2 and B(&#119894;, &#119895;) = 0.1 for all &#119894; = 1, . . . , 5 and &#119895; &#8800; &#119894;.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.2">Normalization Comparison</head><p>Table <ref type="table">1</ref> provides clear evidence of the superior clustering performance achieved by the normalized algorithm compared to the unnormalized algorithm. To isolate the impact of normalization, we set &#119903; = 1 and assume the cluster size is known. The observed improvement aligns with the phenomenon observed between adjacency spectral embedding (ASE) and Laplacian spectral embedding </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.3">Ensemble Comparison</head><p>In this simulation, we assume a known cluster size and conduct 100 Monte Carlo replicates to compare the performance of the ensemble algorithm (&#119903; = 10) with the no-ensemble version (&#119903; = 1). The results in Table <ref type="table">2</ref> clearly demonstrate the superiority of the ensemble algorithm: it achieves higher mean ARI and significantly reduces the variance compared to the no-ensemble version. Based on our empirical observations, the default choice of &#119903; = 10 yields satisfactory results across our experiments. Additionally, if the graph size is sufficiently large and the community structure is wellseparated, using a smaller value of &#119903; or even &#119903; = 1 is sufficient. This is evident in simulation 1 of Table <ref type="table">2</ref> </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.4">Cluster Size Estimation</head><p>In this analysis, we explore the performance of the algorithm in estimating the community size. Instead of using the ground-truth size, we consider a range of potential sizes from &#119877; = 2 to &#119877; = 10, and the results are presented in Figure <ref type="figure">2</ref>. These findings provide insights into the performance of the algorithm in accurately estimating the community size and highlight the importance of the MRI measure in achieving accurate size determination. In the right panel, the average Silhouette Score is computed as an alternative size measure, which is biased towards smaller community sizes and chooses K&#119878;&#119878; = 2, resulting in a different estimation compared to the ground-truth size.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4">CONCLUSION</head><p>This paper introduces the graph encoder ensemble, which achieves graph embedding, community detection, and community size determination in a unified framework. Its main advantages include ease of implementation, computational efficiency, and excellent performance in community detection and community size selection. Several potential future directions include exploring mathematical proofs for asymptotic clustering optimality, investigating theoretical properties of MRI, and extending the method to dynamic and multi-modal graphs <ref type="bibr">[17,</ref><ref type="bibr">18]</ref>.</p></div><note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="1" xml:id="foot_0"><p>https://github.com/cshen6/GraphEmd</p></note>
		</body>
		</text>
</TEI>
