• Tidak ada hasil yang ditemukan

MOSS-5: A Fast Method of Approximating Counts of 5-Node Graphlets in Large Graphs

N/A
N/A
Protected

Academic year: 2024

Membagikan "MOSS-5: A Fast Method of Approximating Counts of 5-Node Graphlets in Large Graphs"

Copied!
15
0
0

Teks penuh

(1)

Counts of 5-Node Graphlets in Large Graphs

Item Type Article

Authors Wang, Pinghui;Zhao, Junzhou;Zhang, Xiangliang;Li, Zhenguo;Cheng, Jiefeng;Lui, John C.S.;Towsley, Don;Tao, Jing;Guan, Xiaohong

Citation Wang P, Zhao J, Zhang X, Li Z, Cheng J, et al. (2017) MOSS-5:

A Fast Method of Approximating Counts of 5-Node Graphlets in Large Graphs. IEEE Transactions on Knowledge and Data Engineering: 1–1. Available: http://dx.doi.org/10.1109/

TKDE.2017.2756836.

Eprint version Post-print

DOI 10.1109/TKDE.2017.2756836

Publisher Institute of Electrical and Electronics Engineers (IEEE) Journal IEEE Transactions on Knowledge and Data Engineering Rights (c) 2017 IEEE. Personal use of this material is permitted.

Permission from IEEE must be obtained for all other users, including reprinting/ republishing this material for advertising or promotional purposes, creating new collective works for resale or redistribution to servers or lists, or reuse of any copyrighted components of this work in other works.

Download date 2023-11-29 21:07:08

Link to Item http://hdl.handle.net/10754/625894

(2)

MOSS-5: A Fast Method of Approximating Counts of 5-Node Graphlets in Large Graphs

Pinghui Wang, Junzhou Zhao, Xiangliang Zhang, Zhenguo Li, Jiefeng Cheng, John C.S. Lui, Don Towsley, Jing Tao, and Xiaohong Guan

Abstract—Counting 3-, 4-, and 5-node graphlets in graphs is important for graph mining applications such as discovering abnormal/evolution patterns in social and biology networks. In addition, it is recently widely used for computing similarities between graphs and graph classification applications such as protein function prediction and malware detection. However, it is challenging to compute these metrics for a large graph or a large set of graphs due to the combinatorial nature of the problem. Despite recent efforts in counting triangles (a 3-node graphlet) and 4-node graphlets, little attention has been paid to characterizing 5-node graphlets. In this paper, we develop a computationally efficient sampling method to estimate 5-node graphlet counts. We not only provide fast sampling methods and unbiased estimators of graphlet counts, but also derive simple yet exact formulas for the variances of the estimators which is of great value in practice—the variances can be used to bound the estimates’ errors and determine the smallest necessary sampling budget for a desired accuracy. We conduct experiments on a variety of real-world datasets, and the results show that our method is several orders of magnitude faster than the state-of-the-art methods with the same accuracy.

Index Terms—graphlet kernel, subgraph sampling, graph mining.

F

1 INTRODUCTION

F

Or complex networks such as online social networks (OSNs), computer networks, and biological networks, designing tools for estimating the counts (or frequencies) of 3-, 4-, and 5-node connected subgraph patterns (i.e., graphlets) shown in Fig. 1 is fundamental for detecting evolution and anomaly patterns in a large graph and computing graph similarities for graph classi- fication, which have been widely used for a variety of graph mining and learning tasks. To explore patterns in a large graph, Milo et al. [1] defined network motifs as graphlets occurring in networks at numbers that are significantly larger than those found in random networks. Network motifs have been used for pattern recognition in gene expression profiling [2], evolution patterns in OSNs [3]–[6], and Internet traffic classification and anomaly detection [7,8]. In addition to mining a single large graph, graphlet counts also have been used to classify a large number of graphs. The graphlet kernel [9] (the dot product of two vectors of normalized graphlet counts) and RGF-distance [10]

Pinghui Wang, Jing Tao, and Xiaohong Guan are with MOE Key Lab- oratory for Intelligent Networks and Network Security, Xi’an Jiaotong University. P.O. Box 1088, No. 28, Xianning West Road, Xi’an Jiaotong University, Xi’an, Shaanxi, 710049, China; Tel.: +086-29-82664603; Fax:

+086-29-82664603; E-mail: {phwang, jtao, xhguan}@mail.xjtu.edu.cn.

Pinghui Wang is also with Shenzhen Research Institute of Xi’an Jiaotong University, Shenzhen, China. Xiaohong Guan is also with the Center for Intelligent and Networked Systems, Tsinghua National Lab for In- formation Science and Technology, Tsinghua University, Beijing, China.

Xiangliang Zhang is with King Abdullah University of Science and Technology, Thuwal, SA; Email: [email protected]. Zhen- guo Li is with Huawei Noah’s Ark Lab, Shatin, Hong Kong; Email:

[email protected]. Jiefeng Cheng is with Tencent Cloud Security Lab, Shenzhen, China; Email: [email protected]. John C.S. Lui and Junzhou Zhao are with Department of Computer Science and Engineering, The Chinese University of Hong Kong, Shatin, Hong Kong; Email:

[email protected], [email protected]. Don Towsley is with De- partment of Computer Science, University of Massachusetts Amherst, MA, USA; Email: [email protected].

(Euclidean distance between two vectors of normalized graphlet counts) are widely used for graph similarity comparison, which is an important problem in application areas as disparate as bioinfor- matics, chemoinformatics, and software engineering. For example, 1)protein function prediction: identifying whether a given protein is an enzyme is important for understanding its function in biology.

The biological network of a protein is usually represented as a undirected graph where a node in the graph represents an atom and an edge represents the existence of a chemical bond (i.e., a lasting attraction) between two atom. Thus, one can infer whether a given protein is an enzyme or not by computing the similarities between the graph topologies of the protein and a large set of enzymes given in advance [11,12]; 2)compound function predic- tion. Similarly, chemical compounds are usually represented as a graph, and computing the similarity between them is important for applications such as predicting activity or adverse effects of potential drugs [13,14]; 3) node and community clustering. In addition to biological and chemical applications, Yanardag and Vishwanathan [15] reveal that computing similarities between the ego-networks of nodes (e.g., researchers in coauthor networks) in other networks such as coauthor networks and OSNs is useful for predicting the node classes (e.g., the field of researchers).

Similarly, they represent each online discussion thread on OSN Reddit1 as a graph where nodes correspond to users and there is an edge between two nodes if at least one of them responded to another’s comment. Yanardag and Vishwanathan [15] observe that computing the similarities between these graphs is effective for the task of identifying whether a given graph belongs to a question/answer-based community or a discussion-based commu- nity; 4)malware detection. Attackers currently use two effective and convenient ways to generate and distribute attack payloads: (a) reuse existing malicious code to generate new malware variants, (b) use repackaging techniques to inject a small piece of malicious

1. http://www.reddit.com

(3)

'ϭ;ϯͿ 'Ϯ;ϯͿ

(a) 3-node graphlets

'ϭ;ϰͿ 'Ϯ;ϰͿ 'ϯ;ϰͿ 'ϰ;ϰͿ 'ϱ;ϰͿ 'ϲ;ϰͿ

(b) 4-node graphlets

'ϰ;ϱͿ

'ϭ;ϱͿ 'Ϯ;ϱͿ 'ϯ;ϱͿ 'ϱ;ϱͿ 'ϲ;ϱͿ 'ϳ;ϱͿ 'ϴ;ϱͿ 'ϵ;ϱͿ 'ϭϬ;ϱͿ 'ϭϭ;ϱͿ

'ϭϮ;ϱͿ 'ϭϯ;ϱͿ 'ϭϰ;ϱͿ 'ϭϱ;ϱͿ 'ϭϲ;ϱͿ 'ϭϳ;ϱͿ 'ϭϴ;ϱͿ 'ϭϵ;ϱͿ 'ϮϬ;ϱͿ 'Ϯϭ;ϱͿ

(c) 5-node graphlets

Figure 1. 3-, 4-, and 5-node undirected graphlets. Combinatorial explosion: A nodevwith degreedvin the graph of interest is included in at least

1

2dv(dv1)3-node CISes,16dv(dv1)(dv2)4-node CISes, and241dv(dv1)(dv2)(dv3)5-node CISes.

