Graph Embedding Techniques, Applications, and Performance: A Survey

Palash Goyal, Emilio Ferrara

Introduction

Graph analysis has been attracting increasing attention in the recent years due the ubiquity of networks in the real world. Graphs (a.k.a. networks) have been used to denote information in various areas including biology (Protein-Protein interaction networks), social sciences (friendship networks) and linguistics (word co-occurrence networks). Modeling the interactions between entities as graphs has enabled researchers to understand the various network systems in a systematic manner. For example, social networks have been used for applications like friendship or content recommendation, as well as for advertisement . Graph analytic tasks can be broadly abstracted into the following four categories: (a) node classification, (b) link prediction, (c) clustering, and (d) visualization. Node classification aims at determining the label of nodes (a.k.a. vertices) based on other labeled nodes and the topology of the network. Link prediction refers to the task of predicting missing links or links that are likely to occur in the future. Clustering is used to find subsets of similar nodes and group them together; finally, visualization helps in providing insights into the structure of the network.

In the past few decades, many methods have been proposed for the tasks defined above. For node classification, there are broadly two categories of approaches — methods which use random walks to propagate the labels, and methods which extract features from nodes and apply classifiers on them. Approaches for link prediction include similarity based methods, maximum likelihood models, and probabilistic models. Clustering methods include attribute based models and methods which directly maximize (resp., minimize) the inter-cluster (resp., intra-cluster) distances. This survey will provide a taxonomy that captures these application domains and the existing strategies.

Typically, a model defined to solve graph-based problems either operates on the original graph adjacency matrix or on a derived vector space. Recently, the methods based on representing networks in vector space, while preserving their properties, have become widely popular. Obtaining such an embedding is useful in the tasks defined above.The term graph embedding has been used in the literature in two ways: to represent an entire graph in vector space, or to represent each individual node in vector space. In this paper, we use the latter definition since such representations can be used for tasks like node classification, differently from the former representation. The embeddings are input as features to a model and the parameters are learned based on the training data. This obviates the need for complex classification models which are applied directly on the graph.

Obtaining a vector representation of each node of a graph is inherently difficult and poses several challenges which have been driving research in this field:

(i) Choice of property: A “good” vector representation of nodes should preserve the structure of the graph and the connection between individual nodes. The first challenge is choosing the property of the graph which the embedding should preserve. Given the plethora of distance metrics and properties defined for graphs, this choice can be difficult and the performance may depend on the application.

(ii) Scalability: Most real networks are large and contain millions of nodes and edges — embedding methods should be scalable and able to process large graphs. Defining a scalable model can be challenging especially when the model is aimed to preserve global properties of the network.

(iii) Dimensionality of the embedding: Finding the optimal dimensions of the representation can be hard. For example, higher number of dimensions may increase the reconstruction precision but will have high time and space complexity. The choice can also be application-specific depending on the approach: E.g., lower number of dimensions may result in better link prediction accuracy if the chosen model only captures local connections between nodes.

2 Our contribution

This survey provides a three-pronged contribution:

(1) We propose a taxonomy of approaches to graph embedding, and explain their differences. We define four different tasks, i.e., application domains of graph embedding techniques. We illustrate the evolution of the topic, the challenges it faces, and future possible research directions.

(2) We provide a detailed and systematic analysis of various graph embedding models and discuss their performance on the various tasks. For each method, we analyze the properties preserved and its accuracy, through comprehensive comparative evaluation on a few common data sets and application scenarios. Furthermore, we perform hyperparameter sensitivity analysis on the methods evaluated to test their robustness and provide an understanding of the dependence of optimal hyperparameter on the task performed.

(3) To foster further research in this topic, we finally present GEM, the open-source Python library we developed that provides, under a unified interface, implementations of all graph embedding methods discussed in this survey. To the best of our knowledge, this is the first paper to survey graph embedding techniques and their applications.

3 Organization of the survey

The survey is organized as follows. In Section 2, we provide the definitions required to understand the problem and models discussed next. Section 3 proposes a taxonomy of graph embedding approaches and provides a description of representative algorithms in each category. The list of applications for which researchers have used the representation learning approach for graphs is provided in Section 4. We then describe our experimental setup (Section 5) and evaluate the different models (Section 6). Section 7 introduces our Python library for graph embedding methods. Finally, in Section 8 we draw our conclusions and discuss potential applications and future research direction.

Definitions and Preliminaries

We represent the set {1,,n}\{1,\cdots,n\} by [n][n] in the rest of the paper. We start by formally defining several preliminaries which have been defined similar to Wang et al. .

(Graph) A graph G(V,E)G(V,E) is a collection of V={v1,,vn}V=\{v_{1},\cdots,v_{n}\} vertices (a.k.a. nodes) and E={eij}i,j=1nE=\{e_{ij}\}_{i,j=1}^{n} edges. The adjacency matrix SS of graph GG contains non-negative weights associated with each edge: sij0s_{ij}\geq 0. If viv_{i} and vjv_{j} are not connected to each other, then sij=0s_{ij}=0. For undirected weighted graphs, sij=sjii,j[n]s_{ij}=s_{ji}\hskip 5.0pt\forall i,j\in[n].

The edge weight sijs_{ij} is generally treated as a measure of similarity between the nodes viv_{i} and vjv_{j}. The higher the edge weight, the more similar the two nodes are expected to be.

(First-order proximity) Edge weights sijs_{ij} are also called first-order proximities between nodes viv_{i} and vjv_{j}, since they are the first and foremost measures of similarity between two nodes.

We can similarly define higher-order proximities between nodes. For instance,

(Second-order proximity) The second-order proximity between a pair of nodes describes the proximity of the pair’s neighborhood structure. Let si=[si1,,sin]\boldsymbol{s_{i}}=[s_{i1},\cdots,s_{in}] denote the first-order proximity between viv_{i} and other nodes. Then, second-order proximity between viv_{i} and vjv_{j} is determined by the similarity of si\boldsymbol{s_{i}} and sj\boldsymbol{s_{j}}.

