Next Article in Journal
Assessment of the Structural State of Dissimilar Welded Joints by the Acoustic Emission Method
Next Article in Special Issue
Generalized Sketches for Streaming Sets
Previous Article in Journal
Fishmeal Replacement with Animal Protein Source (Crocodylus niloticus Meat Meal) in Diets of Mozambique Tilapia (Oreochromis mossambicus) of Different Size Groups
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Mosar: Efficiently Characterizing Both Frequent and Rare Motifs in Large Graphs

1
State Key Laboratory for Manufacturing Systems Engineering, Xi’an Jiaotong University, Xi’an 710049, China
2
School of Computer Science and Technology, Xi’an Jiaotong University, Xi’an 710049, China
3
MOE Key Laboratory for Intelligent Networks and Network Security, Xi’an Jiaotong University, Xi’an 710049, China
*
Authors to whom correspondence should be addressed.
Appl. Sci. 2022, 12(14), 7210; https://doi.org/10.3390/app12147210
Submission received: 1 June 2022 / Revised: 30 June 2022 / Accepted: 4 July 2022 / Published: 18 July 2022

Abstract

:
Due to high computational costs, exploring motif statistics (such as motif frequencies) of a large graph can be challenging. This is useful for understanding complex networks such as social and biological networks. To address this challenge, many methods explore approximate algorithms using edge/path sampling techniques. However, state-of-the-art methods usually over-sample frequent motifs and under-sample rare motifs, and thus they fail in many real applications such as anomaly detection (i.e., finding rare patterns). Furthermore, it is not feasible to apply existing weighted sampling methods such as stratified sampling to solve this problem, because it is difficult to sample subgraphs from a large graph in a direct manner. In this paper, we observe that rare motifs of most real-world networks have “more edges” than frequent motifs, and motifs with more edges are sampled by random edge sampling with higher probabilities. Based on these two observations, we propose a novel motif sampling method, Mosar, to estimate motif frequencies. In particular, our Mosar method samples frequent and rare motifs with different probabilities, and tends to sample motifs with low frequencies. As a result, the new method greatly reduces the estimation errors of these rare motifs. Finally, we conducted extensive experiments on a variety of real-world datasets with different sizes, and our experimental results show that the Mosar method is two orders of magnitude more accurate than state-of-the-art methods.

1. Introduction

Recently, exploring small connected subgraph patterns (i.e., motifs) in networks has attracted more and more attention in both academia and industry. These patterns have been widely used in various applications such as evolutionary pattern characterization in online social networks [1,2,3,4], pattern recognition in gene expression profiling [5], interaction prediction in protein–protein networks [6], and coarse-grained topology generation [7]. For example, Kunegis et al. [2] studied the significance of subgraph patterns such as “the enemy of my enemy is my friend” and “the friend of my friend is my friend” to evaluate the stability of “friend or foe” social networks such as Slashdot Zoo (www.slashdot.org, accessed on 6 March 2022). Refs. [8,9] explored network traffic activity graphs (TAGs) and observed that TAGs of different applications (e.g., FTP, Web, and P2P) exhibited different motif patterns.
Motif frequency and concentration are two popular statistics studied in many applications. Suppose that there exist Nk-node connected and induced subgraphs (CISes) in G and there exist n CIS which are isomorphic to a motif M. Then, the motif frequency and concentration of M is defined as n and n / N , respectively. The huge number of these subgraphs poses a great challenge for computing these two statistics. For instance, in two medium-sized networks, Slashdot [10] and Epinions [11], with only 1.0 × 10 5 nodes and 1.0 × 10 6 edges [12], there exist more than 2.0 × 10 10 four-node CIS. Furthermore, because the number of k-node CIS generally increases exponentially with k, the number of five-node CIS is higher in both of these graphs. To solve this problem, many existing works [12,13,14,15,16] have explored approximate algorithms to estimate these statistics, making a trade-off between accuracy and computational time. These methods perform node sampling, edge sampling, or path sampling on the original graph and use the sampled graph to inference the statistics of all subgraphs in the original graph. The above sampling schemes usually prefer frequent motifs and under-sample rare ones (i.e., motifs with low frequencies). Among them, both [16] and our method can estimate motif frequencies, although our method is mainly biased towards rare motifs, and the algorithms of the two are different. As a result, these methods exhibit large errors for estimating rare motifs’ statistics, and fail in many real applications such as anomaly detection (i.e., finding rare or unusual patterns) [17,18] and community search (i.e., finding the densest subgraphs and cliques) [19,20].
A potential way to solve the above problem is stratified sampling with the proportionate allocation strategy [21], the basic idea of which can be simply described as follows. For a motif M with frequency n (i.e., G has n CIS isomorphic to M), we suppose that each of its CISe (i.e., CIS in G isomorphic to M) is independently sampled with the same probability γ . Then, we estimate the motif frequency n as n ^ = m γ , where m is the number of sampled CIS for which the original CIS are isomorphic to M. We can easily find that the variance of n ^ is n ( 1 γ 1 ) , which implies that we can reduce the estimation error by increasing γ . With a fixed sampling budget, we can reduce the total estimation errors of characterizing all motifs by assigning larger probabilities to motifs with lower frequencies. However, it is not feasible to directly sample CIS in a graph with pre-defined probability γ , which hinders us from performing stratified sampling.
To address the above challenge, in this paper we propose a novel method called Mosar, (Motif Sampling and Retrieving), to estimate all motif frequencies. Mosar first obtains a sampled graph G * from the graph G under study using random edge sampling, i.e., each and every edge in G is sampled with the same probability p. In our experiments, we observe that motifs with more edges usually have lower frequencies for many real-world graphs. Moreover, the probability of a k-node CIS s in G also appearing as a k-node CIS in G * increases with the number of edges in s, where k is the size of motifs under study. For example, an unclosed wedge and a triangle in G are observed in G * with probabilities p 2 and 3 p 2 2 p 3 , respectively (note that 3 p 2 2 p 3 3 p 2 when p < 0.1 ). Thus, Mosar can be simply viewed as a novel weighted motif sampling method, and it tends to sample rare motifs. Clearly, G * may exhibit different motif statistics from G due to two kinds of uncertainties: (1) CIS in G * and their original CIS in G may be different; and (2) CIS are not sampled uniformly. For example, Figure 1 shows that a sample graph G * has three-node directed motif concentrations which differ greatly from G; the Flickr graph [22] is used as G and G * is obtained by randomly sampling each edge of G with the same probability 0.05. To remove the error introduced by these two uncertainties, Mosar retrieves the original CIS of all k-node CIS in G * and then builds a probabilistic model to “re-weight" sampled CIS to compute motif statistics. Our experiments on a variety of public datasets show that our method is two orders of magnitude more accurate state-of-the-art methods.
The rest of this paper is organized as follows. The problem formulation is presented in Section 3. Section 4 presents our motif sampling method, Mosar, and the corresponding methods of estimating motif frequencies and concentrations. The performance evaluation and testing results are presented in Section 5. Section 2 summarizes related work, and concluding remarks follow.

2. Related Work