code into popular mobile Apps such as Angry Bird. Meanwhile, they can easily avoid traditional detectors based on pure syntax.

Recently, [16]–[18] observe that the malwares generated by the above two ways keep a large fraction of relationships between subroutines and classes in the original computer programs, which can be recovered from disassembly of their executable binaries (software reverse engineering). They define graphs (e.g., view graph in [16], component graph in [17], and call graph in [18]) to depict the relationships between subroutines and classes in soft- wares, therefore comparing topology similarities between graphs is useful for detecting the above malwares.

0RVV ×

,QSXW*UDSK VNWRS&$+HS7KW[W 2XWSXW)LOH &$+HSWKW[W287

1XPEHURI6DPSOHV 6WG(UU

%HWZHHQDQG(

%HWZHHQDQG

*UDSKOHW6L]H %HWZHHQDQG 6WDUW6DPSOLQJ

5HVXOW

)LOH

*UDSKOHW *UDSKOHW *UDSKOHW

&8VHUV$GPLQLVWUDWRU'HVNWRS&$+HS7KW[W

*UDSKOHW

&RXQW 6WG(UU

H

H

H

H

H

*UDSKOHW

&RXQW 6WG(UU

H

*UDSKOHW

&RXQW 6WG(UU

$ERXW ([LW

Figure 2. The graphical user interface of our system.

Due to the combinatorial explosion of the problem, it is computationally intensive to enumerate and compute graphlet counts even for a moderately sized graph. For example, for two medium-size networks Slashdot [19] and Epinions [20] that each

only contains105nodes and106edges, each has more than1010 4-node connected and induced subgraphs (CISes) and10135-node CISes. To address this problem, approximate methods such as sampling could be used in place of the brute-force enumeration approach. As shown in Fig. 2 (the graphical user interface of our system), a practical sampling method desires an important feature that it can stop its sampling procedure as soon as it achieves a desired estimation accuracy or when the sampling budget runs out, and then returns 1) graphlet count estimates and 2) estimation errors.

Despite recent progress in counting triangles [21]–[26] and 4- node graphlets [27], little attention has been given to developing fast tools for characterizing and counting 5-node graphlets. Re- cently, Pinar et al. [28] give a fast methodESCAPE for counting 5-node undirected graphlets by utilizing the relationships between 3-, 4-, and 5-node graphlets counts. However, ESCAPE is not scal- able to large graphs, which requires more than 10 hours to handle graphs with millions of nodes and edges. To address this challenge, in this paper we propose a novel sampling method MOSS-5 to estimate the counts of 5-node graphlets. MOSS-5 consists of two sub-methods: T-5 and Path-5, which are customized to fast sample 5-node CISes in two specific graphlet groups respectively. Based on the samples of T-5 and Path-5, we estimate all 5-node graphlet counts and bound the estimates’ errors. Our contributions are summarized as:

Our method for sampling 5-node CISes and estimating 5-node graphlet counts are scalable and computationally efficient.

To validate our method, we perform an in-depth analysis of our method’s accuracy. We find that our method provides unbiased estimates of 5-node graphlet counts. We also derive simple and exact formulas for the variances of the estimators, which is critical in practice such as bounding the estimates’ errors and determining a proper sampling budget to achieve a desired accuracy. This has been lacking for previous estimators.

We conduct experiments on a variety of publicly available datasets, and experimental results demonstrate that our method

(4)

significantly outperforms the state-of-the-art methods. To guaran- tee the reproducibility of the experimental results, we release the source code of MOSS-5 in open source2.

The rest of this paper is organized as follows. The problem formulation is presented in Section 2. Section 3 presents our 5-node graphlet sampling method MOSS-5. The performance evaluation and testing results are presented in Section 4. Section 5 summarizes related work. Concluding remarks then follow.

2 PROBLEMFORMULATION

LetG= (V, E)be an undirected graph, whereV andE are the sets of nodes and edges respectively. To define graphlet counts of G, let us first introduce some notation. A subgraphG ofGis a graph whose set of nodes and set of edges are both subsets of G. An induced subgraph ofG,G= (V, E), is a subgraph that consists of some nodes ofGandall of the edgesthat connect these nodes inG, i.e.V⊂V,E ={(u, v) :u, v∈V,(u, v)∈E}. Until we explicitly say “induced” in this paper, otherwise a subgraph is not necessarily induced.All undirected graphs’ 5- node graphlets G(5)1 , . . . , G(5)21 studied in this paper are shown in Fig. 1. Denote by C(5) the set of 5-node CISes in G, and Ci(5)the set of 5-node CISes inGisomorphic3to graphletG(5)i . The graphlet count ofG(5)i is defined asηi = |Ci(5)|,1 ≤i 21. As we discussed above, it is computationally expensive to enumerate and count all 5-node CISes in large graphs. In this paper, we develop a fast sampling method to accurately estimate 5-node graphlet countsη1,. . .,η21. For ease of reading, we list notation used throughout the paper in Table 1.

Table 1 Table of notation.

G= (V, E) Gis an undirected graph

Nv the set of neighbors of a nodevinG dv dv=|Nv|, the cardinality of setNv

G(5)1 , . . . , G(5)21 5-node graphlets

G(5)(s) 5-node graphlet ID of CISs C(5) the set of all 5-node CISes inG C1(5), . . . , C21(5) Ci(5)is the set of 5-node CISes inG

isomorphic to graphletG(5)i ,1i21 η1, . . . , η21 ηi=|Ci(5)|,1i21

K1,K2 sampling budgets of T-5 and Path-5 K=K1+K2 sampling budgets of MOSS-5

ϕ(1)i ,1i21 the number of subgraphs in a CISsCi(5) that are isomorphic toG(5)3

ϕ(2)i ,1i21 the number of subgraphs in a CISsCi(5) that are isomorphic toG(5)1

ϕ(3)i ,1i21 the number of subgraphs in a CISsCi(5) that are isomorphic toG(5)2

3 OUR METHOD OF ESTIMATING 5-NODE UNDI-

RECTED GRAPHLETCOUNTS

In this section, we introduce our method MOSS-5. We observe that 1) except CISes inC1(5)∪C2(5)∪C6(5), 5-node CISes include

2. http://nskeylab.xjtu.edu.cn/dataset/phwang/code/mosscode.zip

3. Two graphs G1 = (V1, E1) and G2 = (V2, E2) are said to be isomorphic if there exists at least one bijectionf:V1 V2 such that any two nodesuandvinV1are adjacent inG1if and only iff(u)andf(v)are adjacent inG2.

at least one subgraph isomorphic to graphletG(5)3 ; 2) except CISes inC2(5)∪C3(5)∪C8(5), 5-node CISes include at least one subgraph isomorphic to graphletG(5)1 . LetΩ1 ={1, . . . ,21} − {1,2,6} andΩ2 = {1, . . . ,21} − {2,3,8}. Inspired by the above two observations, as shown in Fig. 3, we develop a method MOSS-5 consisting of two sub-methods: T-5 and Path-5, where T-5 is cus- tomized to fast sample 5-node CISes isomorphic toG(5)i ,i∈1, and Path-5 is customized to fast sample 5-node CISes isomorphic toG(5)j ,j∈2. For anyi∈1, we provide an unbiased estimate ˆ

ηi(1) ofηi based on sampled CISes of T-5, and derive a closed- form formula of the variance ofηˆi(1). For anyj 2, similarly, we provide an unbiased estimate ηˆj(2) of ηj based on sampled CISes of Path-5, and derive a closed-form formula of the variance of ηˆ(2)j . Based on ηˆi(1) and ηˆj(2), we propose a more accurate estimator ηˆk of ηk, k 12 = {1, . . . ,21} − {2} and provide an unbiased estimatorηˆ2ofη2. To bound the error ofηˆk, k∈ {1, . . . ,21}, we also derive the variance of eachηˆk.

: Sample CISes isomorphic to

*L L∈ Ω

: Sample CISes isomorphic to

*L L∈ Ω Compute

ÖL DQG YDUÖL L

η η

∈ Ω

Compute

ÖL DQG YDUÖL L

η η ∈ Ω

Compute ηÖLDQG YDU ηÖL L∈ Ω ∪ Ω = ^ ` ^`−

Compute ηÖDQG YDUηÖ

Figure 3. Overview of MOSS-5. MOSS-5 smartly combines two T-5 and Path-5 sampling methods, which are two novel sampling methods proposed in this paper.

3.1 The T-5 Sampling Method Denote

Γ(1)v = (dv1)(dv2) ∑

xNv

(dx1), v∈V.

We assign a weight Γ(1)v to each node v V. Define Γ(1) =

vV Γ(1)v andρ(1)v = ΓΓ(1)v(1). To sample a 5-node CIS, T-5 uses six steps:

Step 1. Sample a node v from V according to the distribution ρ(1)=(1)v :v∈V};

Step 2. Sample a nodeufromNv according to the distribution σ(v)=u(v):u∈Nv}, whereσu(v)is defined as