Second-order proximity compares the neighborhood of two nodes and treats them as similar if they have a similar neighborhood. It is possible to define higher-order proximities using other metrics, e.g. Katz Index, Rooted PageRank, Common Neighbors, Adamic Adar, etc. (for detailed definitions, omitted here in the interest of space, see Ou et al. ). Next, we define a graph embedding:

An embedding therefore maps each node to a low-dimensional feature vector and tries to preserve the connection strengths between vertices. For instance, an embedding preserving first-order proximity might be obtained by minimizing i,jsijyiyj22\sum_{i,j}s_{ij}\|\boldsymbol{y_{i}}-\boldsymbol{y_{j}}\|_{2}^{2}. Let two node pairs (vi,vj)(v_{i},v_{j}) and (vi,vk)(v_{i},v_{k}) be associated with connections strengths such that sij>siks_{ij}>s_{ik}. In this case, viv_{i} and vjv_{j} will be mapped to points in the embedding space that will be closer each other than the mapping of viv_{i} and vkv_{k}.

Algorithmic Approaches: A Taxonomy

In the past decade, there has been a lot of research in the field of graph embedding, with a focus on designing new embedding algorithms. More recently, researchers pushed forward scalable embedding algorithms that can be applied on graphs with millions of nodes and edges. In the following, we provide historical context about the research progress in this domain (§3.1), then propose a taxonomy of graph embedding techniques (§3.2) covering (i) factorization methods (§3.3), (ii) random walk techniques (§3.4), (iii) deep learning (§3.5), and (iv) other miscellaneous strategies (§3.6).

In the early 2000s, researchers developed graph embedding algorithms as part of dimensionality reduction techniques. They would construct a similarity graph for a set of nn DD-dimensional points based on neighborhood and then embed the nodes of the graph in a dd-dimensional vector space, where dd \ll DD. The idea for embedding was to keep connected nodes closer to each other in the vector space. Laplacian Eigenmaps and Locally Linear Embedding (LLE) are examples of algorithms based on this rationale. However, scalability is a major issue in this approach, whose time complexity is O(V2)O(|V|^{2}).

Since 2010, research on graph embedding has shifted to obtaining scalable graph embedding techniques which leverage the sparsity of real-world networks. For example, Graph Factorization uses an approximate factorization of the adjacency matrix as the embedding. LINE extends this approach and attempts to preserve both first order and second proximities. HOPE extends LINE to attempt preserve high-order proximity by decomposing the similarity matrix rather than adjacency matrix using a generalized Singular Value Decomposition (SVD). SDNE uses autoencoders to embed graph nodes and capture highly non-linear dependencies. The new scalable approaches have a time complexity of O(E)O(|E|).

2 A Taxonomy of Graph Embedding Methods

We propose a taxonomy of embedding approaches. We categorize the embedding methods into three broad categories: (1) Factorization based, (2) Random Walk based, and (3) Deep Learning based. Below we explain the characteristics of each of these categories and provide a summary of a few representative approaches for each category (cf. Table 1), using the notation presented in Table 2.

3 Factorization based Methods

Factorization based algorithms represent the connections between nodes in the form of a matrix and factorize this matrix to obtain the embedding. The matrices used to represent the connections include node adjacency matrix, Laplacian matrix, node transition probability matrix, and Katz similarity matrix, among others. Approaches to factorize the representative matrix vary based on the matrix properties. If the obtained matrix is positive semidefinite, e.g. the Laplacian matrix, one can use eigenvalue decomposition. For unstructured matrices, one can use gradient descent methods to obtain the embedding in linear time.

LLE assumes that every node is a linear combination of its neighbors in the embedding space. If we assume that the adjacency matrix element WijW_{ij} of graph GG represents the weight of node jj in the representation of node ii, we define

Hence, we can obtain the embedding YN×dY^{N\times d} by minimizing

To remove degenerate solutions, the variance of the embedding is constrained as 1NYTY=I\frac{1}{N}Y^{T}Y=I. To further remove translational invariance, the embedding is centered around zero: iYi=0\sum_{i}Y_{i}=0. The above constrained optimization problem can be reduced to an eigenvalue problem, whose solution is to take the bottom d+1d+1 eigenvectors of the sparse matrix (IW)T(IW)(I-W)^{T}(I-W) and discarding the eigenvector corresponding to the smallest eigenvalue.

3.2 Laplacian Eigenmaps

Laplacian Eigenmaps aims to keep the embedding of two nodes close when the weight WijW_{ij} is high. Specifically, they minimize the following objective function

where LL is the Laplacian of graph GG. The objective function is subjected to the constraint YTDY=IY^{T}DY=I to eliminate trivial solution. The solution to this can be obtained by taking the eigenvectors corresponding to the dd smallest eigenvalues of the normalized Laplacian, Lnorm=D1/2LD1/2L_{norm}=D^{-1/2}LD^{-1/2}.

3.3 Cauchy Graph Embedding

Laplacian Eigenmaps uses a quadratic penalty function on the distance between embeddings. The objective function thus emphasizes preservation of dissimilarity between nodes more than their similarity. This may yield embeddings which do not preserve local topology, which can be defined as the equality between relative order of edge weights (WijW_{ij}) and inverse order of distances in the embedded space (YiYj2|Y_{i}-Y_{j}|^{2}). Cauchy Graph Embedding tackles this problem by replacing the quadratic function YiYj2|Y_{i}-Y_{j}|^{2} with YiYj2YiYj2+σ2\frac{|Y_{i}-Y_{j}|^{2}}{|Y_{i}-Y_{j}|^{2}+\sigma^{2}}. Upon rearrangement, the objective function to be maximized becomes