There is an immense body of literature on the characterization of three-, four-, and five-node CIS in a single large graph. However, many of these works focus on the triangle counting problem [23,24,25,26,27,28,29] and cannot be easily extended to count other CIS.
In this section, we briefly review practical algorithms that approximately count all three-, four-, and five-node CIS in a large static graph. While Alon et al. [30] proposed a color-coding method to reduce the computational cost of counting subgraphs, it is not scalable to large graphs [31]. OmidiGenes et al. [32] proposed a subgraph enumeration and counting method using edge sampling. However, this method suffers from unknown sampling bias. To estimate subgraph class concentrations, Kashtan et al. [13] proposed a connected subgraph sampling method, however, their method is computationally expensive when calculating the weight of each sampled subgraph used for correcting bias introduced by sampling. To address this drawback, FANMOD [14] samples subgraphs based on building a subgraph enumeration tree, which requires that the graph is fitted into memory. Recently, Paredes and Ribeiro [33] have proposed RAND-FaSE to estimate the frequency of all CIS with an efficient tree data structure, where the leaves are the subgraph occurrences. Wang et al. [16] built a transition probability matrix between the motif statistics in the original and sampled graph. With the motif statistics in sampled graph, they provide an unbiased estimator for all three-, four-, and five-node CIS. Marco et al. [34] presented a general algorithm using colour coding to approximately count motifs beyond five nodes. Ryan et al. [35] developed an unbiased graphlet estimation framework by sampling edges and their local neighbourhood. The new Motivo algorithm proposed in [36] scales well to larger graphs while providing more accurate counts of motifs than ever before, both for most frequent motifs and for extremely rare motifs. The general framework proposed in [37], called HONE, is used to learn such structural node embeddings from networks through subgraph patterns in node neighborhoods. The Random Walks in [38] have been used as the basis for many proximity-based community detection methods. These methods are similar to theh random edge sampling in the first step of our Mosar method, although with many differences in its implementation. In addition, Refs. [12,15,39,40,41,42] proposed sampling methods to estimate online social networks’ motif concentrations when the graph’s topology is not available in advance and it is costly to crawl the entire topology. However, the above methods under-sample rare motifs, and thus exhibit large errors for characterizing such motifs.

3. Problem Formulation

In this section, we introduce motif statistics. For readability, the notations used throughout the paper are listed in Table 1. We denote the graph of interest as a labeled undirected graph G = ( V , E , L ) , where V is the set of nodes, E is a set of undirected edges, and L is a set of labels l u , v associated with undirected edges ( u , v ) E . For example: (1) directed networks use labels l u , v { , , } to indicate the direction of the edges ( u , v ) E ; (2) l u , v { + , } for edges in signed networks having positive or negative labels; (3) a regular undirected graph can be represented by setting L to null.
To formally define the motif frequency of G, first, we introduce a few notations. An induced subgraph of G, G = ( V , E , L ) , is a subgraph with its edges and associated labels all in G, i.e.,  V V , E = { ( u , v ) : u , v V , ( u , v ) E } , L = { l u , v : ( u , v ) E } . Denote C ( k ) as the set of all CIS with k nodes in G, and n ( k ) = | C ( k ) | . We provide a simple example in Figure 2, where n ( 3 ) = 3 . We partition C ( k ) into T k equivalence classes C 1 ( k ) , , C T k ( k ) without overlapping where CIS within each C i ( k ) are isomorphic. Next, we present several examples to illustrate our notations. Figure 3a reveals all three-node motifs of unlabeled undirected networks. When G is an unlabeled and undirected network, then the number of three-node motifs is T 3 = 2 , and C 1 ( 3 ) and C 2 ( 3 ) are the sets of CIS in G isomorphic to the first and second motifs in Figure 3a, respectively. Figure 3b reveals all three-node motifs when G is any signed network; in this case, T 3 = 7 . Figure 3c reveals all motifs with three nodes for any directed network; in such a case, T 3 = 13 . Figure 3d reveals all four-node motifs of any unlabeled and undirected network; in this case, T 4 = 6 . Figure 3e shows all five-node motifs of any unlabeled and undirected network; in this case, T 5 = 21 . Throughout the paper, C i ( k ) is defined as the set of CIS in G that are isomorphic to the i-th k-node motif M i ( k ) . Define the frequency of motif M i ( k ) as n i ( k ) = | C i ( k ) | , i.e., the number of CIS in C i ( k ) . For example, C 1 ( 3 ) includes two CIS for the directed graph G in Figure 2: (1) the CIS made up of a, b, and d, and (2) the CIS made up of a, c, and d. Thus, n 1 ( 3 ) = 2 . In this paper, we focus on designing fast and accurate sampling methods to reduce the time needed to count motif frequencies.

4. Motif Sampling and Retrieving

In this section, we start by introducing our Mosar method for motif sampling. After that, we present a probabilistic model to analyze its sampling bias. On the basis of this model, we put forward a method to correct the sampling error for estimating motif frequencies. Finally, we provide lower error bounds for our estimates.

4.1. Sampling Motifs over G

Figure 4 shows an overview of Mosar. Mosar first generates a subgraph G * = ( V * , E * , L * ) of G = ( V , E , L ) by iterating each edge and sampling it with the same probability p. We assume that G * can be fitted into memory, which can be easily achieved using a small p. Then, Mosar uses existing CIS enumeration methods such as [16] to enumerate all k-node CIS of G * . For a graph s, let V ( s ) and E ( s ) denote the set of nodes and edges contained in s. For a k-node CIS s * of G * , let s be its original k-node CIS, which is defined as the k-node CIS of G with the same nodes in s * , i.e.,  V ( s ) = V ( s * ) . We can easily find that s * can be quite different from s. To eliminate the estimation error introduced by this uncertainty, when traversing s * , we combine the edge information of the original graph G to retrieve the s of the original graph. Formally, we let C ( k , * ) denote all k-node CIS of G * . Finally, we obtain all pairs of CIS s * C ( k , * ) and their original CIS, s C ( k ) , i.e.,
S G * , G ( k ) = { ( s * , s ) : s * C ( k , * ) , s C ( k ) , V ( s * ) = V ( s ) } .
The pseudocode of Mosar is shown in Algorithm 1.
Algorithm 1: The pseudocode of Mosar.
Applsci 12 07210 i001

4.2. Probabilistic Model of Mosar

We build a probabilistic model of pairs ( s * , s ) S G * , G ( k ) , which is similar to the model in [16]. Define P i , j as the probability that s * is isomorphic to motif M i ( k ) given that s is isomorphic to motif M j ( k ) , i.e.,
P i , j = P ( M ( s * ) = M i ( k ) | M ( s ) = M j ( k ) ) .
To obtain P i , j , first of all, we compute ϕ i , j , which is defined as the quantity of subgraphs of M j ( k ) isomorphic to M i ( k ) . For instance, M 2 ( 3 ) , i.e., the triangle, includes three subgraphs isomorphic to M 1 ( 3 ) , i.e., the unclosed wedge for the undirected graph in Figure 3a. Thus, we have ϕ 1 , 2 = 3 for three-node undirected motifs. When i = j , we let ϕ i , j = 1 . For four- and five-node motifs, it is no easy thing to acquire ϕ i , j manually; we use the method in [16] to compute ϕ i , j . Let q = 1 p ; then, we have
P i , j = ϕ i , j p | E ( M i ( k ) ) | q | E ( M j ( k ) ) | | E ( M i ( k ) ) | .
For example, we have P 1 , 2 = 3 p 2 q and P 2 , 2 = p 3 for the undirected three-node motifs in Figure 3a.

4.3. Motif Frequency Estimation