σ(v)u = du1

xNv(dx1), u∈Nv; Step 3.Sample a nodewfromNv− {u}at random;

Step 4.Sample a noderfromNv− {u, w}at random;

Step 5.Sample a nodetfromNu− {v}at random;

Step 6.Return the CISsthat includes nodesv,u,w,r, andt.

One may wonder why not samplev fromV andufromNv

uniformly in the first two steps? This is because it is difficult to

(5)

compute and remove the sampling bias of s when sampling v fromV andufrom Nv uniformly. In contrast, sampling v and u according to specific distributionsρ(1) and σ(v) leads to the sampling bias of T-5 that can be easily derived and removed, which will be discussed later (Theorems 1 and 2). We run the above procedure K1 times to obtain K1 CISes s(1)1 , . . . , s(1)K

1. The pseudo-code of T-5 is shown in Algorithm 1. In Algorithm 1, function WeightRandomVertex(V, ρ(1)) returns a node sampled from V according to the distribution ρ(1) = (1)v : v V}, function RandomVertex(X) returns a node sampled from X at random, and function CIS({v, u, w, r, t}) returns the CIS with the node set{v, u, w, r, t}inG.

Algorithm 1:The pseudo-code of T-5.

input :G= (V, E)andK1. output:ηˆi(1).