with constraints YTY=IY^{T}Y=I and iYi=0\sum_{i}Y_{i}=0 for each ii. The new objective is an inverse function of distance and thus puts emphasis on similar nodes rather than dissimilar nodes. The authors propose several variants including Gaussian, Exponential and Linear embeddings with varying relative emphasis on the distance between nodes.

3.4 Structure Preserving Embedding (SPE)

Structure Preserving Embedding () is another approach which extends Laplacian Eigenmaps. SPE aims to reconstruct the input graph exactly. The embedding is stored as a positive semidefinite kernel matrix KK and a connectivity algorithm G\mathcal{G} is defined which reconstructs the graph from KK. The kernel KK is chosen such that it maximizes tr(KW)tr(KW) which attempts to recover rank-1 spectral embedding. Choice of the connectivity algorithm G\mathcal{G} induces constraints on this objective function. For e.g., if the connectivity scheme is to connect each node to neighbors which lie within a ball of radius ϵ\epsilon, the constraint (Kii+Kjj2Kij)(Wij1/2)ϵ(Wij1/2)(K_{ii}+K_{jj}-2K_{ij})(W_{ij}-1/2)\leq\epsilon(W_{ij}-1/2) produces a kernel which can perfectly reconstruct the original graph. To handle noise in the graph, a slack variable is added. For ξ\xi-connectivity, the optimization thus becomes max tr(KA)Cξmax\ tr(KA)-C\xi s.t. (Kii+Kjj2Kij)(Wij1/2)ϵ(Wij1/2)ξ(K_{ii}+K_{jj}-2K_{ij})(W_{ij}-1/2)\leq\epsilon(W_{ij}-1/2)-\xi, where ξ\xi is the slack variable and CC controls slackness.

3.5 Graph Factorization (GF)

To the best of our knowledge, Graph Factorization was the first method to obtain a graph embedding in O(E)O(|E|) time. To obtain the embedding, GF factorizes the adjacency matrix of the graph, minimizing the following loss function

where λ\lambda is a regularization coefficient. Note that the summation is over the observed edges as opposed to all possible edges. This is an approximation in the interest of scalability, and as such it may introduce noise in the solution. Note that as the adjacency matrix is often not positive semidefinite, the minimum of the loss function is greater than 0 even if the dimensionality of embedding is V|V|.

3.6 GraRep

GraRep defines the node transition probability as T=D1WT=D^{-1}W and preserves kk-order proximity by minimizing XkYskYtkTF2\|X^{k}-Y^{k}_{s}Y^{kT}_{t}\|_{F}^{2} where XkX^{k} is derived from TkT^{k} (refer to for a detailed derivation). It then concatenates YskY^{k}_{s} for all kk to form YsY_{s}. Note that this is similar to HOPE which minimizes SYsYtTF2\|S-Y_{s}Y_{t}^{T}\|_{F}^{2} where SS is an appropriate similarity matrix. The drawback of GraRep is scalability, since TkT^{k} can have O(V2)O(|V|^{2}) non-zero entries.

3.7 HOPE

HOPE preserves higher order proximity by minimizing SYsYtTF2\|S-Y_{s}Y_{t}^{T}\|_{F}^{2}, where SS is the similarity matrix. The authors experimented with different similarity measures, including Katz Index, Rooted Page Rank, Common Neighbors, and Adamic-Adar score. They represented each similarity measure as S=Mg1MlS=M_{g}^{-1}M_{l}, where both MgM_{g} and MlM_{l} are sparse. This enables HOPE to use generalized Singular Value Decomposition (SVD) to obtain the embedding efficiently.

3.8 Additional Variants

For the purpose of dimensionality reduction of high dimensional data, there are several other methods developed capable of performing graph embedding. Yan et al. survey a list of such methods including Principal Component Analysis (PCA) , Linear Discrimant Analysis (LDA) , ISOMAP , Multidimesional Scaling (MDS) , Locality Preserving Properties (LPP) and Kernel Eigenmaps . Matrinex et al. ) proposed a general framework, non-negative graph embedding, which yields non-negative embeddings for these algorithms.

A number of recent techniques have focused on jointly learning network structure and additional node attribute information available for the network., Augmented Relation Embedding (ARE) augments network with content based features for images and modifies the graph-Laplacian to capture such information. Text-associated DeepWalk (TADW) performs matrix factorization on node similarity matrix disentangling the representation using text feature matrix. Heterogeneous Network Embedding (HNE) learns representation for each modality of the network and then unifies them into a common space using linear transformations. Other works () perform similar transformations between various node attributes and learn joint embedding.

4 Random Walk based Methods

Random walks have been used to approximate many properties in the graph including node centrality and similarity. They are especially useful when one can either only partially observe the graph, or the graph is too large to measure in its entirety. Embedding techniques using random walks on graphs to obtain node representations have been proposed: DeepWalk and node2vec are two examples.

DeepWalk preserves higher-order proximity between nodes by maximizing the probability of observing the last kk nodes and the next kk nodes in the random walk centered at viv_{i}, i.e. maximizing logPr(vik,,vi1,vi+1,,vi+kYi)\log Pr({v_{i-k},\ldots,v_{i-1},v_{i+1},\ldots,v_{i+k}}|Y_{i}), where 2k+12k+1 is the length of the random walk. The model generates multiple random walks each of length 2k+12k+1 and performs the optimization over sum of log-likelihoods for each random walk. A dot-product based decoder is used to reconstruct the edges from the node embeddings.

4.2 node2vec

Similar to DeepWalk , node2vec preserves higher-order proximity between nodes by maximizing the probability of occurrence of subsequent nodes in fixed length random walks. The crucial difference from DeepWalk is that node2vec employs biased-random walks that provide a trade-off between breadth-first (BFS) and depth-first (DFS) graph searches, and hence produces higher-quality and more informative embeddings than DeepWalk. Choosing the right balance enables node2vec to preserve community structure as well as structural equivalence between nodes.

4.3 Hierarchical Representation Learning for Networks (HARP)