Using the probabilistic model above, we put forward a method a method to estimate motif frequencies. The pseudocode for motif frequency estimation is shown in Algorithm 2.  
Algorithm 2: The pseudocode for Motif Frequency Estimation.
Applsci 12 07210 i002
Define m i , j ( k ) , 1 i T k , as the number of pairs ( s * , s ) S G * , G ( k ) , where s * is isomorphic to motif M i ( k ) and s is isomorphic to motif M j ( k ) . Then, the expectation of m i , j ( k ) is computed as
E [ m i , j ( k ) ] = P i , j n j ( k ) .
When P i , j > 0 , we have the following estimator of n j ( k ) :
n ^ j ( k , i ) = m i , j ( k ) P i , j .
Denote Z j = { i : i = 1 , , T k , and P i , j > 0 } . Thus, we have | Z j | estimators of n j ( k ) , i.e., n ^ j ( k , i ) , i Z j . Let s 1 and s 2 be two k-node CIS in G isomorphic to the j-th k-node motif. Denote s 1 * and s 2 * as the induced subgraphs of node sets V ( s 1 ) and V ( s 2 ) in G * , respectively. Define π i , j ( s 1 , s 2 ) as the probability that s 1 * and s 2 * are both isomorphic to the i-th k-node motif. We can easily find that π i , j ( s 1 , s 2 ) = P i , j 2 when s 1 and s 2 have no common edges (i.e., E ( s 2 ) E ( s 1 ) ), and π i , j ( s 1 , s 2 ) > P i , j 2 otherwise. For example, as shown in Figure 5, we have π 1 , 2 ( s 1 , s 2 ) = p 4 q + 4 p 3 q 2 and π 2 , 2 ( s 1 , s 2 ) = p 5 for the undirected three-node motifs in Figure 3a. Then, we have the following theorem.
Theorem 1.
For each i Z j , n ^ j ( k , i ) is an unbiased estimator of n j ( k ) , i.e.,
E ( n ^ j ( k , i ) ) = n j ( k ) ,
and the variance of n ^ j ( k , i ) is
Var ( n ^ j ( k , i ) ) = 1 P i , j n j ( k ) ( 1 P i , j ) + 1 P i , j 2 s 1 , s 2 C j ( k ) , s 1 s 2 , E ( s 1 ) E ( s 2 ) ( π i , j ( s 1 , s 2 ) P i , j 2 ) .
Proof. 
From (4), we have
E ( n ^ j ( k , i ) ) = E ( m i , j ( k ) ) P i , j = n j ( k , i ) .
Place 1 ( X ) to indicate a signal function that the predicate X is true and equal to one, and zero otherwise. Define function
δ ( s ) = 1 ( s * , ( s * , s ) S G * , G ( k ) ) .
Then we can write n ^ j ( k , i ) as
n ^ j ( k , i ) = 1 P i , j s C j ( k ) δ ( s )
Thus, Var ( n ^ j ( k , i ) ) is computed as
Var ( n ^ j ( k , i ) ) = 1 P i , j 2 Var ( s C j ( k ) δ ( s ) ) = 1 P i , j 2 s 1 C j ( k ) s 2 C j ( k ) Cov ( δ ( s 1 ) , δ ( s 2 ) ) = 1 P i , j 2 s 1 C j ( k ) s 2 C j ( k ) π i , j ( s 1 , s 2 ) P i , j 2 .
Finally, we have
Var ( n ^ j ( k , i ) ) = 1 P i , j n j ( k ) ( 1 P i , j ) + 1 P i , j 2 s 1 , s 2 C j ( k ) , s 1 s 2 , E ( s 1 ) E ( s 2 ) ( π i , j ( s 1 , s 2 ) P i , j 2 ) .
In the derivation above, we use π i , j ( s 1 , s 2 ) = P i , j when s 1 = s 2 , and π i , j ( s 1 , s 2 ) = P i , j 2 when s 1 and s 2 have no common edges. □
Example: For the undirected three-node motifs in Figure 3a, n ^ 2 ( 3 , 1 ) and n ^ 2 ( 3 , 2 ) are two estimators of n 2 ( 3 ) , i.e., the number of triangles in G. Note that n ^ 2 ( 3 , 2 ) is the same estimator of n 2 ( 3 ) in [23]. Let Γ be the number of pairs of triangles that are not edge disjoint. Then, we have
Var ( n ^ 2 ( 3 , 1 ) ) = n 2 ( 3 ) ( 3 p 2 q 9 p 4 q 2 ) + 2 Γ ( p 4 q + 4 p 3 q 2 9 p 4 q 2 ) 9 p 4 q 2 .
and
Var ( n ^ 2 ( 3 , 2 ) ) = n 2 ( 3 ) ( p 3 p 6 ) + 2 Γ ( p 5 p 6 ) p 6 .
We can easily find that Var ( n ^ 2 ( 3 , 1 ) ) is smaller than Var ( n ^ 2 ( 3 , 2 ) ) when p < 5 6 . When p 1 and n 2 ( 3 ) p Γ , we have Var ( n ^ 2 ( 3 , 1 ) ) n 2 ( 3 ) 3 p 2 and Var ( n ^ 2 ( 3 , 2 ) ) n 2 ( 3 ) p 3 ; therefore, n ^ 2 ( 3 , 1 ) is 3 p times more accurate than n ^ 2 ( 3 , 2 ) .
Finally, we estimate n j ( k ) using the following mix estimator:
n ^ j ( k ) = i Z j α i , j n ^ j ( k , i ) ,
where parameters 0 α i , j 1 , and i Z j α i , j = 1 . α i , j is used to determine the relative importance of n ^ j ( k , i ) . Suppose that all n ^ j ( k , i ) are independent. Then, the variance of n ^ j ( k ) is
Var ( n ^ j ( k ) ) = i Z j α i , j 2 Var ( n ^ j ( k , i ) ) .
Next, we compute optimal α i , j to minimize Var ( n ^ j ( k ) ) . Define Lagrange function ψ as
ψ = i Z j α i , j 2 Var ( n ^ j ( k , i ) ) + λ ( i Z j α i , j 1 ) .
The derivatives of ψ with respect to α i , j and λ are
ψ α i , j = 2 α i , j Var ( n ^ j ( k , i ) ) + λ , i Z j ,
and
ψ λ = i Z j α i , j 1 .
To obtain a n ^ j ( k ) with the smallest error, we solve the equations ψ λ = 0 , and ψ λ = 0 , i Z j , and have
α i , j = Var 1 ( n ^ j ( k , i ) ) l Z j Var 1 ( n ^ j ( k , l ) ) , i Z j .
When it is difficult to compute Var ( n ^ j ( k , i ) ) exactly, we approximate Var ( n ^ j ( k , i ) ) n j ( k ) ( 1 P i , j ) P i , j 1 and then set parameters α i , j as
α i , j = P i , j ( 1 P i , j ) 1 l Z j P l , j ( 1 P l , j ) 1 , i Z j .

4.4. Discussion

Compared to the online methods of analyzing streaming graphs in [16,43] (i.e., the graph of interest is given as a stream of edges and each edge can be accessed and processed only once), Mosar needs to pass over the graph file of interest twice, with the additional pass performed to remove uncertainty introduced by sampling. However, we observe that passing over the graph requires much less time than enumerating and classifying subgraphs even for a small sampling probability p. For example, in our experiments we observed that the computational time needed for passing over the graph file of interest on disk was no more than 7% of the time needed to enumerate and classify CIS in the sampled graph when p = 0.01 . Thus, to sample the same number of CIS, Mosar requires effectively the same computational time as the methods in [16,43].

5. Data Evaluation

In this section, in the first place, we introduce our experimental datasets. In the second place we present experimental results to evaluate the performance of our Mosar method compared to the most advanced methods. Our experiments were conducted on a server with a Quad-Core AMD Opeteron (tm) 8379 HE CPU 2.39 GHz processor and 128 GB DRAM memory.

5.1. Datasets

