Similarity-based Link Prediction from Modular Compression of Network Flows
Abstract
Node similarity scores are a foundation for machine learning in graphs for clustering, node classiﬁcation, anomaly detection, and link prediction with applications in biological systems, information networks, and recommender systems.
Recent works on link prediction use vector space embeddings to calculate node similarities in undirected networks with good performance, but they have several disadvantages: limited interpretability, they require hyperparameter tuning, manual model ﬁtting through dimensionality reduction, and poor performance of symmetric similarities in directed link prediction.
We propose MapSim , an information-theoretic measure to assess node similarities based on modular compression of network ﬂows.
Different from vector space embeddings, MapSim represents nodes in a discrete, non-metric space of communities and yields asymmetric similarities in an unsupervised fashion.
We compare MapSim on a link prediction task to popular embedding-based algorithms across 47 networks and ﬁnd that MapSim ’s average performance across all networks is more than 7% higher than its closest competitor, outperforming all embedding methods in 11 of the 47 networks.
Our method demonstrates the potential of compression-based approaches in graph representation learning, with promising applications in other graph learning tasks.
Introduction
Calculating similarity scores between objects is a fundamental problem in machine learning tasks from clustering, anomaly detection, and text mining to classiﬁcation and recommender systems.
In
Euclidean feature spaces, similarities between feature vectors are commonly calculated as lengths, norms, angles or other geometric concepts, possibly using kernel functions that perform implicit non-linear mappings to high-dimensional feature spaces [1].
For relational data represented as graphs, methods using the graph topology to calculate pairwise node similarities can address learning problems such as graph clustering, node classiﬁcation, and link prediction.
For link prediction, recent works take a multi-step approach and separate representation learning and link prediction [2, 3]: First, they learn a latent-space node embedding from the graph’s topology, using methods such as graph or matrix factorisation [4, 5], or random-walk based techniques [6–8].
Then, they interpret node positions as points in a high-dimensional feature space, possibly applying downstream dimensionality reduction.
Finally, they use node positions in the resulting feature space to assign new “features” to pairs of nodes, which can be used to predict links.
Taking an unsupervised approach, we predict links based on node similarities [9] by calculating distance metrics or similarity scores between node pairs
Intra-community links tend to have shorter description lengths than inter-community links.
to rank them.
We can alternatively use a supervised approach [10] by (i) using binary operators like the Hadamard product [7], (ii) sampling negative instances (node pairs not connected by links), and (iii) using the features of positive and negative instances to train a supervised binary classiﬁer [7].
Advances in graph embedding and representation learning have considerably improved our ability to predict links in networks, with applications in biological [11] and social [12] networks and in recommender systems [13].
However, these methods introduce challenges for real-world linkprediction tasks:
First, they require specifying hyperparameters that control aspects regarding the scale of patterns in graphs, inﬂuence of local and non-local structures, and latent space dimensionality [14].
Network-speciﬁc hyperparameter tuning addresses these issues, but is challenging in real applications and aggravates the risk of overﬁtting; recent systematic comparisons reveal that the performance of different methods largely varies across data sets [2, 3].
Altogether, this makes it difﬁcult for practitioners to choose and optimally parametrise an embedding method.
Second, using latent metric spaces implies symmetric similarities, limiting the performance when predicting directed links [5, 15].
Third, compared with hand-crafted features, embeddings tend to have low interpretability: We can assess the similarity of nodes, but we cannot explain why some nodes are more similar than others [2–4].
Nevertheless, recent graph neural network-based approaches focus on learning features for link prediction from local subgraphs [16], overlapping node neighbourhoods [17], or based on shortest paths [18], achieving favourable performance.
Finally, recent works highlight fundamental limitations of low-dimensional representations of complex networks [19], questioning to what extent Euclidean embeddings can capture patterns relevant for link prediction.
Motivated by recent works highlighting the importance of community structures for link prediction [2, 20, 21], we propose a novel approach to similarity-based link prediction that addresses these issues.
Our contributions are:
• We introduce map equation similarity, MapSim for short, an information-theoretic method to calculate asymmetric node similarities.
MapSim builds on the map equation [22], a framework that applies coding theory to compress random walks based on hierarchical cluster structures.
• Different from
other random walk-based embedding techniques
, our work builds on an analytical approach to calculate the expected description length of random walks in the limit, and, thus, requires neither simulating random walks nor tuning hyperparameters.
• Following the minimum description length principle, MapSim incorporates Occam’s razor and balances explanatory power with model complexity, making dimensionality reduction superﬂuous.
With hierarchical cluster structures, MapSim captures patterns at multiple scales simultaneously and combines advantages of local and non-local similarity scores.
• We validate MapSim in an unsupervised, similarity-based link prediction task and compare its performance to six well-known embedding-based techniques in 47 empirical networks from different domains.
Highlighting challenges in the generalisability of embedding techniques and parametrisations across different networks, this analysis is a contribution in itself.
• Conﬁrming recent surveys, we ﬁnd that, without network-speciﬁc hyperparameter tuning, the performance of popular embedding techniques for unsupervised link prediction depends on the data.
In contrast, MapSim provides high performance across a wide range of networks, with an average performance 7.7% and 7.5% better than the best competitor in undirected and directed
networks, respectively.
MapSim ourtperforms the chosen baseline methods in 11 of thenetworks with a worst-case performance 44% and 33% better compared to popular embedding techniques in undirected and directed networks, respectively.
In summary, we take a novel perspective on graph representation learning that fundamentally differs from other random walk-based graph embeddings.
Rather than embedding nodes into a metric space, leading to symmetric similarities, we develop an unsupervised learning framework where (i) positions of nodes in a coding tree capture their representation in a non-metric latent space, and (ii) node similarities are calculated based on how well transitions between nodes are compressed by a network’s hierarchical modular structure (ﬁgure 1).
Apart from node similarities that can be “explained” based on community structures captured in the coding tree, MapSim yields asymmetric similarity scores that naturally support link prediction in directed networks.
We provide a simple, non-parametric, and scalable unsupervised method with high generalisability across data sets, and which should thus be of interest for practitioners.
Our work demonstrates the power of compression-based approaches to graph representation learning, with promising applications in other graph learning tasks.
Related Work and Background
We ﬁrst summarise recent works on graph embedding and similarity-based link prediction.
Then, we review the map equation, an information-theoretic objective function for community detection and the theoretical foundation of our compression-based similarity score.
2.1 Related Work
Focusing on unsupervised similarity-based link prediction, we consider methods that calculate a bivariate function sim ( u, v ) ∈ R d , where u, v ∈ V are nodes in a directed or undirected, possibly weighted graph G =
( V, E ) [23, 24].
While similarity metrics often consider scalar functions ( d = 1 ), recent vector space embeddings use binary operators to assign vector-valued “features” with d >to node pairs.
Since vectorial features are typically used in downstream classiﬁcation techniques, this can be seen as an implicit mapping to similarities, for example “similar” features being assigned similar class probabilities.
We limit our discussion to topological or structural approaches [23], and consider functions sim ( u, v ) that can be calculated solely based on the edges E in graph G without requiring additional information such as node attributes or other non-topological graph properties.
Several works deﬁne scalar similarities based on local topological characteristics such as the Jaccard index of neighbour sets, degrees of nodes, or degree-weighted measures of common neighbours [25].
Other methods deﬁne similarities based on random walks, paths, or topological distance between nodes [9, 26–28].
Compared to purely local approaches, an advantage of random walk-based methods is their ability to incorporate both local and non-local information, which is crucial for sparse networks where nodes may lack common neighbours.
Since walk-based methods reveal cluster patterns in networks [22], they generally perform well in downstream tasks such as link prediction and graph clustering [2].
Graph factorisation approaches that use eigenvectors of different types of Laplacian matrices that represent relationships between nodes share this high performance [29], likely because (i) Laplacians capture the dynamics of continuous-time random walks [30], and (ii) spectral methods can capture small cuts in graphs [31].
Building on these ideas, recent works on graph representation learning combine random walks and deep learning to obtain high-dimensional vector space embeddings of nodes, serving as features in downstream learning tasks [3, 14]:
Perozzi et al.
[6] generate a large number of short random walks to learn latent space representations of nodes by applying a word embedding technique that considers node sequences as word sequences in a sentence.
This corresponds to an implicit factorisation of a matrix whose entries capture the logarithm of the expected probabilities to walk between nodes in a given number of steps [32].
Following a similar walk-based approach, Grover and Leskovec [7] generate node sequences with a biased random walker whose exploration behaviour can be tuned by search bias parameters p and q .
The resulting walk sequences are used as input for the word embedding algorithm word2vec
[33], which embeds objects in a latent vector space with conﬁgurable dimensionality.
Tang et al.
[8] construct vector space embeddings of nodes that simultaneously preserve ﬁrst- and second-order proximities between nodes.
Similar to Adamic and
Adar [25], second-order node proximities are deﬁned based on common neighbours.
Extending the random walk approach in [6], Perozzi et al.
[34] learn embeddings from so-called walklets, random walks that skip some nodes, resulting in embeddings that capture structural features at multiple scales.
The abovementioned graph embedding methods compute a representation of nodes in a, compared to the number of nodes in the network, low-dimensional Euclidean space.
A suitably deﬁned metric for similarity or distance of nodes enables recovering the link topology with high ﬁdelity [35], forming the basis for similarity-based link prediction.
In contrast, Lichtenwalter et al.
[10] argued for a new perspective that uses supervised classiﬁers based on (i) multi-dimensional features of node pairs, and (ii) an undersampling of negative instances to address inherent class imbalances in link prediction.
Recent applications of graph embedding to link prediction have taken a similar supervised approach, for example using vector-valued binary operators to construct features for node pairs from node vectors [6, 7, 24].
Despite good performance, recent works have cast a more critical light on such applications of low-dimensional graph embeddings.
Questioning the distinction between deep learning-based embeddings and graph factorisation techniques, Qiu et al.
[4] show that popular embedding techniques can be understood as (approximate) factorisations of matrices that capture graph topology.
Thus, low-dimensional embeddings can be viewed as a (lossy) compression of graphs, while link prediction or graph reconstruction can be viewed as the decompression step.
Fitting this view, a recent study of the topological characteristics of networks’ low-dimensional
Euclidean representations has highlighted fundamental limitations of embeddings to capture complex structures found in real networks [19].
Techniques like node2vec, LINE, or DeepWalk have been reported to perform well for link prediction despite those limitations.
However, recent surveys concur that ﬁnetuning their hyperparameters to the speciﬁc data set is required [2, 21, 36], which can be problematic in large data sets and increase the risk of overﬁtting.
When used for link prediction, graph embedding methods are typically combined with dimensionality reduction and supervised classiﬁcation algorithms, possibly using non-linear kernels.
Comparative studies found that the performance of Euclidean graph embeddings for link prediction is connected to their ability to represent communities in graphs as clusters in the feature space [2], which, due to the non-linear nature of graph data [37], strongly depends on their topology.
Using symmetric operators or distance measures in metric spaces limits their ability to predict directed links because the ground truth for ( u, v ) can differ from ( v, u ) [15].
These issues raise the general question whether we should use low-dimensional Euclidean embeddings for link prediction tasks.
Recent works addressed some of those open questions, for example with hyperbolic or non-linear embeddings [20, 37], extensions of Euclidean embeddings for directed link prediction [15], or embeddings that explicitly account for community structures [21, 38, 39].
However, existing works still use hyperparameters, require separate dimensionality reduction or model selection to identify the optimal number of dimensions, fail to capture rich hierarchically nested community structures present in real-world networks [40], or do not integrate community detection with representation learning.
Addressing all issues at once, we take a novel approach that treats graph representation learning as a compression problem: We use the map equation [22], an analytical information-theoretic approach to compress ﬂows of random walks in directed or undirected, possibly weighted networks based on their modular structure.
Unlike recent work by Ghasemian et al.
[41] that predicts links based on how they inﬂuence the map equation’s estimated codelength, requiring inefﬁcient recalculations, we take advantage of the map equation’s coding machinery without any computational overhead.
The map equation’s hierarchical coding tree with node assignments provides an embedding in a discrete, non-metric latent space of possibly hierarchical community labels with automatically optimised dimensionality using a minimum description length approach.
Following the map equation’s compression principles, we relate the similarity between nodes u and v to how efﬁciently we can compress the link ( u, v ) with respect to the network’s modular structure.
As an analytical approach, our method neither introduces hyperparameters nor needs to simulate random walks, and naturally yields asymmetric node similarities suitable to predict directed links.
2.2 Background: the map equation
The map equation is an information-theoretic objective function for community detection that, conceptually, models network ﬂows with random walks [22].
To detect communities, the map equation compresses the random walks’ per-step description length by searching for sets of nodes with long ﬂow persistence: network areas where a random walker tends to stay for a longer time.
A 0 1.
B 1 1.
encoding: 0 01 00 10 1101 1 10 11
(18.1 bits)
A
B         2 bits 6.9 bits
Consider a communication game where the sender observes a random walker on a network, and uses binary codewords to update the receiver about the random walker’s location.
In the simplest case, all nodes belong to the same module and we use a Huffman code to assign unique codewords to the nodes based on their stationary visit rates.
With a one-module partition, M 1 , the sender communicates one codeword per random-walker step to the receiver.
The theoretical lower limit for the per-step description length, we call it codelength , is the entropy of the nodes’ visit rates [42],
[Equation]
where H is the Shannon entropy, P is the set of the nodes’ visit rates, and p u is node u ’s visit rate.
In networks with modular structure, we can compress the random walks’ description by grouping nodes into more than one module such that a random walker tends to remain within modules, and module switches become rare.
This lets us re-use codewords across modules and design a codebook per module based on the nodes’ module-normalised visit rates.
However, sender and receiver need a way to encode module switches.
The map equation uses a designated module-exit codeword per module and an index-level codebook with module-entry codewords.
In a two-level partition, the sender communicates one codeword for intra-module random-walker steps to the receiver, or three codewords for inter-module steps (ﬁgure 2).
The lower limit for the codelength is given by the sum of entropies associated with module and index codebooks, weighted by their usage rates.
Given a partition of the network’s nodes into modules, M , the map equation [22] formalises this relationship,
[Equation]
Here q = (cid:80) m ∈ M q m is the index-level codebook usage rate, q m is the entry rate for module m , and Q = { q m | m ∈ M } is the set of module entry rates; m exit is the exit rate for module m , p m = m exit + (cid:80) u ∈ m p u is the codebook usage rate for module m , and P m = { m exit } ∪ { p u | u ∈ m } is the set of node visit rates in m , including m ’s module exit rate.
The map equation can detect communities in simple, weighted, directed, and higher-order networks, and can be generalised to hierarchical partitions through recursion [40].
To make use of node metadata for detecting communities, we can either incorporate a corresponding term in the map equation [43],
... preﬁx p =
[p 1 , ... , p i ] ... pn p i
u
j v j u k u v k v l v rev(M h p
i , [u j , u k ])
forw(M h p i , [v j , v k , v l ]) metadata-informed ﬂow models [44], or introduce a prior network and reinforce link weights between nodes with the same metadata label [45].
MapSim: node similarities from modular ﬂow compression
Compression-based similarity measures consider pairs of objects more similar if they jointly compress better.
Extending this idea to networks, we exploit the coding of network ﬂows based on the map equation, and use it to calculate information-theoretic pairwise similarities between nodes: MapSim .
We interpret a network’s community structure as an implicit embedding and, roughly speaking, consider nodes in the same community as more similar than nodes in different communities.
To calculate node similarities, we begin with a network partition and its corresponding modular coding scheme 2 , which can be visualised as a tree, annotated with the transition rates deﬁned by the link patterns in the network (ﬁgure 2).
While the network’s topology constrains random walks to transitions along existing links, the coding scheme is more ﬂexible and can describe transitions between any pair of nodes.
To describe the transition from node u to v , we ﬁnd the corresponding path in the partition tree and multiply the transition rates along that path, that is, we use the coarse-grained description of the network’s community structure, not the network’s actual link pattern; it can describe any transition regardless of whether the link ( u, v ) exists in the network or not.
The description length in bits for a path with transition rate r is − log 2 ( r ) .
For example, consider the scenario in ﬁgure 2 where we calculate similarity scores for the two directed links (5 , 3) and (5 , 7) , neither of which exists in the network.
Nodes 5 and 3 are in module A , and the rate at which a random walker in A visits node 3 is 3 / 12 , requiring − log 2 (3 / 12)
= 2 bits to describe that transition.
Node 7 is in module B , and a random walker in A exits A at rate 1 / 12 , enters B at rate 1 / 2 , and then visits node 7 at rate 2 / 10 , that is, at rate 1 / 120 , requiring − log 2 (1 / 120)
≈ 6 . 9 bits.
Paths to derive similarities emanate from modules, not from nodes, because the model must generalise to unobserved data.
If compression was our sole purpose, we would use node-speciﬁc codebooks containing codewords for neighbouring nodes, but no longer detect communities, and only be able to describe observed links.
Instead, the map equation’s coding scheme is designed to capitalise on modular network structures: The modular code structure provides a model that generalises to unobserved data, coarse-grains the path descriptions, and prevents overﬁtting.
For the general case, where M can be a hierarchical network partition, we number the sub-modules within each module m from 1 to n m – we refer to these numbers as addresses – such that an ordered sequence of addresses uniquely identiﬁes a path starting at the root of the partition tree.
We let addr: M × N → List ( N ) be a function that takes a network partition and a node as input, and returns the node’s address in the partition.
To calculate the similarity of node v to u , we identify the longest common preﬁx p of the nodes’ addresses, addr ( M , u ) and addr ( M , v ) , and select the partition tree’s sub-tree M (cid:104) p (cid:105) that corresponds to the preﬁx p : M (cid:104) p (cid:105) is the smallest sub-tree that contains u and v .
We obtain the addresses for u and v within sub-tree M (cid:104) p (cid:105) by removing the preﬁx p from their addresses.
That is, addr ( M , u ) =
p ++ addr( M (cid:104) p (cid:105) , u ) and addr ( M , v ) = p ++ addr( M (cid:104) p (cid:105) , v ) ,
where ++ is list concatenation.
The rate at which a random walker transitions from u to v is the product of (i) the rate at which the random walker moves along the path addr( M (cid:104) p (cid:105) , u ) in reverse direction , rev( M (cid:104) p (cid:105) , addr( M (cid:104) p (cid:105) , u )) , that is from u to the root of M (cid:104) p (cid:105) , and (ii) the rate at which the random walker moves along the path addr( M (cid:104) p (cid:105) , v ) in forward direction , forw( M (cid:104) p (cid:105) , addr( M (cid:104) p (cid:105) , v )) , that is from the root of M (cid:104) p (cid:105) to v , where rev ( M , a ) = (cid:26)if a = [ x ]
[Equation]
and a (cid:48) denotes non-empty sequences.
Here p M is the codebook use rate for module M and p (cid:104)
[ x ] (cid:105) is the visit rate for the node identiﬁed by address x within the given module.
The ﬁnal addresses in equation 3 and equation 4 are treated differently, reﬂecting that the map equation forgets the most recently visited node.
We illustrate these ideas in a generic example (ﬁgure 3).
In short, we deﬁne map equation similarity,
[Equation]
where p is the longest common preﬁx shared by the addresses of u and v in the partition tree deﬁned by M .
To express map equation similarity in terms of description length, we take the − log 2 of
MapSim and regard pairs of nodes that yield a shorter description length as more similar.
MapSim is asymmetric since module entry and exit rates are, in general, different and u and v can have different visit rates.
MapSim is zero if one node is in a disconnected component; the exit rate for regions without out-links is zero, so the corresponding description length is inﬁnitely long.
This issue can be addressed with the regularised map equation [45], a Bayesian approach that introduces an empirical prior to model incomplete data with weak links between all pairs of nodes, where prior link strengths depend on the connection patterns of each node.
We calculate node similarities in three steps: (i) inferring a network’s community with Infomap [46], a greedy, search-based optimisation algorithm for the map equation, (ii) representing the corresponding coding scheme in a suitable data structure, and (iii) using MapSim to computing similarities based on the coding scheme.
The overall approach is illustrated in ﬁgs.
1 – 3 and algorithm 1. to construct coding tree for
M a pS i m
D ee p W a l k n o d e 2 v e c L I N E 1 L I N E
L I N E 1 +
N E R D
M a pS i m 1 0.
A U C
M a pS i m
D ee p W a l k n o d e 2 v e c L I N E 1 L I N E
L I N E 1 +
N E R D
M a pS i m 1 0.
A U P R
We evaluate the performance of MapSim in unsupervised, similarity-based link prediction forreal-world networks, 35 directed (table 1) and 12 undirected (table 3), retrieved from Netzschleuder [47] and Konect [48].
Details of the directed and undirected networks are shown in tables 2 and 4, respectively.
Our analysis is based on a Python-implementation available on GitHub 3 , building on
Infomap, a fast and greedy search algorithm for minimising the map equation with an open source implementation in C++ [46, 49].
As baseline, we use four random walk and neighbourhood-based embedding methods: DeepWalk [6], node2vec [7], LINE [8], and NERD [15], using the respective author’s implementation.
We also include results for MapSim based on the one-module partition for each network for comparison, which ignores community structure.
Adopting the argument by [7], we exclude graph factorisation methods and simple local similarity scores because they have already been shown to be inferior to node2vec.
We include NERD because it is a recent random walk-based embedding method proposed for directed link prediction with higher reported performance than other walk-based embeddings [15].
4.1 Unsupervised Link Prediction
Different from works that use graph embeddings for supervised link prediction, we address unsupervised link prediction.
Like Goyal and Ferrara [2] and Khosla et al.
[15], we take a similarity-based approach that does not require training a classiﬁer.
We compute similarity scores based on node embeddings, rather than applying a supervised classiﬁer to features computed for node pairs.
We adopt the approach by Khosla et al.
[15] and calculate node similarities as the sigmoid over the feature vectors’ dot product.
Considering how different embedding techniques generalise across data sets, we purposefully refrained from hyperparameter tuning .
We chose a single set of hyperparameters for each method, informed by the default parameters given by the respective authors and recent surveys’ discussion regarding which hyperparameter values generally provide good link prediction performance.
For
DeepWalk and node2vec, we sample r = 80 random walks of length l = 40 per node, and use a window size of w = 10 .
For both methods, the underlying word embedding is applied using the default model parameters ﬁxed by the authors, skipgram = 1 , k = 10 and mincount = 0 .
For node2vec we set the return parameter to p = 1 .
Since for q = p = 1 node2vec is identical to DeepWalk, we use q = 4 , which was found to provide good performance for link prediction [2].
We run LINE with ﬁrst-order (LINE 1 ), second-order (LINE 2 ), and combined ﬁrst-and-second-order proximity (LINE 1+2 ), use 1 , 000 samples per node, and s = 5 negative samples.
For NERD, we use 800 samples and κ = 3 negative samples per node.
We set the number of neighbourhood nodes to n = 1 , as suggested by the authors for link prediction.
We use d = 128 dimensions for all embeddings.
Since
MapSim is a non-parametric method, it does not require setting any hyperparameters.
However, to avoid local optima when heuristically minimising the map equation, we run Infomap 100 times and select the partition with the shortest description length.
We use 5 -fold cross-validation to split links into train and test sets, treating weighted links as indivisible.
We calculate the node embedding (for MapSim the coding tree) in the training network, derive predictions based on node similarities, and evaluate them based on the links in the validation set.
[Figure]
t i m e [ [Figure]
c
[Figure]
s
[Figure]
k =k =
[Figure]
k =
For each fold, we restrict the resulting training network to its largest (weakly) connected component. For a validation set with k positive links, we sample k negative links uniformly at random, and calculate scores for all 2 k links. In undirected networks, for each positive link ( u, v ) , we also consider ( v, u ) as positive, and, therefore, sample two negative links per positive link. Varying the discrimination threshold, we obtain a receiver operator characteristic (ROC) per fold, and calculate the area under the curve (AUC).
Detailed results, including average and worst-case performance, are shown in tables 2 and 4; we also report precision-recall performance (table 5).
We include MapSim based on the one-module partition 4 in the results and note that it performs better than using a modular partition in some cases: this suggests that the network does not have a strong community structure, which could be addressed with the regularised map equation [45].
When mentioning MapSim in the following, we refer to using modular partitions.
On average, MapSim outperforms all baseline methods across the 47 data sets in terms of AUC and
AUPR (ﬁgure 4); for detailed results on a per-network basis see tables 2, 4, and 5 in the appendix.
Using a one-sided two-sample t -test, we ﬁnd that MapSim ’s average performance across all networks is signiﬁcantly higher than that of the best graph embedding method, LINE 1+2 , both in directed and undirected networks ( p ≈ 0 . 008 and p ≈ 0 .
039 , respectively).
MapSim provides the best performance in 11 of the 47 networks, with a standard deviation of the AUC score less than half of that of the best embedding-based method (LINE 1+2 ).
For undirected networks, MapSim achieves the best performance for ﬁve of the 12 networks, while none of the embedding methods beats MapSim’s performance in more than two networks.
We ﬁnd the largest performance gain in the directed network linux , where MapSim yields an increase of AUC of approximately 22.6% compared to the best embedding (NERD).
MapSim ’s worst-case performance across all networks is approximately 44% and 33% above that of the best-performing embedding for directed and undirected networks, respectively.
MapSim ’ performance advantage can be as high as 84%, for example AUC = 0 .
988 of
MapSim in foursquare-friendships-new vs. AUC = 0 .
537 for node2vec.
While node2vec performs best in the largest directed network, MapSim performs best in the largest undirected network and in several small networks, suggesting that MapSim works well both for small and large networks.
We attribute those encouraging results to multiple features of our method: Different from graph embedding techniques that require downstream dimensionality reduction, MapSim ’s compression approach implicitly includes model selection and avoids overﬁtting.
Moreover, the representation of nodes in the coding tree is integrated with the optimisation of hierarchical community structures in the network.
Due to its non-parametric approach and the use of the analytical map equation, MapSim performs well in absence of tuning to the speciﬁc data set.
4.2 Scalability Analysis
We analyse MapSim ’s scalability in synthetically generated networks with modular structure and tunable size and link density.
We generate k -regular random graphs with N nodes and (mean) degree k .
To avoid trivial conﬁgurations where a modular structure is absent, we create a network by ﬁrst generating two k -regular random graphs with N 2 nodes each and “cross” two links, one from each of the two graphs, to obtain a single connected network with strong community structure.
We then apply Infomap to (i) minimise the map equation and extract the network’s modular structure, and (ii) construct the coding tree for calculating node similarities.
We repeat this 10 times for random networks with different numbers of N nodes and degrees k .
The average run times are reported in ﬁgure 5, which shows that, for sparse networks, the runtime of MapSim is linear in the size of the network.
Edler et al.
[49] report that the theoretical asymptotic bound of computational complexity for the optimisation of the map equation is in O ( NlogN ) , which is the same as for vector space embedding techniques like node2vec and DeepWalk 5 .
Thus, MapSim does not entail higher computational complexity compared to popular graph embeddings.
This makes it an interesting choice for practitioners looking for a simple and scalable method that works well in small, large, directed, and undirected networks.
Conclusion and Outlook
We propose MapSim , a novel information-theoretic approach to compute node similarities based on a modular compression of network ﬂows.
Different from vector space embeddings, MapSim represents nodes in a discrete, non-metric space of communities that yields asymmetric similarities suitable to predict links in directed and undirected networks.
The resulting similarities can be explained based on a network’s modular structure.
Using description length minimisation, MapSim naturally accounts for Occam’s razor, which avoids overﬁtting and yields a parsimonious coding tree.
Addressing unsupervised link prediction, we compare MapSim to popular embedding-based algorithms ondata sets that cover networks from a few hundred to hundreds of thousand nodes and millions of edges.
Our analysis shows that the average performance of MapSim is more than 7% higher than its closest competitor, outperforming all competing methods in 11 of the 47 networks.
Taking a new perspective on graph representation learning, our work demonstrates the potential of compression-based methods, with promising applications in other graph learning tasks.
Moreover, recent generalisations of the map equation to temporal and higher-order networks [49] suggest that our method can be applied to graphs with non-dyadic or time-stamped relationships.
Acknowledgements
This work was partially supported by the Wallenberg AI, Autonomous Systems and Software Program (WASP) funded by the Knut and Alice Wallenberg Foundation.
Ingo Scholtes acknowledges ﬁnancial support from the Swiss National Science Foundation through grant No. 176938.
Martin Rosvall was supported by the Swedish Research Council, Grant No. 2016-
A Appendix
[Table]
,0.051 arxiv-citation-HepTh [65] 27 ,352 ,0.
digg-reply W [66] 30 ,∗ 87 ,0.002 linux [48] 30 ,213 ,0.002 arxiv-citation-HepPh [65] 34 ,421 ,0.003 email-enron [67] 36 ,367 ,1.000 inploid [68] 39 ,57 ,0.272 pgp-strong [69] 39 ,301 ,0.
facebook-wall W [70] 46 ,∗ 876 ,0.
slashdot-threads W [71] 51 ,∗ 140 ,0.210 python-dependency [72] 58 ,108 ,0.
lkml-reply W [48] 63 ,∗ 1 , 096 ,0.635 epinions-trust [73] 75 ,508 ,0.405 prosper [48] 89 ,3 , 394 ,< 0 .google-plus [74] 211 ,1 , 506 ,0.
twitter-higgs-retweet W [75] 256 ,328 ,0.005 amazon-copurchases-
[76] 262 ,1 , 234 ,0.543 notre-dame-web [77] 325 ,1 , 497 ,0.507 twitter-followers [78] 465 ,834 ,0.
[Table] [Table]
[Table] [Table]