DeepWalk and node2vec initialize the node embeddings randomly for training the models. As their objective function is non-convex, such initializations can be stuck in local optima. HARP introduces a strategy to improve the solution and avoid local optima by better weight initialization. To this purpose, HARP creates hierarchy of nodes by aggregating nodes in the previous layer of hierarchy using graph coarsening. It then generates embedding of the coarsest graph and initializes the node embeddings of the refined graph (one up in the hierarchy) with the learned embedding. It propagates such embeddings through the hierarchy to obtain the embeddings of the original graph. Thus HARP can be used in conjunction with random walk based methods like DeepWalk and node2vec to obtain better solutions to the optimization function.

4.4 Walklets

DeepWalk and node2vec implicitly preserve higher order proximity between nodes by generating multiple random walks which connect nodes at various distances due to its stochastic nature. On the other hand, factorization based approches like GF and HOPE explicitly preserve distances between nodes by modeling it in their objective function. Walklets combine this idea of explicit modeling with random walks. The model modifies the random walk strategy used in DeepWalk by skipping over some nodes in the graph. This is performed for multiple skip lengths, analogous to factorizing AkA^{k} in GraRep, and the resulting set of random walks are used for training the model similar to DeepWalk.

4.5 Additional Variants

There have been several variations of the above methods proposed recently. Similar to augmenting graph structure with node attributes for factorization based methods, GenVector , Discriminative Deep Random Walk (DDRW) , Tri-party Deep Network Representation (TriDNR) and extend random walks to jointly learn network structure and node attributes.

5 Deep Learning based Methods

The growing research on deep learning has led to a deluge of deep neural networks based methods applied to graphs. Deep autoencoders have been used for dimensionality reduction due to their ability to model non-linear structure in the data. Recently, SDNE , DNGR utilized this ability of deep autoencoder to generate an embedding model that can capture non-linearity in graphs.

Wang et al. proposed to use deep autoencoders to preserve the first and second order network proximities. They achieve this by jointly optimizing the two proximities. The approach uses highly non-linear functions to obtain the embedding. The model consists of two parts: unsupervised and supervised. The former consists of an autoencoder aiming at finding an embedding for a node which can reconstruct its neighborhood. The latter is based on Laplacian Eigenmaps which apply a penalty when similar vertices are mapped far from each other in the embedding space.

5.2 Deep Neural Networks for Learning Graph Representations (DNGR)

DNGR combines random surfing with deep autoencoder. The model consists of 3 components: random surfing, positive pointwise mutual information (PPMI) calculation and stacked denoising autoencoders. Random surfing model is used on the input graph to generate a probabilistic co-occurence matrix, analogous to similarity matrix in HOPE. The matrix is transformed to a PPMI matrix and input into a stacked denoising autoencoder to obtain the embedding. Inputting PPMI matrix ensures that the autoencoder model can capture higher order proximity. Furthermore, using stacked denoising autoencoders aids robustness of the model in presence of noise in the graph as well as in capturing underlying structure required for tasks such as link prediction and node classification.

5.3 Graph Convolutional Networks (GCN)

Deep neural network based methods discussed above, namely SDNE and DNGR, take as input the global neighborhood of each node (a row of PPMI for DNGR and adjacency matrix for SDNE). This can be computationally expensive and inoptimal for large sparse graphs. Graph Convolutional Networks (GCNs) tackle this problem by defining a convolution operator on graph. The model iteratively aggregates the embeddings of neighbors for a node and uses a function of the obtained embedding and its embedding at previous iteration to obtain the new embedding. Aggregating embedding of only local neighborhood makes it scalable and multiple iterations allows the learned embedding of a node to characterize global neighborhood.

Several recent papers () have proposed methods using convolution on graphs to obtain semi-supervised embedding, which can be used to obtain unsupervised embedding by defining unique labels for each node. The approaches vary in the construction of convolutional filters which can broadly be categorized into spatial and spectral filters. Spatial filters operate directly on the original graph and adjacency matrix whereas spectral filters operate on the spectrum of graph-Laplacian.

5.4 Variational Graph Auto-Encoders (VGAE)

Kipf et al. evaluate the performance of variational autoencoders on the task of graph embedding. The model uses a graph convolutional network (GCN) encoder and an inner product decoder. The input is adjacency matrix and they rely on GCN to learn the higher order dependencies between nodes. They empirically show that using variational autoencoders can improve performance compared to non-probabilistic autoencoders.

6 Other Methods

LINE explicitly defines two functions, one each for first- and second-order proximities, and minimizes the combination of the two. The function for first-order proximity is similar to that of Graph Factorization (GF) in that they both aim to keep the adjacency matrix and dot product of embeddings close. The difference is that GF does this by directly minimizing the difference of the two. Instead, LINE defines two joint probability distributions for each pair of vertices, one using adjancency matrix and the other using the embedding. Then, LINE minimizes the Kullback-Leibler (KL) divergence of these two distributions. The two distributions and the objective function are as follows

The authors similarly define probability distributions and objective function for the second-order proximity.

7 Discussion

We can interpret embeddings as representations which describe graph data. Thus, embeddings can yield insights into the properties of a network. We illustrate this in Figure 1. Consider a complete bipartite graph GG. An embedding algorithm which attempts to keep two connected nodes close (i.e., preserve the community structure), would fail to capture the structure of the graph — as shown in 1(b). However, an algorithm which embeds structurally-equivalent nodes together learns an interpretable embedding — as shown in 1(c). Similarly, in 1(d) we consider a graph with two star components connected through a hub. Nodes 1 and 3 are structurally equivalent (they link to the same nodes) and are clustered together in 1(f), whereas in 1(e) they are far apart. The classes of algorithms above can be described in terms of their ability to explain the properties of graphs.