fori∈1do ˆ

η(1)i 0;

end

fork∈[1, K1]do

v←WeightRandomVertex(V, ρ(1));

u←WeightRandomVertex(Nv, σ(v));

w←RandomVertex(Nv− {u});

r←RandomVertex(Nv− {u, w});

t←RandomVertex(Nu− {v});

s(1)k CIS({v, u, w, r, t});

if=wandt̸=rthen i←G(5)(s(1)k );

ˆ

η(1)i ←ηˆi(1)+ 1

K1p(1)i ; end

end

For a CIS s isomorphic to graphlet G(5)i ,1 i 21, let ϕ(1)i denote the number of subgraphs in s that are isomorphic to graphlet G(5)3 . In other word, scontains ϕ(1)i subgraphs that are isomorphic to G(5)3 . The value of ϕ(1)i is given in Table 2.

The following theorem shows the sampling bias of T-5, which is critical for estimatingηi.

Theorem 1. Using the sampling procedure once (i.e.,K1 = 1), T-5 returns a CISs∈Ci(5)sampled with probability

p(1)i = 2ϕ(1)i

Γ(1) , 1≤i≤21.

Proof. As shown in Fig. 4, we can easily find that there exist two ways to sample a subgraph isomorphic to graphletG(5)3 by T-5.

Each happens with probability ρ(1)v ×σu(v)× 1

dv1 × 1

dv2× 1

du1 = 1 Γ(1). For a 5-node CIS s Ci(5), s has ϕ(1)i different subgraphs isomorphic to graphlet G(5)3 , 1 i 21. Therefore, the probability of T-5 samplingsis2ϕ

(1) i

Γ(1) .

We let G(5)(s)be the 5-node graphlet ID of s whens is a 5-node CIS, and -1 otherwise. We define

m(1)i =

K1

k=1

1(G(5)(s(1)k ) =i).