We performed our experiments on the following available datasets in public summarized in Table 2.
  • Online social networks: Flickr [22], Pokec [44], LiveJournal [44], YouTube [22], soc-Epinions1 [11], and soc-Slash-dot08 [10]. Flickr, LiveJournal, and YouTube are popular photo, blog, and video sharing websites, respectively, where a user can subscribe to other user updates such as photos, blogs, and videos. Pokec is the most popular online social network in Slovakia, and has been in existence for more than ten years. These networks can be represented by directed graphs, where nodes represent users and a directed edge from node u to node v indicates that user u subscribes to user v or user u tags user v as a friend. Soc-Epinions1 [11] is a directed graph of the Epinions website in 2003, where a directed edge from node u to node v indicates that user u trusts user v. Soc-Slashdot08 and Soc-Slashdot09 [10] are graphs of the technology-related news website Slashdot released in 2008 and 2009, respectively, where the edge between node u and node v means that user u has marked user v as a friend.
  • Web graph: Web-Google [46]. The Web-Google dataset was released in 2002 by Google as a part of a Google Programming Contest; nodes represent web pages and directed edges represent hyperlinks between them.
  • Signed networks: sign-Epinions, sign-Slashdot08, and sign-Slashdot09 [47]. Epinions and Slashdot networks can be represented by a signed graph, where a positive edge from user u to user v means that u trusts v in the Epinions website or u marks v as a friend on the Slashdot website. A negative edge from u to v means a distrust relationship on the Slashdot website or that u tags user v as a foe on the Epinions website.
  • Collaboration networks: ca-HepTh [50], ca-GrQc [50], and ca-CondMat [50]. arXiv is an online repository of electronic preprints of scientific papers in many fields, such as mathematics, physics, and computer science. The datasets ca-GR-QC, ca-HEP-TH, and ca-CondMat consist of arXiv e-prints and cover scientific collaborations between authors of papers submitted to the General Relativity and Quantum Cosmology category, the High-Energy Physics—Theory category, and the Condensed Matter category, respectively [50]. These networks can all be represented by undirected graphs. If author u co-authored a paper with author v, the graph contains an undirected edge from u to v.
  • Peer-to-peer network: p2p-Gnutella08 [49]. Gnutella is a peer-to-peer file sharing network. Nodes in the p2p-Gnutella08 dataset represent users in the Gnutella network and edges represent connections between Gnutella users.
  • Communication network: Wiki-Talk [45]. Wikipedia is a free encyclopedia written collaboratively by volunteers around the world. Each registered user has a talk page that she/he and other users can edit in order to communicate and discuss updates to various articles on Wikipedia. Nodes in the Wiki-Talk dataset represent registered users on Wikipedia and a directed edge from node u to node v indicates that user u at least once edited a talk page of user v.
  • Product network: com-Amazon [48]. The dataset was collected by crawling the Amazon website based on the Amazon website’s “Customers Who Bought This Item Also Bought” feature. If a product u is frequently co-purchased with product v, the graph contains an undirected edge from u to v.

5.2. Error Metric

Similar to [16], in our experiments we studied the normalized root mean square error (NRMSE) to measure the relative error of the motif frequency estimate n ^ i with respect to its true value n i , i = 1 , 2 , . NRMSE ( n ^ i ) is defined as:
NRMSE ( n ^ i ) = MSE ( n ^ i ) n i , i = 1 , 2 , ,
where MSE ( n ^ i ) is defined as
MSE ( n ^ i ) = E [ ( n ^ i n i ) 2 ] = var ( n ^ i ) + E [ n ^ i ] n i 2 .
We can find out that the MSE ( n ^ i ) decomposes into the sum of the variance and bias of the estimator n ^ i , both of which are important and must be as small as possible to achieve better estimation performance. When n ^ i is an unbiased estimator of n i , then MSE ( n ^ ) = var ( n ^ ) , as a consequence, NRMSE ( n ^ i ) is the equivalent of the normalized standard error of n ^ i , which is NRMSE ( n ^ i ) = var ( n ^ i ) / n i . Please note that our metrics use relative error, and thus we reckon values as large as NRMSE ( n ^ i ) = 1 to be acceptable when n i is small. In our experiments, we average the estimates and calculate their NRMSEs over 100 runs.

5.3. Accuracy Results

Above all, we evaluated the performance of our method in estimating the motif frequencies of three-node on graphs with millions of nodes (Flickr, Pokec, LiveJournal, YouTube, Web-Google, and Wiki-talk) while comparing our results with the basic truth calculated via brute force methods. Calculating the ground truth of four-node and five-node motif frequencies for large graphs is computationally intensive. Even for a relatively small graph such as soc-Slashdot08, enumerating and counting all of its three-node CIS takes almost 20 h. To overcome this difficulty, experiments with four-node CISes were performed on four medium-size graphs (soc-Epinions1, soc-Slashdot08, soc-Slashdot09, com-DBLP and com-Amazon), and experiments with five-node CIS were performed on four relatively small graphs (ca-GR-QC, ca-HEP-TH, ca-CondMat and p2p-Gnutella08) where the ground-truth could be calculated. We specifically evaluated the performance of our method in estimating the motif frequencies of signed graphs such as sign-Epinions, sign-Slashdot08 and sign-Slashdot09.

5.3.1. Values of Three-, Four-, and Five-Node Motif Frequencies

Figure 6 and Table 3 show the real values of the three-, four-, and five-node motif frequencies of the graphs studied in this paper. Table 3 and Figure 6a show the real values of three-node directed motif frequencies for the undirected and directed graphs of Flickr, Pokec, LiveJournal, Wiki-Talk, and Web-Google, respectively. Here, undirected graphs are obtained by discarding the edge directions of directed graphs. Among all three-node directed motifs, the seventh motif exhibits the smallest frequency for all these directed graphs. Flickr, Pokec, LiveJournal, Wiki-Talk, and Web-Google have 1.35 × 10 10 , 2.02 × 10 9 , 6.90 × 10 9 , 1.2 × 10 10 , and 7.00 × 10 8 three-node CIS, respectively. Figure 6b reveals the actual values of the three-node signed motif frequencies for the graphs Sign-Epinions, sign-Slashdot08, and sign-Slashdot09. Sign-Epinions, sign-Slashdot08, and sign-Slashdot09 have 1.72 × 10 8 , 6.72 × 10 7 , and 7.25 × 10 7 three-node CIS, respectively. Figure 6c reveals the actual values of four-node undirected motif frequencies for the graphs soc-Epinions1, soc-Slashdot08, soc-Slashdot09, and com-Amazon. Graphs soc-Epinions1, soc-Slashdot08, soc-Slashdot09, and com-Amazon have 2.58 × 10 10 , 2.17 × 10 10 , 2.42 × 10 10 , and 1.78 × 10 8 four-node CIS, respectively. Figure 6d reveals the actual values of five-node undirected motif frequencies for com-Amazon, com-DBLP, p2p-Gnutella08, ca-GrQc, ca-CondMat, and ca-HepTh. Com-Amazon, com-DBLP, p2p-Gnutella08, ca-GrQc, ca-CondMat, and ca-HepTh have 8.50 × 10 9 , 3.34 × 10 10 , 3.92 × 10 8 , 3.64 × 10 7 , 3.32 × 10 9 , and 8.73 × 10 7 five-node CIS, respectively.

5.3.2. Estimating Three-Node Motif Frequencies

Table 4 reveals our estimated NRMSEs of three-node undirected motif frequencies at p = 0.01 and p = 0.05 , respectively, using graphs fpr Flickr, Pokec, LiveJournal, Wiki-Talk and Web-Google. The triangular motif structure with i d = 2 in the undirected motif in Table 4 is more rare, thus, the result with i d = 2 is better compared with [16]. We can see that the NRMSE for p = 0.05 is about ten times less than the NRMSE for p = 0.01 . When p = 0.01 for all these five graphs, the NRMSEs are less than 0.05 . Figure 7 reveals our estimated NRMSEs for three-node directed motif frequencies at p = 0.01 and p = 0.05 . Likewise, we observe that NRMSE at p = 0.05 is almost ten times less than NRMSE at p = 0.01 . The NRMSE of our estimates of n 7 ( 3 ) (i.e., the seventh three-node directed motif frequency) exhibits the largest error. Except n 7 ( 3 ) , the NRMSEs of the other motif frequency estimates are smaller than 0.01 when p = 0.05 . Figure 8 reveals our estimated NRMSEs for three-node signed and undirected motif frequencies for p = 0.01 , p = 0.05 , and p = 0.1 using the graphs Sign-Epinions, sign-Slashdot08, and sign-Slashdot09. For all three signed graphs, the NRMSEs are less than 0.5, 0.1, and 0.06 for p = 0.01 , p = 0.05 , and p = 0.1 .