Factorization-based methods are not capable of learning an arbitrary function, e.g., to explain network connectivity. Thus, unless explicitly included in their objective function, they cannot learn structural equivalence. In random walk based methods, the mixture of equivalences can be controlled to a certain extent by varying the random walk parameters. Deep learning methods can model a wide range of functions following the universal approximation theorem : given enough parameters, they can learn the mix of community and structural equivalence, to embed the nodes such that the reconstruction error is minimized. We can interpret the weights of the autoencoder as a representation of the structure of the graph. For example, 1(c) plots the embedding learned by SDNE for the complete bipartite graph G1G_{1}. The autoencoder stored the bipartite structure in weights and achieved perfect reconstruction. Given the variety of properties of real-world graphs, using general non-linear models that span a large class of functions is a promising direction that warrants further exploration.

Applications

As graph representations, embeddings can be used in a variety of tasks. These applications can be broadly classified as: network compression (§4.1), visualization (§4.2), clustering (§4.3), link prediction (§4.4), and node classification (§4.5).

Feder et al. introduced the concept of network compression (a.k.a. graph simplification). For a graph GG, they defined a compression GG^{*} which has smaller number of edges. The goal was to store the network more efficiently and run graph analysis algorithms faster. They obtained the compression graph by partitioning the original graph into bipartite cliques and replacing them by trees, thus reducing the number of edges. Over the years, many researchers have used aggregation based methods to compress graphs. The main idea in this line of work is to exploit the link structure of the graph to group nodes and edges. Navlakha et al. used Minimum Description Length (MDL) from information theory to summarize a graph into a graph summary and edge correction.

Similar to these representations, graph embedding can also be interpreted as a summarization of graph. Wang et al. and Ou et al. tested this hypothesis explicitly by reconstructing the original graph from the embedding and evaluating the reconstruction error. They show that a low dimensional representation for each node (in the order of 100s) suffices to reconstruct the graph with high precision.

2 Visualization

Application of visualizing graphs can be dated back to 1736 when Euler used it to solve ”Konigsberger Bruckenproblem” . In the recent years, graph visualization has found applications in software engineering , electrical circuits , biology and sociology . Battista et al. and Eades et al. survey a range of methods used to draw graphs and define aesthetic criteria for this purpose. Herman et al. generalize this and view it from an information visualization perspective. They study and compare various traditional layouts used to draw graphs including tree-, 3D- and hyperbolic-based layouts.

As embedding represents a graph in a vector space, dimensionality reduction techniques like Principal Component Analysis (PCA) and t-distributed stochastic neighbor embedding (t-SNE) can be applied on it to visualize the graph. The authors of DeepWalk illustrated the goodness of their embedding approach by visualizing the Zachary’s Karate Club network. The authors of LINE visualized the DBLP co-authorship network, and showed that LINE is able to cluster together authors in the same field. The authors of SDNE applied it on 20-Newsgroup document similarity network to obtain clusters of documents based on topics.

3 Clustering

Graph clustering (a.k.a., network partitioning) can be of two types: (a) structure based, and (b) attribute based clustering. The former can be further divided into two categories, namely community based, and structurally equivalent clustering. Structure-based methods , aim to find dense subgraphs with high number of intra-cluster edges, and low number of inter-cluster edges. Structural equivalence clustering , on the contrary, is designed to identify nodes with similar roles (like bridges and outliers). Attribute based methods utilize node labels, in addition to observed links, to cluster nodes.

White et al. used kk-means on the embedding to cluster the nodes and visualize the clusters obtained on Wordnet and NCAA data sets verifying that the clusters obtained have intuitive interpretation. Recent methods on embedding haven’t explicitly evaluated their models on this task and thus it is a promising field of research in the graph embedding community.

4 Link Prediction

Networks are constructed from the observed interactions between entities, which may be incomplete or inaccurate. The challenge often lies in identifying spurious interactions and predicting missing information. Link prediction refers to the task of predicting either missing interactions or links that may appear in the future in an evolving network. Link prediction is pervasive in biological network analysis, where verifying the existence of links between nodes requires costly experimental tests. Limiting the experiments to links ordered by presence likelihood has been shown to be very cost effective. In social networks, link prediction is used to predict probable friendships, which can be used for recommendation and lead to a more satisfactory user experience. Liben-Nowell et al., Lu et al. and Hasan et al. survey the recent progress in this field and categorize the algorithms into (a) similarity based (local and global) , (b) maximum likelihood based and (c) probabilistic methods .

Embeddings capture inherent dynamics of the network either explicitly or implicitly thus enabling application to link prediction. Wang et al. and Ou et al. predict links from the learned node representations on publicly available collaboration and social networks. In addition, Grover et al. apply it to biology networks. They show that on these data sets links predicted using embeddings are more accurate than traditional similarity based link prediction methods described above.

5 Node Classification

Often in networks, a fraction of nodes are labeled. In social networks, labels may indicate interests, beliefs, or demographics. In language networks, a document may be labeled with topics or keywords, whereas the labels of entities in biology networks may be based on functionality. Due to various factors, labels may be unknown for large fractions of nodes. For example, in social networks many users do not provide their demographic information due to privacy concerns. Missing labels can be inferred using the labeled nodes and the links in the network. The task of predicting these missing labels is also known as node classification. Bhagat et al. survey the methods used in the literature for this task. They classify the approaches into two categories, i.e., feature extraction based and random walk based. Feature-based models generate features for nodes based on their neighborhood and local network statistics and then apply a classifier like Logistic Regression and Naive Bayes to predict the labels. Random walk based models propagate the labels with random walks.

Embeddings can be interpreted as automatically extracted node features based on network structure and thus falls into the first category. Recent work has evaluated the predictive power of embedding on various information networks including language, social, biology and collaboration graphs. They show that embeddings can predict missing labels with high precision.

Experimental Setup

Our experiments evaluate the feature representations obtained using the methods reviewed before on the previous four application domains. Next, we specify the datasets and evaluation metrics we used. The experiments were performed on a Ubuntu 14.04.4 LTS system with 32 cores, 128 GB RAM and a clock speed of 2.6 GHz. The GPU used for deep network based models was Nvidia Tesla K40C.