[ [

[ [

[

FDVH

VWHS [ĺY

VWHS [ĺX

VWHS [ĺW VWHS

[ĺZ

VWHS [ĺU

FDVH

VWHS [ĺY

VWHS [ĺX

VWHS [ĺW VWHS

[ĺU

VWHS [ĺZ VXEJUDSKV

Figure 4. The ways of T-5 sampling a subgraphsisomorphic to graphlet G(5)3 , wherev,u,w,r, andtare the variables in Algorithm 1, i.e., the nodes sampled at the1st,2nd,3rd,4th, and5thsteps respectively.

It is easy to obtain the expectation ofm(1)i as E(m(1)i ) =K1p(1)i ηi.

Fori∈1,p(1)i is larger than zero and thus we estimateηias ˆ

ηi(1)= m(1)i K1p(1)i .

Theorem 2.Fori∈1,ηˆ(1)i is an unbiased estimator ofηi, i.e., E(ˆηi(1)) =η(1)i , and the variance ofηˆi(1)is

Var(ˆη(1)i ) = ηi

K1

( 1 p(1)i −ηi

)

. (1)

We estimate Var(ˆη(1)i ) by replacingηi with ηˆ(1)i in (1). We also compute the covariance ofηˆi(1)andηˆ(1)j as follows,

Cov(ˆηi(1)ˆ(1)j ) =−ηiηj K1

, =j, i, j∈1, which is used to compute the variance of the estimate of η2

given in Section 3.3.

Proof. Fori∈1and1≤k≤K1, we have P(G(5)(s(1)k ) =i) = ∑

sC(5)

P(s(1)k =s)1(G(5)(s(1)k ) =i)

=p(1)i ηi. Sinces(1)1 , . . . , s(1)K

1 are sampled independently, the random vari- ablem(1)i follows the binomial distribution with parameters K1 andp(1)i ηi. Then, the expectation and variance ofm(1)i are

E(m(1)i ) =K1p(1)i ηi, Var(m(1)i ) =K1p(1)i ηi(1−p(1)i ηi).

Therefore, the expectation and variance ofηˆi(1)are computed as E(ˆη(1)i ) =E

( m(1)i K1p(1)i

)

= E(m(1)i ) K1p(1)i

=ηi,

Var(ˆηi) =Var ( m(1)i

K1p(1)i )

= ηi

K1

( 1 p(1)i −ηi

) .

(6)

Table 2

Values ofϕ(1)i ,ϕ(2)i , andϕ(3)i .

i 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

ϕ(1)i 0 0 1 1 2 0 2 2 4 4 5 4 6 10 9 12 10 20 20 36 60

ϕ(2)i 1 0 0 2 2 5 1 0 4 7 2 4 6 10 6 6 14 24 18 36 60

ϕ(3)i 0 1 0 0 0 0 0 1 0 0 1 1 0 1 1 2 0 1 2 3 5

For=jandi, j∈1, the covariance ofηˆ(1)i andηˆj(1)is Cov(ˆηi(1)ˆ(1)j )

= Cov ( m(1)i

K1p(1)i , m(1)j

K1p(1)j )

= Cov(∑K1

k=11(G(5)(s(1)k ) =i),K1

l=11(G(5)(s(1)l ) =j)) K12p(1)i p(1)j

=

K1 k=1

K1

l=1Cov(1(G(5)(s(1)k ) =i),1(G(5)(s(1)l ) =j)) K12p(1)i p(1)j

.

Each sampled 5-node CIS is obtained independently, so we have Cov(1(M(5)(s(1)k ) =i),1(M(5)(s(1)l ) =j)) = 0, =l.

In addition, we haveP(M(5)(s(1)k ) =i∧M(5)(s(1)k ) =j) = 0 when=j. Therefore, we obtain

Cov(1(M(5)(s(1)k ) =i),1(M(5)(s(1)k ) =j))

=E(1(M(5)(s(1)k ) =i)1(M(5)(s(1)k ) =j))

E(1(M(5)(s(1)k ) =i))E(1(M(5)(s(1)k ) =j))

= 0−p(1)i ηip(1)j ηj

=−p(1)i p(1)j ηiηj. Now, we easily have

Cov(ˆη(1)i ˆ(1)j )

=

K1

k=1Cov(1(G(5)(s(1)k ) =i),1(G(5)(s(1)k ) =j)) K12p(1)i p(1)j

= −ηiηj

K1.

3.2 The Path-5 Sampling Method

The pseudo-code of Path-5 is shown in Algorithm 2. Let Γ(2)v =

∑

xNv

(dx1)

2

xNv

(dx1)2, v∈V.

We assign a weight Γ(2)v to each node v V. Define Γ(2) =

vV Γ(2)v andρ(2)v = ΓΓ(2)v(2). To sample a 5-node CIS, Path-5 mainly consists of six steps:

Step 1. Sample a node v from V according to the distribution ρ(2)=(2)v :v∈V};

Step 2. Sample a nodeufromNv according to the distribution τ(v)=u(v):u∈Nv}, where we define

τu(v)= (du1)(∑

yNv−{u}(dy1)) Γ(2)v

, u∈Nv;

Step 3.Sample a nodewfromNv− {u}according to the distri- butionµ(v,u)={

µ(v,u)w :w∈Nv− {u}}

, where we define µ(v,u)w = dw1

yNv−{u}(dy1), w∈Nv− {u}; Step 4.Sample a noderfromNu− {v}at random;

Step 5.Sample a nodetfromNw− {v}at random;

Step 6.Return the CISsthat includes nodesv,u,w,r, andt.

Algorithm 2:The pseudo-code of Path-5.

input :G= (V, E)andK2. output:ηˆi(2).

fori∈2do ˆ

η(2)i 0;

end

fork∈[1, K2]do

v←WeightRandomVertex(V, ρ(2));

u←WeightRandomVertex(Nv, τ(v));

w←WeightRandomVertex(Nv− {u}, µ(v,u));

r←RandomVertex(Nu− {v});

t←RandomVertex(Nw− {v});

s(2)k CIS({v, u, w, r, t});

if=uandr̸=wandt̸=rthen i←G(5)(s(2)k );

ˆ

η(2)i ←ηˆi(2)+ 1

K2p(2)i ; end

end

We run the above procedure K2 times to obtain K2 CISes s(2)1 , . . . , s(2)K

2. For a CIS s isomorphic to graphlet G(5)i , 1 i 21, letϕ(2)i denote the number of subgraphs in sthat are isomorphic toG(5)1 . In other word,scontainsϕ(2)i subgraphs that are isomorphic toG(5)1 . The value ofϕ(2)i is given in Table 2. The following theorem shows the sampling bias of Path-5.

Theorem 3. Using the sampling procedure once (i.e.,K2 = 1), Path-5 samples a CISs∈Ci(5)with probability

p(2)i = 2ϕ(2)i

Γ(2) , 1≤i≤21.

Proof. As shown in Fig. 5, we can see that there exist two ways to sample a subgraph isomorphic to graphletG(5)1 by Path-5. Each one happens with probability

ρ(2)v ×τu(v)×µ(v,u)w × 1

du1× 1

dw1 = 1 Γ(2). For a 5-node CIS s Ci(5), s has ϕ(2)i subgraphs isomorphic to graphletG(5)1 ,1 i 21. Thus, the probability of Path-5 samplingsis 2ϕ

(2) i

Γ(2).

(7)

[

[

[

[ [

FDVH

VWHS[ĺY VWHS[ĺX

VWHS[ĺZ VWHS[ĺW VWHS[ĺU

FDVH

VWHS[ĺY VWHS[ĺZ

VWHS[ĺX VWHS[ĺU VWHS[ĺW VXEJUDSKV

Figure 5. The ways of Path-5 sampling a subgraphs isomorphic to graphletG(5)1 , wherev,u,w,r, andtare the variables in Algorithm 2, i.e., the nodes sampled at the1st,2nd,3rd,4th, and5thsteps respectively.

Denote

m(2)i =

K2

k=1

1(G(5)(s(2)k ) =i).

Then, we have

E(m(2)i ) =K2p(2)i ηi.

Fori∈2,p(2)i is larger than zero and we then estimateηias ˆ

ηi(2)= m(2)i K2p(2)i

.

Theorem 4.Fori∈2,ηˆ(2)i is an unbiased estimator ofηiand its variance is

Var(ˆη(2)i ) = ηi K2

( 1 p(2)i −ηi

)

. (2)

We estimate Var(ˆηi(2))by replacingηi with ηˆi(2) in (2). The covariance ofηˆ(2)i andηˆj(2)is

Cov(ˆηi(2)ˆ(2)j ) =−ηiηj

K2, =j, i, j∈2, which is used to compute the variance of the estimate of η2

given in Section 3.3.

Its proof is similar to the proof of Theorem 2.

3.3 Hybrid Estimator of 5-Node Graphlet Counts We estimateηiasηˆ(1)i andηˆi(2)fori∈12andi∈21

respectively. Wheni 12, according to [29], we estimate ηibased on its two unbiased estimatesηˆi(1)andηˆ(2)i . Formally, let

λ(1)i = Var(ˆη(2)i )

Var(ˆη(1)i ) +Var(ˆηi(2)), λ(2)i = Var(ˆη(1)i ) Var(ˆη(1)i ) +Var(ˆηi(2)). Here Var(ˆηi(1))and Var(ˆη(2)i )are estimated by Theorems 2 and 4.

Fori∈12={1,3,4,5, . . . ,21}, we finally estimateηias

ˆ ηi=







λ(1)i ηˆi(1)+λ(2)i ηˆi(2), i∈12, ˆ

η(1)i , i∈12, ˆ

η(2)i , i∈21.

(3)

Note thatΩ12={1,2, . . . ,21} − {2}. Next, we discuss our method for estimatingη2. For a CISsisomorphic to graphlet G(5)i ,1 i 21, letϕ(3)i denote the number of subgraphs in sthat are isomorphic to graphletG(5)2 . In other word,scontains

ϕ(3)i subgraphs that are isomorphic toG(5)2 . The value ofϕ(3)i is given in Table 2. Let

Λ4=∑

vV

(dv 4

) .

Then, the number of all 5-node subgraphs (not necessarily in- duced) inGisomorphic to graphlet G(5)2 isΛ4. LetΩ3 ={j : ϕ(3)j >0}andΩ3= Ω3− {2}. We observe that

i3

ϕ(3)i ηi= Λ4. Sinceϕ(3)2 = 1, we estimateη2as

ˆ

η2= Λ4

i3

ϕ(3)i ηˆi.

Theorem 5.ηˆi is an unbiased estimator ofηi,1 i 21. For i∈12={1,2, . . . ,21} − {2}, the variance ofηˆiis

Var(ˆηi) =













Var(ˆη(1)i )Var(ˆηi(2))

Var(ˆη(1)i ) +Var(ˆηi(2)), i∈12, Var(ˆη(1)i ), i∈12, Var(ˆη(2)i ), i∈21.

(4)

In the above equation, we estimate Var(ˆηi(1))and Var(ˆη(2)i ) using the methods in Theorems 2 and 4. We compute the variance Var(ˆη2) =

i3

(ϕ(3)i )2Var(ˆηi) + ∑

i,j3,i̸=j

ϕ(3)i ϕ(3)j Cov(ˆηiˆj), where Cov(ˆηiˆj) =





















































l=1,2

λ(l)i λ(l)j ηiηj

Kl

, i, j∈12,

−λ(1)j ηiηj K1

, i∈12, j∈12,

−λ(1)i ηiηj

K1

, i∈12, j∈12,

−λ(2)i ηiηj K2

, i∈12, j∈21,

−λ(2)j ηiηj

K2

, i∈21, j∈12, 0, i∈12, j∈21, 0, i∈21, j∈12. Proof. Fori∈12, Theorems 2 and 4 tell us thatηi(1)and ηi(2) are unbiased estimators of ηi(1), and they are independent.

Moreover,λ(1)i +λ(2)i = 1. Therefore, we easily find thatηˆi is also an unbiased estimator ofη(1)i , and its variance is (4). Next, we study the expectation and variance ofηˆ2. The expectation of ˆ

η2is computed as E(ˆη2) = Λ4

i3

ϕ(3)i E(ˆηi) = Λ4

i3

ϕ(3)i ηi=η2. Before we compute the covariance ofηˆiandηˆjfori, j∈12

andi ̸= j, we first introduce three equations: (I) for anyi, j

Referensi

Dokumen terkait