5.3.3. Estimating Four-Node Motif Frequencies

Figure 9 reveals the NRMSEs of n ^ i ( 4 ) , frequency estimates of four-node undirected motifs for p = 0.05 , p = 0.1 , and p = 0.2 , respectively, using the graphs soc-Epinions1, soc-Slashdot08, soc-Slashdot09, and com-Amazon. We can see that the NRMSEs of the other motif frequency estimates are smaller than 0.2, 0.1, and 0.07 for p = 0.05 , p = 0.1 , and p = 0.2 , respectively.

5.3.4. Estimating Five-Node Motif Frequencies

Figure 10 shows the NRMSEs of n ^ i ( 5 ) , the estimates of five-node undirected motif frequencies for p = 0.1 , p = 0.2 , and p = 0.3 , respectively. The experiment was conducted on the graphs com-Amazon, com-DBLP, p2p-Gnutella08, ca-GrQc, ca-CondMat, and ca-HepTh. We can see that most five-node undirected motifs of all graphs except ca-GrQc have NRMSEs smaller than 1 and 0.1 for p = 0.05 and p = 0.1 , respectively. For instance, the largest three graphs, com-Amazon, com-DBLP, and ca-CondMat, exhibit smaller errors than the other graphs, while the smallest graph, ca-GrQc, has a larger NRMSE.

5.4. Comparison to Previous Work

5.4.1. Motif Concentration Estimation

Figure 11a–c show the results of our methods for estimating three-, four-, and five-node motif concentrations in comparison with the state-of-the-art methods FANMOD [14], PSRW [12], and Minfer [16] with the same computational time. We set the same edge sampling probability for Mosar and Minfer. We observed that these two methods have almost the same runtime. This is because Mosar and Minfer spend much less time reading the graph files than enumerating and classifying the subgraphs. For example, the computational time needed to pass over the graph file of interest on disk was 3.8%, 6%, 7%, 5%, and 1.9% of the time required to enumerate and classify subgraphs in the sampled graph for Flickr, livejournal, Pokec, Web-Google, and Wiki-Talk, respectively, when using Mosar and Minfer to estimate three-node directed motif frequencies and set p = 0.01 . Figure 11 shows that Mosar exhibits almost one order fewer errors than the other methods for estimating concentrations of three- and four-node rare motifs, and two orders fewer errors than Minfer for estimating concentrations of five-node rare motifs.

5.4.2. Triangle Counting

We compared the performance of our method for estimating the number of triangles with the state-of-the-art method gSH T [43]. To compare Mosar and gSH T under the same computational cost, we set the parameters of gSH T as gSH T ( p , p ) . As alluded to, the runtime of Mosar is then almost same as gSH T ( p , p ) , and the probabilities of observing a triangle (sampled as a closed or unclosed wedge) are p T 3 p 2 q and p T p 2 for Mosar and gSH T , respectively. Let n T be the number of triangles and n ^ T be an estimate of n T ; then, the variance of n ^ T is nearly n T p T . Thus, the variance of Mosar is up to three times larger than gSH T . This is consistent with the results shown in Figure 12, where p = 0.01 . We can see that the NRMSE of Mosar is nearly 1.7 times smaller than gSH T .

6. Conclusions

In this paper, we develop a weighted motif sampling method, Mosar, to accurately estimate the frequency of both frequent and rare motifs. Mosar first obtains a sampled graph G * and then enumerates all CIS in G * . To reduce the estimate errors, Mosar samples those rare motifs with higher probabilities. We build a probabilistic model of the CIS in both G * and G, then use this to drive a motif frequency estimation method with a theoretical guarantee. Finally, we performed experiments on various publicly availably datasets to evaluate the performance of our Mosar method. Our experimental results show that Mosar is over two orders of magnitude more accurate than the current state-of-the-art algorithms. In the future, we plan to extend our method to dynamic graphs with edge insertions and deletions.

Author Contributions

Conceptualization, W.F. and Y.Q.; methodology, W.F. and Y.Q.; software, W.F. and Y.Q.; validation, Y.Q.; formal analysis, W.F. and Y.Q.; investigation, W.F. and Y.Q.; resources, P.W. and J.T.; data curation, Y.Q.; writing—original draft preparation, W.F.; writing—review and editing, W.G., Y.Q., P.W. and J.T.; visualization, W.F.; supervision, W.G., P.W. and J.T.; project administration, W.G.; funding acquisition, W.G. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by National Key R&D Program of China (2021YFB1715600).

Data Availability Statement