We evaluate the embedding approaches on a synthetic and 6 real datasets. The datasets are summarized in Table 3.

SYN-SBM: We generate synthetic graph using Stochastic Block Model with 1024 nodes and 3 communities. We set the in-block and cross-block probabilities as 0.1 and 0.01 respectively. As we know the community structure in this graph, we use it to visualize the embeddings learnt by various approaches.

KARATE : Zachary’s karate network is a well-known social network of a university karate club. It has been widely studied in social network analysis. The network has 34 nodes, 78 edges and 2 communities.

BLOGCATALOG : This is a network of social relationships of the bloggers listed on the BlogCatalog website. The labels represent blogger interests inferred through the metadata provided by the bloggers. The network has 10,312 nodes, 333,983 edges and 39 different labels.

YOUTUBE : This is a social network of Youtube users. This is a large network containing 1,157,827 nodes and 4,945,382 edges. The labels represent groups of users who enjoy common video genres.

HEP-TH : The original dataset contains abstracts of papers in High Energy Physics Theory for the period from January 1993 to April 2003. We create a collaboration network for the papers published in this period. The network has 7,980 nodes and 21,036 edges.

ASTRO-PH : This is a collaboration network of authors of papers submitted to e-print arXiv during the period from January 1993 to April 2003. The network has 18,772 nodes and 396,160 edges.

PROTEIN-PROTEIN INTERACTIONS (PPI) : This is a network of biological interactions between proteins in humans. This network has 3,890 nodes and 38,739 edges.

2 Evaluation Metrics

To evaluate the performance of embedding methods on graph reconstruction and link prediction, we use Precision at kk (Pr@kPr@k) and MeanAveragePrecision(MAP)MeanAveragePrecision(MAP) as our metrics. For node classification, we use micro-F1 and macro-F1. These metrics are defined as follows:

Pr@k is the fraction of correct predictions in top kk predictions. It is defined as Pr@k=Epred(1:k)EobskPr@k=\frac{|E_{pred}(1:k)\cap E_{obs}|}{k}, where Epred(1:k)E_{pred}(1:k) are the top kk predictions and EobsE_{obs} are the observed edges. For the task of graph reconstruction, Eobs=EE_{obs}=E and for link prediction, EobsE_{obs} is the set of hidden edges.

MAP estimates precision for every node and computes the average over all nodes, as follows:

macro-F1, in a multi-label classification task, is defined as the average F1F1 of all the labels, i.e.,

where F1(l)F1(l) is the F1F1-score for label ll.

micro-F1 calculates F1F1 globally by counting the total true positives, false negatives and false positives, giving equal weight to each instance. It is defined as follows:

where P=lLTP(l)lL(TP(l)+FP(l))P=\frac{\sum_{l\in\mathcal{L}}TP(l)}{\sum_{l\in\mathcal{L}}(TP(l)+FP(l))}, and R=lLTP(l)lL(TP(l)+FN(l))R=\frac{\sum_{l\in\mathcal{L}}TP(l)}{\sum_{l\in\mathcal{L}}(TP(l)+FN(l))}, are precision (P) and recall (R) respectively, and TP(l)TP(l), FP(l)FP(l) and FN(l)FN(l) denote the number of true positives, false positives and false negatives respectively among the instances which are associated with the label ll either in the ground truth or the predictions.

Experiments and Analysis

In this section, we evaluate and compare embedding methods on the for tasks presented above. For each task, we show the effect of number of embedding dimensions on the performance and compare hyper parameter sensitivity of the methods. Furthermore, we correlate the performance of embedding techniques on various tasks varying hyper parameters to test the notion of an “all-good” embedding which can perform well on all tasks.

Embeddings as a low-dimensional representation of the graph are expected to accurately reconstruct the graph. Note that reconstruction differs for different embedding techniques (refer to Section 3). For each method, we reconstruct the proximity of nodes and rank pair of nodes according to their proximity. Then we calculate the ratio of real links in top kk predictions as the reconstruction precision. As the number of possible node pairs (N(N1)N(N-1)) can be very large for networks with a large number of nodes, we randomly sample 1024 nodes for evaluation. We obtain 5 such samples for each dataset and calculate the mean and standard deviation of precision and MAP values for subgraph reconstruction. To obtain optimal hyperparameters for each embedding method, we compare the mean MAP values for each hyperparameter. We then re-run the experiments with the optimal hyperparameter on 5 random samples of 1024 nodes and report the results.

Figure 2 illustrates the reconstruction precision obtained by 128-dimensional embeddings. We observe that although performance of methods is dataset dependent, embedding approaches which preserve higher order proximities in general outperform others. Exceptional performance of Laplacian Eigenmaps on SBM can be attributed to the lack of higher order structure in the data set. We also observe that SDNE consistently performs well on all data sets. This can be attributed to its capability of learning complex structure from the network. Embeddings learned by node2vec have low reconstruction precision. This may be due to the highly non-linear dimensionality reduction yielding a non-linear manifold. However, HOPE, which learns linear embeddings but preserves higher order proximity reconstructs the graph well without any additional parameters.

Effect of dimension. Figure 3 illustrates the effect of dimension on the reconstruction error. With a couple of exceptions, as the number of dimensions increase, the MAP value increases. This is intuitive as higher number of dimensions are capable of storing more information. We also observe that SDNE is able to embed the graphs in 16-dimensional vector space with high precision although decoder parameters are required to obtain such precision.

2 Visualization

Since embedding is a low-dimensional vector representation of nodes in the graph, it allows us to visualize the nodes to understand the network topology. As different embedding methods preserve different structures in the network, their ability and interpretation of node visualization differ. For instance, embeddings learned by node2vec with parameters set to prefer BFS random walk would cluster structurally equivalent nodes together. On the other hand, methods which directly preserve kk-hop distances between nodes (GF, LE and LLE with k=1k=1 and HOPE and SDNE with k>1k>1) cluster neighboring nodes together. We compare the ability of different methods to visualize nodes on SBM and Karate graph. For SBM, following , we learn a 128-dimensional embedding for each method and input it to t-SNE to reduce the dimensionality to 2 and visualize nodes in a 2-dimensional space.

Visualization of SBM is show in Figure 4. As we know the underlying community structure, we use the community label to color the nodes. We observe that embeddings generated by HOPE and SDNE which preserve higher order proximities well separate the communities although as the data is well structured LE, GF and LLE are able to capture community structure to some extent.

We visualize Karate graph (see Figure 5) to illustrate the properties preserved by embedding methods. LLE and LE ((a) and (f)) attempt to preserve the community structure of the graph and cluster nodes with high intra-cluster edges together. GF ((b)) embeds communities very closely and keeps leaf nodes far away from other nodes. In (d), we observe that HOPE embeds nodes 16 and 21, whose Katz similarity in the original graph is very low (0.0006), farthest apart (considering dot product similarity). node2vec and SDNE ((c) and (e)) preserve a mix of community structure and structural property of the nodes. Nodes 32 and 33, which are both high degree hubs and central in their communities, are embedded together and away from low degree nodes. Also, they are closer to nodes which belong to their communities. SDNE embeds node 0, which acts a bridge between communities, far away from other nodes. Note that, unlike for other methods, it does not imply that node 0 is disconnected from the rest of the nodes. The implication here is that SDNE identifies node 0 as a separate type of node and encodes its connection to other nodes in encoder and decoder. The ability of deep autoencoders to identify important nodes in the network has not been studied but given this observation we believe this direction can be promising.

3 Link Prediction

Another important application of graph embedding is predicting unobserved links in the graph. A good network representation should be able to capture the inherent structure of graph well enough to predict the likely but unobserved links. To test the performance of different embedding methods on this task, for each data set we randomly hide 20% of the network edges. We learn the embedding using the rest of the 80% edges and predict the most likely edges which are not observed in the training data from the learned embedding. As with graph reconstruction, we generate 5 random subgraphs with 1024 nodes and test the predicted links against the held-out links in the subgraphs. We perform this experiment for each hyperparameter and re-run it for optimal hyperparameters on a new random 80-20 link split.

Figure 6 and 7 show the precision@kprecision@k results for link prediction with 128-dimensional embeddings and MAP for each dimension respectively. Here we can see that the performance of methods is highly data set dependent. node2vec achieves good performance on BlogCatalog but performs poorly on other data sets. HOPE achieves good performance on all data sets which implies that preserving higher order proximities is conducive to predicting unobserved links. Similarly, SDNE outperforms other methods with the exception on PPI for which the performance degrades drastically as embedding dimension increases above 8.

Effect of dimension. Figure 7 illustrates the effect of embedding dimension on link prediction. We make two observations. Firstly, in PPI and BlogCatalog, unlike graph reconstruction performance does not improve as the number of dimensions increase. This may be because with more parameters the models overfit on the observed links and are unable to predict unobserved links. Secondly, even on the same data set, relative performance of methods depends on the embedding dimension. In PPI, HOPE outperforms other methods for higher dimensions,whereas embedding generated by SDNE achieves higher link prediction MAP for low dimensions.

4 Node Classification

Predicting node labels using network topology is widely popular in network analysis and has variety of applications, including document classification and interest prediction. A good network embedding should capture the network structure and hence be useful for node classification. We compare the effectiveness of embedding methods on this task by using the generated embedding as node features to classify the nodes. The node features are input to a one-vs-rest logistic regression using the LIBLINEAR library. For each data set, we randomly sample 10% to 90% of nodes as training data and evaluate the performance on the remaining nodes. We perform this split 5 times and report the mean with confidence interval. For data sets with multiple labels per node, we assume that we know how many labels to predict.

Figure 8 shows the results of our experiments. We can see that node2vec outperforms other methods on the task of node classification. As mentioned earlier (§3), node2vec preserves homophily as well as structural equivalence between nodes. Results suggest this can be useful in node classification: e.g., in BlogCatalog users may have similar interests, yet connect to others based on social ties rather than interests overlap. Similarly, proteins in PPI may be related in functionality and interact with similar proteins but may not assist each other. However, in SBM, other methods outperform node2vec as labels reflect communities yet there is no structural equivalence between nodes.

Effect of dimension. Figure 9 illustrates the effect of embedding dimensions on node classification. As with link prediction, we observe that performance often saturates or deteriorates after certain number of dimensions. This may suggest overfitting on the training data. As SBM exhibits very structured communities, an 8-dimensional embedding suffices to predict the communities. node2vec achieves best performance on PPI and BlogCat with 128 dimensions.

5 Hyperparameter Sensitivity

In this section we plan to address the following questions:

How robust are the embedding methods with respect to hyperparameters?

Do optimal hyperparameters depend on the downstream tasks the embeddings are used for?

What insights does performance variance with hyperparameter provide about a data set?

We answer these questions by analyzing performance of the embedding methods with various hyperparameters. We present results on SBM, PPI and Hep-th. Of the methods we evaluated in this survey, Laplacian Eigenmaps has no hyperparameters, thus is not included in the following analysis.

Graph Factorization (GF). The objective function of GF contains a weight regularization term with a coefficient. Intuitively, this coefficient controls the generalizability of the embedding. A low regularization coefficient facilitates better reconstruction but may overfit to the observed graph leading to poor prediction performance. On the other side, a high regularization may underrepresent the data and hence perform poorly on all tasks. We observe this effect in Figure 10. We see that performance on prediction tasks, namely link prediction (Fig. 10b) and node classification (Fig. 10c), improves as we increase the regularization coefficient, reaches a peak and then starts deteriorating. However, graph reconstruction performance (Fig. 10a) may deteriorate with increasing regularization. We also note that the performance change is considerable and thus the coefficient should be carefully tuned to the given data set.

HOPE. As HOPE factorizes a similarity matrix between nodes to obtain the embedding, the hyperparameters depend on the method used to obtain the similarity matrix. Since in our experiments we used Katz index for this purpose, we evaluate the effect of the attenuation factor (β\beta), which can be interpreted as the higher order proximity coefficient on performance. Graph structure affects the optimal value of this parameter. For well-structured graphs with tightly knit communities, high values of betabeta would erroneously assign dissimilar nodes closer in the embedding space. On the contrary, for graphs with weak community structure it is important to capture higher order distances and thus high values of betabeta may yield better embeddings. We validate our hypothesis in Figure 11. As our synthetic data SBM consists of tight communities, increasing β\beta does not improve the performance on any task. However, gain in performance with increasing betabeta can be observed in PPI and HEP-TH. This is expected as collaboration and protein networks tend to evolve via higher order connections. We observe that the optimal betabeta for these data sets is lowest for the task of graph reconstruction (Fig. 11(a)) and highest for link prediction (Fig. 11b), 262^{-6} and 242^{-4} respectively. This also follows intuition as higher order information is not necessary for reconstructing observed edges but is useful for prediction tasks. Nodes farther from each other are more likely to have common labels than links between them. For example, in a collaboration network, authors in a field will form a weak community but many of them need not be connected to each other (in other words, most researchers of a same community won’t be co-authors of one another). Thus, if we were to predict field for an author, having information about other authors inside the weak community can help improve the accuracy of our model.

SDNE. SDNE uses a coupled deep autoencoder to embed graphs. It leverages a parameter to control the weight of observed and unobserved link reconstruction in the objective function. A high parameter value would focus on reconstructing observed links disregarding the absence of unobserved links. This parameter can be crucial as a low value could hinder predicting hidden links. Figure 12 illustrates the results of our analysis. We observe that performance on link prediction (Fig. 12b) greatly varies depending on the weight, with a more than 3-fold increase in MAP for Hep-th with the optimal parameter value, and about 2-fold increase for PPI. The performance on node classification (Fig. 12c), on the other hand, is less affected by the parameter. Overall, we see that the maximum performance is achieved for an intermediate value of the weight above which the performance drops.

node2vec. node2vec performs biased random walks on the graph and embeds nodes commonly appearing together in them close in the embedding space. Of the various hyperparameters of the method (which include walk length, context size and bias weights), we analyze the effect of bias weights on performance and adopt commonly-used values for the remaining hyperparameter , namely, context size of 10 and walk length of 80. node2vec has two bias weights: (a) inout parameter (qq), which controls the likelihood of random walk to go further away from the incoming node (higher values favor closer nodes), and (b) return parameter (pp), which weighs the return probability (lower values favor return). Lower values of qq would help capture longer distances between nodes and aims towards preserving structural equivalence. Figure 13 illustrates the effect on PPI and HEPTH. In node classification (Fig. 13c) we observe that low qq values help achieve higher accuracy suggesting that capturing structural equivalence is required to accurately embed the structure of the graph. On the contrary, high qq values favor link prediction (Fig. 13b) following intuition that capturing community structure is crucial for the task. We make similar observations for SBM in Figure 14 for the task of link prediction. MAPMAP increases with increasing qq until it reaches an optimal. We also note that the optimal values of qq in SBM are much higher as the graph has strong community structure.

A Python Library for Graph Embedding

We released an open-source Python library, GEM (Graph Embedding Methods, https://github.com/palash1992/GEM), which provides a unified interface to the implementations of all the methods presented here, and their evaluation metrics. The library supports both weighted and unweighted graphs. GEM’s hierarchical design and modular implementation should help the users to test the implemented methods on new datasets as well as serve as a platform to develop new approaches with ease.

GEM (https://github.com/palash1992/GEM) provides implementations of Locally Linear Embedding , Laplacian Eigenmaps , Graph Factorization , HOPE , SDNE and node2vec . For node2vec, we use the C++ implementation provided by the authors and yield a Python interface. In addition, GEM provides an interface to evaluate the learned embedding on the four tasks presented above. The interface is flexible and supports multiple edge reconstruction metrics including cosine similarity, euclidean distance and decoder based (for autoencoder-based models). For multi-labeled node classification, the library uses one-vs-rest logistic regression classifiers and supports the use of other ad hoc classifiers.

Conclusion and Future Work

This review of graph embedding techniques covered three broad categories of approaches: factorization based, random walk based and deep learning based. We studied the structure and properties preserved by various embedding approaches and characterized the challenges faced by graph embedding techniques in general as well as each category of approaches. We reported various applications of embedding and their respective evaluation metrics. We empirically evaluated the surveyed methods on these applications using several publicly available real networks and compared their strengths and weaknesses. Finally, we presented an open-source Python library, named GEM, we developed with implementation of the embedding methods surveyed and evaluation tasks including graph reconstruction, link prediction, node classification and visualization.

We believe there are three promising research directions in the field of graph embedding: (1) exploring non-linear models, (2) studying evolution of networks, and (3) generate synthetic networks with real-world characteristics. As shown in the survey, general non-linear models (e.g. deep learning based) have shown great promise in capturing the inherent dynamics of the graph. They have the ability to approximate an arbitrary function which best explains the network edges and this can result in highly compressed representations of the network. One drawback of such approaches is the limited interpretability. Further research focusing on interpreting the embedding learned by these models can be very fruitful. Utilizing embedding to study graph evolution is a new research area which needs further exploration. Recent work by , and pursued this line of thought and illustrate how embeddings can be used for dynamic graphs. Generating synthetic networks with real-world characteristics has been a popular field of research primarily for ease of simulations. Low dimensional vector representation of real graphs can help understand their structure and thus be useful to generate synthetic graphs with real world characteristics. Learning embedding with a generative model can help us in this regard.

References

References