Publicly available datasets were analyzed in this study. This data can be found here: [http://snap.stanford.edu/data/index.html], accessed on 6 March 2022.

Conflicts of Interest

The authors declare that they have no conflict of interest.

References

  1. Chun, H.; Yeol Ahn, Y.; Kwak, H.; Moon, S.; Ho Eom, Y.; Jeong, H. Comparison of Online Social Relations in Terms of Volume vs. Interaction: A Case Study of Cyworld. In Proceedings of the SIGCOMM: Conference on Applications, Technologies, Architectures, and Protocols for Computer Communication, Seattle, WA, USA, 17–22 August 2008; pp. 57–59. [Google Scholar]
  2. Kunegis, J.; Lommatzsch, A.; Bauckhage, C. The slashdot zoo: Mining a social network with negative edges. In Proceedings of the 18th International Conference on World Wide Web, Madrid, Spain, 20–24 April 2009; pp. 741–750. [Google Scholar]
  3. Zhao, J.; Lui, J.C.S.; Towsley, D.; Guan, X.; Zhou, Y. Empirical Analysis of the Evolution of Follower Network: A Case Study on Douban. In Proceedings of the 30th IEEE International Conference on Computer Communications (IEEE INFOCOM 2011), Shanghai, China, 10–15 April 2011; pp. 941–946. [Google Scholar]
  4. Ugander, J.; Backstrom, L.; Kleinberg, J. Subgraph frequencies: Mapping the empirical and extremal geography of large graph collections. In Proceedings of the 22nd International Conference on World Wide Web, New York, NY, USA, 13–17 May 2013; pp. 1307–1318. [Google Scholar]
  5. Shen-Orr, S.S.; Milo, R.; Mangan, S.; Alon, U. Network motifs in the transcriptional regulation network of Escherichia coli. Nat. Genet. 2002, 31, 64–68. [Google Scholar] [CrossRef] [PubMed]
  6. Albert, I.; Albert, R. Conserved network motifs allow protein–protein interaction prediction. Bioinformatics 2004, 4863, 3346–3352. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  7. Itzkovitz, S.; Levitt, R.; Kashtan, N.; Milo, R.; Itzkovitz, M.; Alon, U. Coarse-Graining and Self-Dissimilarity of Complex Networks. Phys. Rev. E 2005, 71, 016127. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  8. Jin, Y.; Sharafuddin, E.; Zhang, Z.L. Unveiling Core Network-wide Communication Patterns through Application Traffic Activity Graph Decomposition. In Proceedings of the Eleventh International Joint Conference on Measurement and Modeling of Computer Systems, Seattle, WA, USA, 15 June 2009; pp. 49–60. [Google Scholar]
  9. Iliofotou, M.; Faloutsos, M.; Mitzenmacher, M. Exploiting Dynamicity in Graph-based Traffic Analysis: Techniques and Applications. In Proceedings of the 5th International Conference on Emerging Networking Experiments and Technologies, Rome, Italy, 1–4 December 2009; pp. 241–252. [Google Scholar]
  10. Leskovec, J.; Lang, K.J.; Dasgupta, A.; Mahoney, M.W. Community Structure in Large Networks: Natural Cluster Sizes and the Absence of Large Well-Defined Clusters. Internet Math. 2009, 6, 29–123. [Google Scholar] [CrossRef] [Green Version]
  11. Richardson, M.; Agrawal, R.; Domingos, P. Trust Management for the Semantic Web. In Proceedings of the 7th International Symposium on Wearable Computers (ISWC 2003), White Plains, NY, USA, 21–23 October 2003; pp. 351–368. [Google Scholar]
  12. Wang, P.; Lui, J.C.; Zhao, J.; Ribeiro, B.; Towsley, D.; Guan, X. Efficiently Estimating Motif Statistics of Large Networks. ACM Trans. Knowl. Discov. Data 2014, 9, 1–27. [Google Scholar] [CrossRef] [Green Version]
  13. Kashtan, N.; Itzkovitz, S.; Milo, R.; Alon, U. Efficient sampling algorithm for estimating subgraph concentrations and detecting network motifs. Bioinformatics 2004, 20, 1746–1758. [Google Scholar] [CrossRef] [Green Version]
  14. Wernicke, S. Efficient Detection of Network Motifs. Trans. Comput. Biol. Bioinform. 2006, 3, 347–359. [Google Scholar] [CrossRef] [Green Version]
  15. Bhuiyan, M.A.; Rahman, M.; Rahman, M.; Hasan, M.A. GUISE: Uniform Sampling of Graphlets for Large Graph Analysis. In Proceedings of the IEEE International Conference on Data Mining, Brussels, Belgium, 10–13 December 2012; pp. 91–100. [Google Scholar]
  16. Wang, P.; Qi, Y.; Lui, J.C.; Towsley, D.; Zhao, J.; Tao, J. Inferring higher-order structure statistics of large networks from sampled edges. Trans. Knowl. Data Eng. 2017, 31, 61–74. [Google Scholar] [CrossRef]
  17. Shin, K.; Eliassi-Rad, T.; Faloutsos, C. Patterns and anomalies in k-cores of real-world graphs with applications. Knowl. Inf. Syst. 2018, 54, 677–710. [Google Scholar] [CrossRef]
  18. Eswaran, D. Mining Anomalies Using Static and Dynamic Graphs. Ph.D. Thesis, Carnegie Mellon University, Pittsburgh, PA, USA, 2020. [Google Scholar]
  19. Yuan, L.; Qin, L.; Zhang, W.; Chang, L.; Yang, J. Index-based densest clique percolation community search in networks. Trans. Knowl. Data Eng. 2017, 30, 922–935. [Google Scholar] [CrossRef]
  20. Fang, Y.; Huang, X.; Qin, L.; Zhang, Y.; Zhang, W.; Cheng, R.; Lin, X. A survey of community search over big graphs. VLDB J. 2020, 29, 353–392. [Google Scholar] [CrossRef] [Green Version]
  21. Sarndal, C.E.S.; Swensson, B.; Wretman, J. Model Assisted Survey Sampling; Springer: New York, NY, USA, 1992. [Google Scholar]
  22. Mislove, A.; Marcon, M.; Gummadi, K.P.; Druschel, P.; Bhattacharjee, B. Measurement and Analysis of Online Social Networks. In Proceedings of the 2007 Conference on Applications, Technologies, Architectures, and Protocols for Computer Communications, Kyoto, Japan, 27–31 August 2007; pp. 29–42. [Google Scholar]
  23. Tsourakakis, C.E.; Kang, U.; Miller, G.L.; Faloutsos, C. Doulion: Counting Triangles in Massive Graphs with a Coin. In Proceedings of the 15th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, Paris, France, 28 June–1 July 2009. [Google Scholar]
  24. Pavany, A.; Tirthapuraz, K.T.S.; Wu, K.L. Counting and Sampling Triangles from a Graph Stream. In Proceedings of the 39th International Conference on Very Large Data Bases 2013, (VLDB 2013), Riva del Garda, Italy, 30 August 2013; pp. 1870–1881. [Google Scholar]
  25. Jha, M.; Seshadhri, C.; Pinar, A. A Space Efficient Streaming Algorithm for Triangle Counting Using the Birthday Paradox. In Proceedings of the 19th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, Chicago, IL, USA, 11–14 August 2013; pp. 589–597. [Google Scholar]
  26. Lim, Y.; Kang, U. Mascot: Memory-efficient and accurate sampling for counting local triangles in graph streams. In Proceedings of the 21st ACM SIGKDD Conference on Knowledge Discovery and Data Mining, Sydney, Australia, 10–13 August 2015; pp. 685–694. [Google Scholar]
  27. Stefani, L.D.; Epasto, A.; Riondato, M.; Upfal, E. Triest: Counting local and global triangles in fully dynamic streams with fixed memory size. Trans. Knowl. Discov. Data 2017, 11, 1–50. [Google Scholar] [CrossRef] [Green Version]
  28. Jung, M.; Lim, Y.; Lee, S.; Kang, U. FURL: Fixed-memory and uncertainty reducing local triangle counting for multigraph streams. Data Min. Knowl. Discov. 2019, 33, 1225–1253. [Google Scholar] [CrossRef]
  29. Shin, K.; Oh, S.; Kim, J.; Hooi, B.; Faloutsos, C. Fast, accurate and provable triangle counting in fully dynamic graph streams. Trans. Knowl. Discov. Data 2020, 14, 1–39. [Google Scholar] [CrossRef] [Green Version]
  30. Alon, N.; Yuster, R.; Zwick, U. Color-coding. J. ACM 1995, 42, 844–856. [Google Scholar] [CrossRef]
  31. Jha, M.; Seshadhri, C.; Pinar, A. Path Sampling: A Fast and Provable Method for Estimating 4-Vertex Subgraph Counts. In Proceedings of the 24th International Conference on World Wide Web, Florence, Italy, 18–22 May 2015; pp. 495–505. [Google Scholar]
  32. Omidi, S.; Schreiber, F.; Masoudi-nejad, A. MODA: An efficient algorithm for network motif discovery in biological networks. Genes Genet Syst. 2009, 84, 385–395. [Google Scholar] [CrossRef] [Green Version]
  33. Paredes, P.; Ribeiro, P. Rand-fase: Fast approximate subgraph census. Soc. Netw. Anal. Min. 2015, 5, 17. [Google Scholar] [CrossRef]
  34. Bressan, M.; Chierichetti, F.; Kumar, R.; Leucci, S.; Panconesi, A. Motif counting beyond five nodes. Trans. Knowl. Discov. Data 2018, 12, 1–25. [Google Scholar] [CrossRef] [Green Version]
  35. Rossi, R.A.; Zhou, R.; Ahmed, N.K. Estimation of graphlet counts in massive networks. Trans. Neural Netw. Learn. Syst. 2018, 30, 44–57. [Google Scholar] [CrossRef]
  36. Bressan, M.; Leucci, S.; Panconesi, A. Motivo: Fast Motif Counting via Succinct Color Coding and Adaptive Sampling. Proc. VLDB Endow. 2019, 12, 1651–1663. [Google Scholar] [CrossRef] [Green Version]
  37. Rossi, R.A.; Ahmed, N.K.; Koh, E.; Kim, S.; Rao, A.; Abbasi-Yadkori, Y. A Structural Graph Representation Learning Framework. In Proceedings of the 13th International Conference on Web Search and Data Mining, Houston, TX, USA, 3–7 February 2020; pp. 483–491. [Google Scholar]
  38. Rossi, R.A.; Jin, D.; Kim, S.; Ahmed, N.K.; Koutra, D.; Lee, J.B. On Proximity and Structural Role-Based Embeddings in Networks: Misconceptions, Techniques, and Applications. ACM Trans. Knowl. Discov. Data 2020, 14, 1–37. [Google Scholar] [CrossRef]
  39. Chen, X.; Li, Y.; Wang, P.; Lui, J.C. A General Framework for Estimating Graphlet Statistics via Random Walk. arXiv 2016, arXiv:1603.07504. [Google Scholar] [CrossRef] [Green Version]
  40. Wang, P.; Zhao, J.; Zhang, X.; Li, Z.; Cheng, J.; Lui, J.C.; Towsley, D.; Tao, J.; Guan, X. MOSS-5: A fast method of approximating counts of 5-node graphlets in large graphs. Trans. Knowl. Data Eng. 2017, 30, 73–86. [Google Scholar] [CrossRef] [Green Version]
  41. Yang, C.; Lyu, M.; Li, Y.; Zhao, Q.; Xu, Y. Ssrw: A scalable algorithm for estimating graphlet statistics based on random walk. In Proceedings of the 23rd International Conference, DASFAA, Gold Coast, QLD, Australia, 21–24 May 2018; pp. 272–288. [Google Scholar]
  42. Paramonov, K.; Shemetov, D.; Sharpnack, J. Estimating graphlet statistics via lifting. In Proceedings of the 25th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, Anchorage, AK, USA, 4–8 August 2019; pp. 587–595. [Google Scholar]
  43. Ahmed, N.; Duffield, N.; Neville, J.; Kompella, R. Graph Sample and Hold: A Framework for Big-Graph Analytics. In Proceedings of the 20th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, New York, NY, USA, 24–27 August 2014. [Google Scholar]
  44. Takac, L.; Zabovsky, M. Data Analysis in Public Social Networks. In Proceedings of the DTI, Omza, Poland, 28–29 May 2012; pp. 1–6. [Google Scholar]
  45. Leskovec, J.; Huttenlocher, D.; Kleinberg, J. Predicting Positive and Negative Links in Online Social Networks. In Proceedings of the 19th International Conference on World Wide Web, Raleigh, NC, USA, 26–30 April 2010; pp. 641–650. [Google Scholar]
  46. Google Programming Contest. 2002. Available online: http://www.google.com/programming-contest/ (accessed on 10 June 2021).
  47. Leskovec, J.; Huttenlocher, D.; Kleinberg, J. Signed Networks in Social Media. In Proceedings of the SIGCHI Conference on Human Factors in Computing Systems, Atlanta, GA, USA, 10–15 April 2010; pp. 1361–1370. [Google Scholar]
  48. Yang, J.; Leskovec, J. Defining and Evaluating Network Communities Based on Ground-Truth. In Proceedings of the PTDM 2012: Practical Theories of Exploratory Data Mining, Brussels, Belgium, 10–13 December 2012; pp. 745–754. [Google Scholar]
  49. Ripeanu, M.; Foster, I.T.; Iamnitchi, A. Mapping the Gnutella Network: Properties of Large-Scale Peer-to-Peer Systems and Implications for System Design. IEEE Internet Comput. J. 2002, 6, 50–57. [Google Scholar]
  50. Leskovec, J.; Kleinberg, J.; Faloutsos, C. Graph Evolution: Densification and Shrinking Diameters. Trans. Knowl. Discov. Data 2007, 1, 2-es. [Google Scholar] [CrossRef]
Figure 1. Motif statistics of the graph G and a sampled graph G * (the numbers are the motif IDs).
Figure 1. Motif statistics of the graph G and a sampled graph G * (the numbers are the motif IDs).
Applsci 12 07210 g001
Figure 2. An example of G and C ( 3 ) .
Figure 2. An example of G and C ( 3 ) .
Applsci 12 07210 g002
Figure 3. All three-node, four-node, and five-node motifs (the numbers are the motif IDs): (a) three-node undirected motifs; (b) three-node signed and undirected motifs; (c) three-node directed motifs; (d) four-node undirected motifs; (e) five-node undirected motifs.
Figure 3. All three-node, four-node, and five-node motifs (the numbers are the motif IDs): (a) three-node undirected motifs; (b) three-node signed and undirected motifs; (c) three-node directed motifs; (d) four-node undirected motifs; (e) five-node undirected motifs.
Applsci 12 07210 g003
Figure 4. Overview of Mosar.
Figure 4. Overview of Mosar.
Applsci 12 07210 g004
Figure 5. Compute π 1 , 2 ( s 1 , s 2 ) and π 2 , 2 ( s 1 , s 2 ) for the undirected three-node motifs.
Figure 5. Compute π 1 , 2 ( s 1 , s 2 ) and π 2 , 2 ( s 1 , s 2 ) for the undirected three-node motifs.
Applsci 12 07210 g005
Figure 6. Real values of motif frequencies: (a) three-node directed motifs; (b) three-node signed motifs; (c) four-node undirected motifs; (d) five-node undirected motifs.
Figure 6. Real values of motif frequencies: (a) three-node directed motifs; (b) three-node signed motifs; (c) four-node undirected motifs; (d) five-node undirected motifs.
Applsci 12 07210 g006
Figure 7. NRMSEs of n ^ i ( 3 ) , the estimates of three-node directed motif frequencies for p = 0.01 and p = 0.05 , respectively. Flickr, Pokec, LiveJournal, Wiki-Talk, and Web-Google have 1.35 × 10 10 , 2.02 × 10 9 , 6.90 × 10 9 , 1.2 × 10 10 , and 7.00 × 10 8 three-node CIS, respectively: (a) p = 0.01 ; (b) p = 0.05 .
Figure 7. NRMSEs of n ^ i ( 3 ) , the estimates of three-node directed motif frequencies for p = 0.01 and p = 0.05 , respectively. Flickr, Pokec, LiveJournal, Wiki-Talk, and Web-Google have 1.35 × 10 10 , 2.02 × 10 9 , 6.90 × 10 9 , 1.2 × 10 10 , and 7.00 × 10 8 three-node CIS, respectively: (a) p = 0.01 ; (b) p = 0.05 .
Applsci 12 07210 g007
Figure 8. NRMSEs of n ^ i ( 3 ) , the estimates of three-node signed and undirected motif frequencies for p = 0.01 , p = 0.05 , and p = 0.1 , respectively. Sign-Epinions, sign-Slashdot08, and sign-Slashdot09 have 1.72 × 10 8 , 6.72 × 10 7 , and 7.25 × 10 7 three-node CIS, respectively: (a) p = 0.01 ; (b) p = 0.05 ; (c) p = 0.1 .
Figure 8. NRMSEs of n ^ i ( 3 ) , the estimates of three-node signed and undirected motif frequencies for p = 0.01 , p = 0.05 , and p = 0.1 , respectively. Sign-Epinions, sign-Slashdot08, and sign-Slashdot09 have 1.72 × 10 8 , 6.72 × 10 7 , and 7.25 × 10 7 three-node CIS, respectively: (a) p = 0.01 ; (b) p = 0.05 ; (c) p = 0.1 .
Applsci 12 07210 g008
Figure 9. NRMSEs of n ^ i ( 4 ) , the motif frequency estimates of four-node undirected motifs for p = 0.1 , and p = 0.2 , respectively. Soc-Epinions1, soc-Slashdot08, soc-Slashdot09, and com-Amazon have 2.58 × 10 10 , 2.17 × 10 10 , 2.42 × 10 10 , and 1.78 × 10 8 four-node CIS, respectively: (a) p = 0.05 ; (b) p = 0.1 ; (c) p = 0.2 .
Figure 9. NRMSEs of n ^ i ( 4 ) , the motif frequency estimates of four-node undirected motifs for p = 0.1 , and p = 0.2 , respectively. Soc-Epinions1, soc-Slashdot08, soc-Slashdot09, and com-Amazon have 2.58 × 10 10 , 2.17 × 10 10 , 2.42 × 10 10 , and 1.78 × 10 8 four-node CIS, respectively: (a) p = 0.05 ; (b) p = 0.1 ; (c) p = 0.2 .
Applsci 12 07210 g009
Figure 10. NRMSEs of n ^ i ( 5 ) , the motif frequency estimates of five-node undirected motifs for p = 0.1 , p = 0.2 , and p = 0.3 , respectively. Com-Amazon, com-DBLP, p2p-Gnutella08, ca-GrQc, ca-CondMat, and ca-HepTh have 8.50 × 10 9 , 3.34 × 10 10 , 3.92 × 10 8 , 3.64 × 10 7 , 3.32 × 10 9 , and 8.73 × 10 7 five-node CIS, respectively: (a) soc-Amazon; (b) soc-DBLP; (c) p2p-Gnutella08; (d) ca-GrQc; (e) ca-CondMat; (f) ca-HepTh.
Figure 10. NRMSEs of n ^ i ( 5 ) , the motif frequency estimates of five-node undirected motifs for p = 0.1 , p = 0.2 , and p = 0.3 , respectively. Com-Amazon, com-DBLP, p2p-Gnutella08, ca-GrQc, ca-CondMat, and ca-HepTh have 8.50 × 10 9 , 3.34 × 10 10 , 3.92 × 10 8 , 3.64 × 10 7 , 3.32 × 10 9 , and 8.73 × 10 7 five-node CIS, respectively: (a) soc-Amazon; (b) soc-DBLP; (c) p2p-Gnutella08; (d) ca-GrQc; (e) ca-CondMat; (f) ca-HepTh.
Applsci 12 07210 g010
Figure 11. Accuracy of our method for estimating motif concentrations in comparison with state-of-the-art methods: (a) (Flickr) p = 0.01 , three-node directed motif concentrations; (b) (soc-Epinions1) p = 0.1 , four-node undirected motif concentrations; (c) (com-Amazon) p = 0.2 , five-node undirected motif concentrations.
Figure 11. Accuracy of our method for estimating motif concentrations in comparison with state-of-the-art methods: (a) (Flickr) p = 0.01 , three-node directed motif concentrations; (b) (soc-Epinions1) p = 0.1 , four-node undirected motif concentrations; (c) (com-Amazon) p = 0.2 , five-node undirected motif concentrations.
Applsci 12 07210 g011
Figure 12. Accuracy of our method for estimating the number of triangles in comparison with gSH T .
Figure 12. Accuracy of our method for estimating the number of triangles in comparison with gSH T .
Applsci 12 07210 g012
Table 1. Table of notations.
Table 1. Table of notations.
G G = ( V , E , L ) is the graph of interest
G * G * = ( V * , E * , L * ) is a sampled graph
V ( s ) , s C ( k ) set of nodes in k-node CIS s
E ( s ) , s C ( k ) set of edges in k-node CIS s
M ( s ) motif class ID of CIS s
T k number of k-node subgraph classes
M i ( k ) i-th k-node motif
C ( k ) set of k-node CIS in G
C ( k , * ) set of k-node CIS in G *
C i ( k ) set of CIS in G isomorphic to M i ( k )
n ( k ) = | C ( k ) | number of k-node CIS in G
n i ( k ) = | C i ( k ) | number of CIS in G isomorphic to M i ( k )
ω i ( k ) = n i ( k ) n ( k ) concentration of motif M i ( k ) in G
Pmatrix P = [ P i j ] 1 i , j T k
P i , j probability that s * isomorphic to M i ( k ) given
s isomorphic to M j ( k )
Z j Z j = { i : i = 1 , , T k , and P i , j > 0 }
ϕ i , j number of subgraphs of M j ( k ) isomorphic
to M i ( k )
S G * , G ( k ) S G * , G ( k ) = { ( s * , s ) : s * C ( k , * ) , s C ( k ) ,
                                   V ( s * ) = V ( s ) }
π i , j ( s 1 , s 2 ) s 1 and s 2 are two k-node CIS in G
isomorphic to motif M j ( k ) . Let s 1 * and s 2 * be
the induced subgraphs of node sets V ( s 1 )
and V ( s 2 ) in G * , respectively. π i , j ( s 1 , s 2 )
is defined as the probability that s 1 * and s 2 *
are both isomorphic to motif M i ( k ) .
m i , j ( k ) number of elements ( s * , s ) S G * , G ( k ) , where
s * is isomorphic to motif M i ( k ) and s is
isomorphic to motif M j ( k )
pprobability of sampling an edge
q q = 1 p
Table 2. Graph datasets used in our experiments. “edges” refers to the quantity of edges in the undirected graph generated by discarding edge labels. “max-degree” denotes the maximum quantity of edges for a node in an undirected graph.
Table 2. Graph datasets used in our experiments. “edges” refers to the quantity of edges in the undirected graph generated by discarding edge labels. “max-degree” denotes the maximum quantity of edges for a node in an undirected graph.
GraphNodesEdgesMax-Degree
Flickr [22]1,715,25515,555,04127,236
Pokec [44]1,632,80322,301,96414,854
LiveJournal [22]5,189,80948,688,09715,017
YouTube [22]1,138,4992,990,44328,754
Wiki-Talk [45]2,394,3854,659,565100,029
Web-Google [46]875,7134,322,0516332
soc-Epinions1 [11]75,897405,7403044
soc-Slashdot08 [10]77,360469,1802539
soc-Slashdot09 [10]82,168504,2302552
sign-Epinions [47]119,130704,2673558
sign-Slashdot08 [47]77,350416,6952537
sign-Slashdot09 [47]82,144504,2302552
com-DBLP [48]317,0801,049,866343
com-Amazon [48]334,863925,872549
p2p-Gnutella08 [49]630120,77797
ca-GrQc [50]524114,48481
ca-CondMat [50]23,13393,439279
ca-HepTh [50]987525,93765
Table 3. Real values of three-node undirected motif frequencies (i is the motif ID).
Table 3. Real values of three-node undirected motif frequencies (i is the motif ID).
iFlickrPokecLive-
Journal
Wiki-
Talk
Web-
Google
undirected three-node motifs
11.30 × 10 10 1.99 × 10 9 6.59 × 10 9 1.26 × 10 10 6.87 × 10 8
25.49 × 10 8 3.26 × 10 7 3.11 × 10 8 9.20 × 10 6 1.34 × 10 7
Table 4. NRMSEs of n i ( 3 ) , the concentration estimates of three-node undirected motifs for p = 0.01 and p = 0.05 , respectively (i is the motif ID).
Table 4. NRMSEs of n i ( 3 ) , the concentration estimates of three-node undirected motifs for p = 0.01 and p = 0.05 , respectively (i is the motif ID).
iFlickrPokecLive-
Journal
Wiki-
Talk
Web-
Google
p = 0.01
18.3 × 10 3 1.3 × 10 2 2.8 × 10 2 2.5 × 10 2 2.6 × 10 2
21.3 × 10 2 1.3 × 10 2 1.7 × 10 2 4.4 × 10 2 2.4 × 10 2
p = 0.05
14.2 × 10 3 5.0 × 10 3 3.4 × 10 3 1.3 × 10 2 1.2 × 10 2
24.7 × 10 3 4.1 × 10 3 4.3 × 10 3 1.6 × 10 2 8.1 × 10 3
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Guo, W.; Feng, W.; Qi, Y.; Wang, P.; Tao, J. Mosar: Efficiently Characterizing Both Frequent and Rare Motifs in Large Graphs. Appl. Sci. 2022, 12, 7210. https://doi.org/10.3390/app12147210

AMA Style

Guo W, Feng W, Qi Y, Wang P, Tao J. Mosar: Efficiently Characterizing Both Frequent and Rare Motifs in Large Graphs. Applied Sciences. 2022; 12(14):7210. https://doi.org/10.3390/app12147210

Chicago/Turabian Style

Guo, Wenhua, Wenqian Feng, Yiyan Qi, Pinghui Wang, and Jing Tao. 2022. "Mosar: Efficiently Characterizing Both Frequent and Rare Motifs in Large Graphs" Applied Sciences 12, no. 14: 7210. https://doi.org/10.3390/app12147210

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop