Estimating and Sampling Graphs with Multidimensional Random Walks

Bruno Ribeiro Don Towsley Computer Science Department Computer Science Department University of Massachusetts at Amherst University of Massachusetts at Amherst Amherst, MA, 01002 Amherst, MA, 01002 [email protected] [email protected]

ABSTRACT in simple networks such as lattices or random networks). Estimating characteristics of large graphs via sampling is Examples of such networks include the Internet, the World a vital part of the study of complex networks. Current Wide Web, social, business, and biological networks [7, 28]. sampling methods such as (independent) random vertex and This work represents a as a directed graph random walks are useful but have drawbacks. Random ver- with labeled vertices and edges. A label can be, for in- tex sampling may require too many resources (time, band- stance, the degree of a vertex or, in a setting, width, or money). Random walks, which normally require someone’s hometown. Examples of network characteristics fewer resources per sample, can suffer from large estimation include the degree distribution, the fraction of HIV positive errors in the presence of disconnected or loosely connected individuals in a population [24], or the average number of graphs. In this work we propose a new m-dimensional ran- copies of a file in a peer-to-peer (P2P) network [16]. dom walk that uses m dependent random walkers. We show Characterizing the labels of a graph requires querying ver- that the proposed sampling method, which we call Fron- tices and/or edges; each query has an associated cost in re- tier sampling, exhibits all of the nice sampling properties sources (time, bandwidth, money). Characterizing a large of a regular random walk. At the same time, our simula- graph by querying the whole graph is often too costly. As a tions over large real world graphs show that, in the presence result, researchers have turned their attention to the estima- of disconnected or loosely connected components, Frontier tion of graph characteristics based on incomplete (sampled) sampling exhibits lower estimation errors than regular ran- data. In this work we present a new tool, Frontier Sampling, dom walks. We also show that Frontier sampling is more to characterize complex networks. In what follows random suitable than random vertex sampling to sample the tail of vertex (edge) sampling refers to sampling vertices (edges) in- the degree distribution of the graph. dependently and uniformly at random (with replacement). Distinct sampling strategies have different resource re- quirements depending on the network being sampled. For Categories and Subject Descriptors instance, in a network where each vertex is assigned a unique G.3 [Probability and Statistics]: Statistical computing user-id (e.g., travelers and their passport numbers, Face- book, MySpace, Flickr, and Livejournal) it is a widespread General Terms practice to perform random vertex sampling by querying randomly generated user-ids. This approach can be resource- Experimentation intensive if the user-id space is sparsely populated as the hit-to-miss ratio is low (e.g., less than 10% of all MySpace Keywords user-ids between the highest and lowest valid user-ids are currently occupied [30]). Another way to sample a network Frontier Sampling, Random Walks, MCMC, Estimates, Power is by querying edges instead of vertices. Randomly sam- Laws, , Global Clustering Coefficient pling edges can be harder than randomly sampling vertices if edges are not be associated to unique IDs (or if edge IDs 1. INTRODUCTION cannot be randomly queried). We summarize some draw- A number of recent studies [7, 11, 15, 19, 20, 26, 30, 29, backs of random vertex and edge sampling: 36] (to cite a few) are dedicated to the characterization of Random edge sampling may be impractical when edges complex networks. A complex network is a network with • cannot be randomly queried (e.g., online social net- non-trivial topological features (features that do not occur works like Facebook [15], MySpace [30], and Twitter or a P2P network like Bittorrent). Random vertex sampling may be undesirable when • Permission to make digital or hard copies of all or part of this work for user-ids are sparsely populated (low hit-to-miss ratio) personal or classroom use is granted without fee provided that copies are and queries are subject to resource constraints (e.g., not made or distributed for profit or commercial advantage and that copies queries are rate-limited in Flickr, Livejournal [26], and bear this notice and the full citation on the first page. To copy otherwise, to Bittorrent [18]). In a P2P network like Bittorrent, a republish, to post on servers or to redistribute to lists, requires prior specific client can randomly sample peers (vertices) by query- permission and/or a fee. IMC’10, November 1–3, 2010, Melbourne, Australia. ing a tracker (server); however, trackers may rate-limit Copyright 2010 ACM 978-1-4503-0057-5/10/11 ...$10.00. client queries [18].

390 Even when random vertex sampling is not severely We make two additional contributions: (1) we compare • resource-constrained, some characteristics may be bet- random walk-based estimates to those obtained from ran- ter estimated with random edge sampling (e.g., the tail dom vertex and random edge sampling. We show analyt- of the degree distribution of a graph). ically that the tail of the degree distribution is better es- An alternative, and often cheaper, way to sample a network timated using random edge sampling than random vertex is by means of a random walk (RW). A RW samples a graph sampling. We observe from simulations over real world net- by moving a particle (walker) from a vertex to a neighboring works (in Section 6.4) that FS accuracy is comparable to vertex (over an edge). By this process edges and vertices are the accuracy of random edge sampling. These results help sampled. The probability by which the random walker se- explain recent empirical results [29]; (2) we present asymp- lects the next neighboring vertex determines the probability totically unbiased estimators using the edges sampled by a by which vertices and edges are sampled. In this work we RW for the assortative mixing coefficient (defined in Sec- are interested in random walks that sample edges uniformly. tion 4.2.2) and the global clustering coefficient (defined in The edges sampled by RW can then be used to obtain un- Section 4.2.4). biased estimates of a variety of graph characteristics (we present two examples in Section 4). Outline In this work we assume that a random walker has the The outline of this work is as follows. Section 2 presents ability to query a vertex to obtain all of its incoming and the notation used in this paper. Section 3 contrasts ran- outgoing edges (Section 4 details the reason behind this as- dom vertex with random edge sampling. Section 4 revisits sumption). This is possible for online networks such as Twit- single and multiple independent random walk sampling and ter, LiveJournal [26], YouTube [26], Facebook [15], MyS- estimation. Section 5 introduces Frontier Sampling (FS), a pace [30], P2P networks [29], and the arXiv citations net- sampling process that uses m dependent random walkers in work. We revisit the theory behind random walks in Sec- order to mitigate the high estimation errors caused by dis- tion 4. connected or loosely connected components. Section 5 also Sampling graphs with random walks is not without draw- shows that FS can be seen as an m-dimensional random backs. The accuracy of the estimates depends not only on walk over the m-th Cartesian power of the graph (formally the graph structure but also on the characteristic being es- defined in Section 5). In Section 6 we see that FS outper- timated. The graph structure can create distortions in the forms both single and multiple independent random walkers estimates by “trapping” the random walker inside a sub- in a variety of scenarios. We also compare (independent) graph. An extreme case happens when the graph consists random vertex and edge sampling with FS. Section 7 re- of two or more disconnected components (subgraphs). For views the relevant literature. Finally, Section 8 presents our instance, wireless mobile social networks exhibit connection conclusions and future work. graphs with multiple disconnected components [11]. But even connected graphs can suffer from the same problem. A random walker can get “temporarily trapped” and spend 2. DEFINITIONS most of its sampling budget exploring the local neighbor- In what follows we present some definitions. Let Gd = hood near where it got “trapped”. In the above scenarios (V Ed) be a labeled directed graph representing the (origi- estimates may be inaccurate if the characteristics of the lo- nal) network graph, where V is a set of vertices and Ed is a cal neighborhood differ from the overall characteristic of the set of ordered pairs of vertices (u v) representing a connec- graph. This problem is well documented (see [21]) and our tion from u to v (a.k.a. edges). We assume that each vertex goal is to mitigate it. in Gd has at least one incoming or outgoing edge. The in- Contributions degree of a vertex u in Gd is the number of distinct edges (v1 u) (vi u) into u, and its out-degree is the number This work proposes a new m-dimensional random walk sam- of distinct edges (u v1) (u vj ) out of u. Some com- pling method (Frontier sampling) that, starting from a col- plex networks can be modeled as undirected graphs. In this lection of m randomly sampled vertices, preserves all of the case, when the original graph is undirected, we model Gd as important statistical properties of a regular random walk a symmetric directed graph, i.e., (u v) Ed (v u) Ed. ∀ ∈ ∈ (e.g., vertices are visited with a probability proportional to Let v and e be a finite set of vertex and edge labels, L L their degree). While the vertices are visited with a proba- respectively. Each edge (u v) Ed is associated with a set ∈ bility proportional to their degree, we show that the joint of labels e(u v) e. For instance, the label of edge (u v) L ⊆ L steady state distribution of Frontier Sampling (the joint dis- can be the in-degree of v in Gd. Similarly, we can associate a tribution of all m vertices) is closer to uniform (the starting set of labels to each vertex, v(v) v v V . Some edges L ⊆ L ∀ ∈ distribution) than that of m independent random walkers, and vertices may not have labels. If edge (u v) is unlabeled for any m > 0. This property has the potential to dramati- then e(u v) = . Similarly, if vertex v is unlabeled then L ∅ cally reduce the transient of random walks. v(v) = . L ∅ In our simulations using real world graphs we see that When performing a random walk, we assume that a ran- Frontier Sampling mitigates the large estimation errors caused dom walker has the ability to retrieve incoming and outgoing by disconnected or loosely connected components that can edges from a queried vertex (and vertices are distinguish- “trap” a random walker and distort the estimated graph able). With this assumption we are able to build (on-the- characteristic, i.e., Frontier sampling (FS) estimates have fly) a symmetric directed graph while walking over Gd. Let smaller Mean Squared Errors (MSEs) than estimates ob- G = (V E) be the symmetric counterpart of Gd, i.e., tained from regular random walkers (single and multiple in- dependent walkers, reviewed in Section 4.4) in a variety of E = (u v) (v u) scenarios. { } ∀(uv)∈Ed

391 Note that G may not be connected. As G is symmetric, we 4. RANDOM WALK SAMPLING denote by deg(v) to be the in-degree or the out-degree of In this section we review random walk (RW) sampling and v V as they are equal. Let vol(S) = deg(v) S ∈ ∀v∈S ∀ ⊆ estimation over a non-bipartite, connected, directed, sym- V , denote the volume of the vertices in S. metric graph G. Sampling G with a RW is straightforward. ˆ Let θl be the estimated fraction of vertices with label l The random walker has a sampling budget B and starts at obtained by some estimator. The two error metrics used in vertex v0 V . For the sake of simplicity, unless stated oth- most of our examples are the normalized root mean square erwise, we∈ consider that all queries to vertices have unit cost ˆ error of θl, which is a normalized measure of the dispersion and that we have a fixed sampling budget B. B of the estimates, defined as Let (ui vi) be the a sequence of edges sampled by a { }i=1 RW, where ui = vi−1 i = 2 B. Note that edges may 2 E[(θˆl θl) ] NMSE(l) = − (1) be sampled multiple times. We refer to (ui vi) as the i-th θ l sampled edge. At the i-th step a walker at vertex vi chooses an outgoing edge (v u ) uniformly at random from the set and the normalized root mean square error of the Com- i i of outgoing edges of v and adds (v u ) to the sequence of plementary Cumulative Distribution Function (CCDF) γ = i i i ∞ sampled edges. At step i + 1 the random walker starts at γl , where γl = k=l+1 θk, defined as { } vertex ui and the sampling continues until i = B.

2 The RW described here is the most common type of RW E[(γ ˆl γl) ] CNMSE(l) = − (2) found in the literature [22]. Other types of random walks γ l differ in the way in which outgoing edges are sampled. The Metropolis-Hastings RW [38] is an example of a random For the sake of simplicity, and unless stated otherwise, in the remainder of this paper we assume that all queries of walk that samples vertices (not edges) uniformly at random. edges and vertices have unitary cost and that we have a However, experiments estimating a variety of metrics indi- cate that Metropolis-Hastings RW is less accurate than the fixed sampling budget B. random walk described in this work [15, 29]. For more de- tails about other types of RW please refer to [32, Chapter 7]. 3. VERTEX V.S. EDGE SAMPLING An important property of a RW is its ability to reach a We consider a straightforward estimation problem to il- unique stationary regime. A necessary condition for sta- lustrate a tradeoff between random edge and random ver- tionarity is that G must be symmetric, connected, and non- tex sampling. Consider the problem of estimating the out- bipartite (the non-bipartite assumption can be relaxed in a lazy random walk [22]). In a stationary RW, the se- degree distribution of Gd. Let θi be the fraction of vertices with out-degree i > 0 and d be the average out-degree. Let quence of sampled edges is a stationary sequence. A se- quence X1 X2 of random variables is said to be station- the label of vertex u, v(u), be the out-degree of u. We as- sume that d is known;L also assume that from an edge (u v) ary if for any positive integers n and k, the joint distribu- tion of (Xn Xn+k) is independent of n. Once the RW we can query v(u). In random edge sampling the proba- bility of samplingL a vertex with out-degree i is proportional reaches steady state, it also shares two important properties with random edge (RE) sampling. First, both RW and RE i: πi = i θid. On the other hand, random vertex sam- sample edges uniformly at random [22], which means that pling samples a vertex with out-degree i with probability θi. A straightforward calculation shows that the NMSE (equa- the probability that a vertex v is sampled is deg(v)vol(V ) tion (1)) of B randomly sampled edges with out-degree i Second, both RW and RE obey the strong law of large num- is bers, as we see next.

NMSE(i) = (1πi 1)B i > 0 (3) − 4.1 Strong Law of Large Numbers Similarly, the NMSE(i) for random vertex sampling is The following variation of the strong law of large num- bers is a powerful tool to build (asymptotically) unbiased NMSE(i) = (1θi 1)B (4) estimators of graph characteristics. We provide a trivial − extension of a well known result [25, Theorem 17.2.1] to Now note that πiθi = id, which means that πi > θi if the case where we are interested in a subset of the graph ⋆ i > d and πi < θi if i < d. From equations (3) and (4) we edges. Let E E be non-empty. Let (ui vi) be the i-th ⊆ ⋆ ⋆ see that random edge sampling more accurately estimates RW sampled edge such that (ui vi) E ; and let B (B) degrees larger than the average (i > d) while random vertex be the number of such samples, where∈ B is the number of sampling more accurately estimates degrees smaller than the RW steps. B⋆(B) is a random variable that represents the average (i < d). This means random edge sampling exhibits number of RW sampled edges that belong to E⋆. Note that smaller NMSE when estimating the tail of the out-degree B⋆(B) B. distribution. ≤ Above we have seen that random edge sampling is more Theorem 4.1 (SLLN). For any function f, where accurate than random vertex sampling in estimating the tail f(u v) < , of the out-degree degree distribution. A similar result hap- (uv)∈E⋆ | | ∞ pens with the in-degree distribution and the degree distri- B⋆ (B) bution of undirected networks. The above analysis explains 1 1 real world experiments [29]. Unfortunately, as discussed in lim f(ui vi) f(u v) B→∞ B⋆(B) → E⋆ Section 1, random edge sampling is rarely practical. In what i=1 | | ∀(uv)∈E⋆ follows we see that, if G is connected, random walks exhibit similar statistical properties to random edge sampling. almost surely, i.e., the event occurs with probability one.

392 Proof. Let with the edges in E⋆ sampled by a stationary RW gives the following estimator 1 if (u v) E⋆ and h(u v) = ∈ 0 otherwise. B⋆ (B) 1(l e(ui vi)) pˆl ∈ L (5) As the RW is stationary (and edges are sampled uniformly) ≡ B⋆(B) i=1 B f(ui vi)h(ui vi) ∀(uv)∈E f(u v)h(u v) lim i=1 It follows directly from Theorem 4.1 (with f(u v) = 1(l B→∞ B → h(u v) ∈ i=1 h(ui vi) ∀(uv)∈E a.s. e(u v))) that limB→∞ pˆl pl. Moreover, from the lin- L → ⋆ almost surely [25, Theorem 17.2.1]. The proof follows from earity of expectation, E[ˆpl] = pl for all values of B (B) > 0. ⋆ B noting that B (B) = i=1 h(ui vi) and that h(u v) = 0 (u v) E E⋆. 4.2.2 Assortative Mixing Coefficient ∀ ∈ The assortative mixing coefficient [27] is a measure of the Theorem 4.1 allows us to construct estimators of graph char- correlation of labels between two neighboring vertices. By acteristics that converge to their true values as the number appropriately assigning edge labels derived from vertex la- of RW samples goes to infinity (B ). If we are try- bels, we can use the density estimator of equation (5) to →⋆ ∞ ⋆ ing to estimate vertex labels we set E = E and B = B. derive an estimator of the assortative mixing coefficient. In In what follows we apply Theorem 4.1 to estimate graph order to simplify our exposition, we restrict our analysis to characteristics; we also present four examples of estimators. the assortative mixing of vertex degrees in a directed graph (equation (25) of [27]). It is trivial to extend our analysis 4.2 Estimators to other types of assortative mixing coefficients, e.g., equa- An estimator is a function that takes a sequence of obser- tions (21) and (23) of [27]. vations (sampled data) as input and outputs an estimate of Let (outdeg(u) indeg(v)) denote the label of a directed ⋆ a unknown population parameter (graph characteristic). In edge (u v) in G that also exists in Gd; and let E be the set ⋆ this section we see how we can estimate graph characteristics of all such edges (E = Ed). Let pij denote the fraction of using the edges sampled by a RW. labeled edges with label (i j). Let Wout (Win) denote the We present estimators of the following four graph charac- maximum observed out-degree (in-degree) of Gd in the RW. teristics: the edge label density (the fraction of edges with The degree assortative mixing coefficient [27] of a directed a given label in the graph), the assortative mixing coeffi- graph can be estimated using cient [27], the vertex label density, and the global clustering coefficient [34]. Designing these estimators is straightfor- Wout Win 1 out in ward: rˆ ij(ˆpij qˆi qˆj ) ≡ σˆin σˆout − i=0 j=0 (1) First we find a function f that computes the charac- teristic of G using E; where

(2) then we replace E with the sequence of edges sampled B⋆ (B) by a stationary RW. 1(outdeg(uk) = i indeg(vk) = j) pˆij ; ≡ B⋆(B) k=1 In what follows we illustrate how to build an estimator of the edge label density.

4.2.1 Edge Label Density Win Wout out in qˆi pˆik ;q ˆj pˆkj ; We seek to estimate the fraction of edges with label l e ≡ ≡ ∈ L k=0 k=0 in Gd among all edges (u v) that have labels, i.e., e(u v) = L . Edge labels can be anything, from social networking la- 2 ∅ Wout Wout bels to the amount of IP traffic over each link in a com- 2 in in σˆin = j qˆ jqˆ ; and puter network. An edge label can be, for instance, a tuple j − j i=0 i=0 (outdeg(u) indeg(v)) where outdeg(u) is the out-degree of u 2 and indeg(v) is the in-degree of v in the original graph Gd. Win Win ⋆ 2 in out For now we assume that we know E. Let E be the non- σˆout = i qˆ iqˆ i − i empty subset of E for which there are labels. Let pl denote i=0 i=0 ⋆ the fraction of edges in E with label l; it is clear that whereσ ˆin andσ ˆout are the standard deviation of the distri- 1(l e(u v)) in out pl = ∈ L butionq ˆ (ˆq ). As the estimatep ˆ (equation (5)) asymp- E⋆ i j ij ∀(uv)∈E⋆ | | totically converges almost surely to its true value, it is trivial in out to show thatq ˆi ,q ˆj ,σ ˆin, andσ ˆout also asymptotically con- where verge almost surely to their true values. Thus,r ˆ asymptoti-

1 if l e(u v) cally converges, almost surely, to the true assortative mixing 1(l e(u v)) = ∈ L ∈ L 0 otherwise coefficient of [27], as long as σin > 0 and σout > 0. This im- plies thatr ˆ is an asymptotically unbiased estimator of the ⋆ Let B (B) be the number of RW sampled edges that belong assortative mixing coefficient of Gd. ⋆ ⋆ to E and (ui vi) be the i-th of such edges. Replacing E

393 4.2.3 Vertex Label Density where

Let v(v) be the set of labels associated with vertex v v B L ∀ ∈ 1 1 V . The fraction of vertices with label l in G, θl, is S = B deg(vi) i=1 1 1(l v(v)) θl = ∈ L (6) V deg(v) Corollary 4.2. ˆ | | ∀(uv)∈E limB→∞ C C almost surely. → Proof. as G = (V E) is directed and symmetric. By replacing E From Theorem 4.1 with a sequence of edges sampled by a stationary RW (here lim S V ⋆ E we have E⋆ = E and B⋆ = B) and renormalizing, we arrive B→∞ →| | | | at the following estimator for θl almost surely. Also from Theorem 4.1 B B 1 1(l v(vi)) ˆ 1 f(vi ui) 1 1 f(v u) θl ∈ L (7) lim ≡ SB deg(vi) deg(vi) deg(v) i=1 B→∞ B deg(vi) → E i=1 2 | | ∀(vu)∈E 2 B where S = 1B i=1 1 deg(vi) From Theorem 4.1 we have almost surely, which together with the almost sure conver- limB→∞ S V E , almost surely. Using again Theo- gence of S implies that limB→∞ Cˆ C, almost surely. rem 4.1 we→ have || | | → B Note that almost sure convergence implies that Cˆ is an 1 1(l v(vi)) 1 1(l v(v)) lim ∈ L ∈ L asymptotically unbiased estimator of C. B→∞ B deg(vi) → E deg(v) i=1 | | ∀(uv)∈E 4.3 Estimator Accuracy & Graph Structure almost surely, which divided by V E yields equation (6). | | | | Sampling a graph using a RW is not without drawbacks. As S converges almost surely to V E , we have limB→∞ θˆl A random walker can get (temporarily) “trapped” inside a | | | | → θl, almost surely. This also implies that θˆl is an asymptoti- subgraph whose characteristics differ from those of the whole cally unbiased estimator of θl. graph. Even if the random walker starts in steady state (i.e., is stationary), this scenario may increase the mean squared 4.2.4 Global Clustering Coefficient error of the estimates. If the random walker does not start In the literature the term clustering coefficient often refers in steady state, this scenario may cause an increase in the to the local clustering coefficient [37]. In our example we estimation bias as well as the mean squared error. Ideally, estimate a different metric: the global clustering coefficient. the random walker needs to mitigate the effect of these traps In a social network the global clustering coefficient, C, is on the estimates. the probability that the friend of John’s friend is also John’s The above two types of estimation errors are well doc- friend [34]. Let V ⋆ be the set of vertices v V with deg(v) > umented in the literature and various solutions are avail- 1. The global clustering coefficient of an∈ undirected graph able [14]. For instance, if the random walker does not start is defined as [34] in a stationary regime (transient), it is common practice to discard the first w samples [14]. The value of w is called the 1 C c(v) (8) burn-in period. There are two problems with this solution: ≡ V ⋆ | | ∀v∈V (1) it only reduces the error related to the non-stationarity of the samples; (2) it is difficult to determine a good value where for w if the sampling budget is small (compared to the size ∆(v) deg(v) if deg(v) 2 of the graph) and the size and structure of G are unknown. c(v) = 2 ≥ 0 otherwise A simple naive solution to the RW “trapping” problem (adopted in [15] to sample Facebook), is to sample the graph where ∆(v) = (u w) E :(v u) E and (v w) E is using multiple independent random walkers [14]. In what |{ ∈ ∈ ∈ deg(}|v) follows we see that this naive approach can lead to increased the number of triangles that contain vertex v and 2 is the maximum number of triangles that a vertex v with estimation errors. In Section 5 we propose a method to mit- degree deg(v) can belong to. igate the random walk “trapping” problem using m depen- Note that finding ∆(v) for a given vertex v V requires dent random walkers. knowing all vertices within two hops of v, which∈ can be a resource intensive task. To avoid the cost of computing ∆, 4.4 Multiple Independent Random Walkers we rewrite equation (8) The main problem of estimating graph characteristics us- ing a single walker is that the walker may get trapped inside 1 f(v u) C = a local neighborhood. But there is the question of what V ⋆ deg(v) | | ∀(vu)∈E 2 happens if we could start m independent random walkers (MultipleRW) at m independently sampled vertices in the where f(v u) gives the number of shared neighbors between graph. Note that when m = 1 we are back to sampling G u and v. using a single random walker, which we denote as SingleRW. Let (vi ui) be the i-th sampled edge in a stationary RW Networks such as MySpace, Facebook, and Bittorrent admit and let random (uniform) vertex sampling at cost c higher than the B cost of sampling the neighbors of a known vertex (which is ˆ 1 f(vi ui) 1 what a RW does). In such networks random vertex sampling C deg(v ) ≡ SB i deg(vi) i=1 2 may help us start m random walkers at different parts of the

394 graph. While the value of c can be large, initializing m ran- ance between pA and pB has the potential to introduce large dom walkers with uniformly sampled vertices costs (only) MSEs (and biases). Note that increasing m does not change mc units of our sampling budget (where one unity of the pA and pB. Increasing B only mitigates this problem if G budget is the cost of sampling a vertex in a RW). is connected and, in a loosely connected graph, only large values of B positively impact the MSE. Ideally we want a ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++ ++++ ++ RW algorithm that does not rely on large sampling budgets + 3333333333 333333333333333333333333333 333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333 B to achieve low estimation errors. 333333 02 333 33 Now consider the same thought experiment where each 3 random walker starts in GA and GB (independently) with 01 probabilities hA = vol(VA)vol(V ) and hB = vol(VB )vol(V ), respectively. In this new scenario it is easy to see that

CNMSE + pA = pB = 1vol(V ) = 1vol(V ). Thus, we would like SingleRW 3 MutipleRW (m = 10) + to start a RW at vertex v with probability deg(v)vol(V ), 3 v V . Section 6 shows that in practice this approach ∀can∈ successfully mitigate estimation errors caused by discon- 002 nected components. Unfortunately, it is difficult to sample 0 10 102 104 105 vertex in-degree m mutually independent vertices with probabilities propor- tional to their degrees. In the case where G is connected, this Figure 1: (Flickr) The log-log plot of the CNMSE of the in-degree is equivalent to jointly start m independent random walkers distribution estimates with budget B = |V |10. in steady state. In networks such as MySpace, Facebook, and Bittorrent it is unclear how one can (efficiently) sample Unfortunately, m independent random walkers starting at vertices with probabilities proportional to their degrees. m randomly sampled vertices may decrease estimation ac- We want an m-dimensional random walk that, in steady curacy. Consider the following experiment where each of state, samples edges uniformly at random but, unlike the m random walkers (independently) performs Bm c MultipleRW, can benefit from starting its walkers at uni- steps. We seek to estimate the CCDF (complementary⌊ − cu-⌋ formly sampled vertices. mulative distribution function) of the in-degree of the Flickr graph (the Flickr dataset is summarized in Table 1). Accord- ing to Table 1 the Flickr graph is disconnected. The goal 5. FRONTIER SAMPLING (FS) of this simulation is to compare the estimation accuracy of SingleRW and MultipleRW when there are no disconnected In this section we present a new and promising approach components. For this we set c = 1. The sampling budget to an m-dimensional random walk that benefits from start- is B = 171 525 = V 10, which amounts to a sampling ing its walkers at uniformly sampled vertices. Frontier Sam- budget equivalent to| 10%| of the vertices in the graph. Fig- pling (FS) performs m dependent random walks in the graph. ure 1 shows a log-log plot of the CNMSE, equation (2), of We refer to m as the dimension of the FS random walk. SingleRW and MultipleRW (m = 10) averaged over 10 000 Let c be the cost of randomly sampling a vertex. The FS runs. Note that the estimates obtained by SingleRW are, algorithm, given in Algorithm 1 is a centrally coordinated on average, more accurate than the estimates obtained by sampling algorithm that maintains a list of m vertices rep- MultipleRW. Increasing the sampling budget B does not re- resenting m random walkers. This way FS is less likely to duce the gap. In Section 6 we see, over other real-world graphs, that when starting random walkers from uniformly Algorithm 1: Frontier Sampling (FS). sampled vertices, MultipleRW has higher estimation errors 1: n 0 {n is the number of steps} than SingleRW. ← 2: Initialize L = (v1 vm) with m randomly chosen 4.5 Disconnected Graph Example vertices (uniformly) The following example shows a situation in which both 3: repeat MultipleRW and SingleRW have large estimation errors. In 4: Select u L with probability deg(u) deg(v) ∈ ∀v∈L this example we initialize MultipleRW with m randomly 5: Select an outgoing edge of u,(u v), uniformly at (uniformly) sampled vertices. We simplify our exposition by random assuming that each MultipleRW walker takes Bm steps, 6: Replace u by v in L and add (u v) to sequence of where B (the sampling budget) is a multiple of m. Let sampled edges G = (V E) be an undirected graph that has two large dis- 7: n n + 1 ← connected components G = (V E ) and G = (V E ). 8: until n B mc A A A B B B ≥ − Let VA = VB and vol(VA) > vol(VB). When initial vertices| | are uniformly| | sampled, the probability that each MultipleRW walker (independently) starts in GA (GB ) is get stuck in loosely connected components than a single ran- hA = VA V (hB = VB V ). Recall that GA and GB are dom walker. However, in Section 5.2 we see that the joint disconnected.| | | | For each| random| | | walker, after Bm (B 1) steady state distribution of FS is much closer to the uniform ≫ RW steps, an edge (uA vA) EA is sampled with probabil- distribution than is the steady state distribution of m inde- ∈ ity pA hAvol(VA). Similarly an edge (uB vB ) EB is pendent random walkers. Section 5.3 describes how the FS ≈ ∈ sampled with probability pB hB vol(VB). Thus pA < pB , algorithm can be made fully distributed. In Section 6 we ≈ i.e., the edges in GB are sampled with higher probability see that, if the initial set of random walk vertices is chosen than the edges in GA. As our estimators assume that all uniformly at random, FS estimates are more accurate than edges are sampled with the same probability, this imbal- both single and m independent random walkers.

395 Frontier Sampling: An m-dimensional Random Walk Proof. The proof is found in our technical report [31]. FS shares many of the same statistical properties of a sin- gle random walker. The key insight behind Theorem 5.2 In Section 4.5 we observed that, when starting multiple RWs, below is that the FS stochastic process is equivalent to the the MSE is reduced when the number of walkers inside each stochastic process of a single random walker over the m-th subgraph matches the number obtained when the graph is Cartesian power of G, Gm = (V m E ), where m connected and all walkers are in steady state. In what fol- m V = (v1 vm) v1 V vm V lows we see that, in steady state, the average number of { | ∈ ∧ ∧ ∈ } MultipleRW walkers in VA is far from the average number is the m-th Cartesian power of V and v u V m,(v u) ∀ ∈ ∈ obtained with m uniformly sampled vertices. In contrast, Em if exists an index i such that (vi ui) E and uj = vj Section 5.2 shows that as m , by uniformly sampling for j = i. ∈ → ∞ the starting vertices, FS starts in steady state with respect to the number of random walkers in any subset of vertices α β VA V . ⊆ u v k v 5.1 MultipleRW Steady State v.s. Uniform Dis- α β Legend tribution α ζ α = 1(deg(u) + deg(v)) Consider a MultipleRW process with m walkers and let ω u h β = 1(deg(k) + deg(v)) Kmw(m) be a random variable that denotes the steady state number of MultipleRW random walkers in V . Let α = ζ = 1(deg(u) + deg(h)) A A j v E[Kmw(m)]E[Kun(m)] be the ratio between the steady ζ ω = 1(deg(j) + deg(v)) state number of MultipleRW in VA and the number of ran- ω ω dom walkers that start in VA from uniformly sampled ver- tices. As all random walkers are independent we have Figure 2: Illustration of the Markov chain associated to the Fron- tier sampler with dimension m = 2. m VA dA E[Kmw(m)] = | | V d Lemma 5.1. The Frontier sampling process is equivalent | | to the sampling process of a single random walker over Gm. It is also easy to see that Proof. m VA Consider the (n 1)-st step of FS. The reader E[Kun(m)] = | | − V may find Figure 2 helpful in following the proof. Let Ln = | | (v1 vm) be the state of FS before the n-th step. Clearly From the above we have m Ln V . Let e(Ln) denote the collection of all edges as- ∈ sociated to the vertices in Ln. We refer to e(Ln) as the αA = E[Kmw(m)]E[Kun(m)] = dAd edge frontier at the n-th step. We describe the transition Note that the value of αA may be quite large or close to zero from state Ln to state Ln+1 as follows (lines (4) and (5) of depending on both (1) the choice of VA and (2) the average the FS algorithm): Select a vertex v Ln with probability ∈ degree of G. proportional to deg(v) and then replace vertex v in Ln with one of its neighbors (selected uniformly at random). This is 5.2 FS Steady State v.s. Uniform Distribution equivalent to randomly sampling an edge from e(Ln) with Let G = (V E) be a connected graph and VA V be a probability ⊂ proper subset of V ; define VB = V VA. Let dA = vol(VA) VA | | 1 1 dB = vol(VB) VB , and d = vol(V ) V be the average de- p = = | | | | e(Ln) deg(v) grees of the vertices in VA, VB , and V , respectively. Consider | | ∀v∈Ln a FS process with m walkers and let Kfs(m) be a random Therefore, Ln transits to state Ln+1 iff (Ln Ln+1) Em variable that denotes the number of random walkers in V in ∈ A and the transition probability from Ln to Ln+1 is 1 e(Ln) . steady state. Let K (m) be a random variable that denotes | | un Thus, the Markov chain that describes FS is equivalent to the number of sampled vertices, out of m uniformly (ran- m the Markov chain of a single random walker over G . domly) sampled vertices from V , that belong to VA. Kun(m) m k m−k has distribution P [Kun(m) = k] = p (1 p) k Theorem 5.2. Recall that G is a directed symmetric graph. k − ∀ ≥ 0 where p = VA V . In this section we show that Kfs(m) If G is connected and non-bipartite, then in steady state FS | | | | and Kun(m) converge to the same limiting distribution, i.e., has the following properties: lim P [Kfs(m) = k] = lim P [Kun(m) = k] k 0 (9) (I) edges are sampled uniformly at random and form a m→∞ m→∞ ∀ ≥ stationary sequence, Recall that the FS algorithm starts m random walkers at m uniformly sampled vertices (sampled independently). Let (II) has distribution, L∞ = (v1 vm), equal to VA V . As m increases, eq. (9), the number of FS walkers m ⊆ deg(vi) that are initially selected to be in VA approaches the steady i=1 , m V m−1vol(V ) state distribution (assuming G is connected). | | Let L V m be the state of FS; from (Theorem 5.2) we which is unique, and have ∈ m (III) the sequence of sampled edges satisfies the Strong Law deg(vi) P [L = (v v )] = i=1 of Large Numbers (Theorem 4.1). 1 m m V m−1vol(V ) | |

396 Graph Flickr LiveJournal YouTube Internet RLT Description Social Net. Social Net. Social Net. Internet tracert. Type of graph Directed Directed Directed Directed # of Vertices 1 715 255 5 204 176 1 138 499 192 244 Size of LCC 1 624 992 5 189 809 1 134 890 609 066 # of Edges 22 613 981 77 402 652 9 890 764 609 066 Average Degree 122 146 87 32 wmax 2232 1029 3305 335 % of Original Graph 269% 954% NA NA

Table 1: Summary of the graph datasets used in our simulations. “Size of LCC” refers to the size of the largest connected component and wmax is the value of the largest vertex degree divided by the average degree.

− In the following lemma we find the probability that Kfs(m) = c m], for large enough values of c. Let k (m) = mp − k, 0 k m. z(m) mp(1 p) and k+(m) = mp + z(m) mp(1 p), ≤ ≤ − − Lemma 5.3. where z(m) = o(√6 m)1 is a slow increasing function of m. Note that 1 m k m−k P [Kfs(m) = k] = p (1 p) (k dA +(m k)dB) md k z(m)√m p(1 p)(dA dB ) 46 − − − − = o(m )m m d where p = VA V and 0 k m. | | | | ≤ ≤ and, thus, eq. (12) yields Proof. P [Kfs(m) = k] is the sum of the probabilities − − P [L = (v v )] over all states L in which exactly k k (m) dA + (m k (m))dB 1 m lim − = 1 (13) vertices belong to VA. Consider vi, the i-th element of L. m→∞ m d When vi VA, the contribution of vi towards P [Kfs(m) = and k] is ∈ + + k (m) dA + (m k (m))dB k−1 m−k m−1 lim = 1 (14) VA VB deg(vi)(m V vol(V )) ; − | | | | | | m→∞ m d − when vi VB , the contribution of vi towards P [Kfs(m) = k] All that is left to show is that limm→∞ P [Kun(m) < k (m)] = ∈ + is 0 and limm→∞ P [Kun(m) > k ] = 0. Using an extension of k m−k−1 m−1 VA VB deg(vi)(m V vol(V )) the de Moivre-Laplace limit theorem shown in [12, pg. 193] | | | | | | yields Summing over all elements in L and over all vertices yields − lim P [Kun(m) < k (m)] = 0 and k m−k m→∞ m VA VB (15) P [Kfs(m) = k] = | |m|−1 | + k m V vol(V ) lim P [Kun(m) > k (m)] = 0 | | m→∞ k m−k deg(u ) deg(t ) Putting together eqs. (11), (13), (14), and (15), with i + j (10) × VA VB  k(m) dA + (m k(m))dB i=1 ∀ui∈VA | | j=1 ∀tj ∈VB | | lim − < k(m) = o(m)  m→∞ m d ∞ 1 m k m−k = p (1 p) (k dA + (m k)dB ) yields m d k − − lim P [Kfs(m) = k] = lim P [Kun(m) = k] k 0 m→∞ m→∞ ∀ ≥ The previous lemma gives the probability that a subset of which concludes our proof. vertices VA has Kfs(m) 0 m FS random walkers. ∈ { } We have seen as m gets larger, FS gets closer to starting The following theorem shows that Kfs(m) and Kun(m) con- verge to the same limiting distribution. in steady state with respect to the number of FS random walkers inside VA, VA V . Theorem 5.4. We have seen that∀ if we⊂ initialize m random walkers with limm→∞ P [Kfs(m) = k] = limm→∞ P [Kun(m) = k] k uniformly sampled vertices, FS starts closer to steady state 0 ∀ ≥ than MultipleRW. In what follows we show that FS is well Proof. From Lemma 5.3 suited to be used in large scale (parallel, asynchronous) ex- periments without incurring in any coordination or commu- k dA + (m k)dB nication costs between the random walkers. P [Kfs(m) = k] = − P [Kun(m) = k] (11) m d Note that if k = mp we have 5.3 Distributed FS FS is well suited to be used in large scale (parallel, asyn- vol(VA) vol(VB ) mpdA + (m mp)dB m |V | + m |V | chronous) experiments. Let B be the budget of FS. In the − = = 1 (12) m d m d distributed version of FS the budget is not directly related to the number of sampled vertices obtained by the algorithm. As m , the probability mass of P [Kun(m) = k] gets → ∞ 1 highly concentrated around the interval k [mp c√m mp+ f(m) = o(h(m)) implies limm→∞ f(m)h(m) = 0. ∈ −

397 This is because distributed FS is achieved using multiple in- of all vertices. Our results show that FS estimates are consis- dependent random walkers where the cost of sampling a ver- tently more accurate than their SingleRW and MultipleRW tex v is an exponentially distributed random variable with counterparts. Moreover, when restricted to the largest con- parameter deg(v). In what follows we show, using the Uni- nected component, FS reaches steady state faster than Sin- formization principle of Markov chains [8, Chapter 7.5] and gleRW and MultipleRW in the simulations presented in our the Poisson decomposition property, that FS can be made technical report [31]. fully distributed. 6.1 Assortative Mixing Coefficient Theorem 5.5. A MultipleRW sampling process where the In our first experiment we treat the graphs in Table 1 cost of sampling a vertex v is an exponentially distributed as undirected graphs. In-degrees and out-degrees are repre- random variable with parameter deg(v) is equivalent to a sented as vertex labels and the assortative mixing coefficient FS process. is obtained using the estimator described in Section 4.2.2. Proof. Consider the following Distributed FS (DFS) pro- In our experiment we average the estimates and calculate cess. Let χ = L(τ) V m : τ R⋆ be the Markov chain their mean squared error (MSE) over 100 runs. The sam- associated with{ a random∈ walker∈ over} Gm = (V m E ), the pling budget is V 100 for all graphs. Letr ˆ denote the m | | m-th Cartesian power of G, with transition rate matrix estimated value of r. Table 2 shows a summary of the rel- ative bias ofr ˆ (1 E[ˆr]r) andr ˆ’s NMSE with respect to Q = A D − − the true value of r. We observe that FS is consistently more m accurate than both MultipleRW and SingleRW. If we focus where A is the adjacency matrix of G , Aij 0 1 i j, ∈ { } ∀ on Flickr, the FS bias is 7 fold smaller than the bias of both and D is a diagonal matrix with Dii = Aij . We ∀j MultipleRW and SingleRW. In addition FS’s NMSE is one observe this FS process over the interval [0 B]. order of magnitude smaller than the NMSEs of MultipleRW In the DFS process, the probability that thek-th random and SingleRW. The Internet graph (“Internet RLT”) is the walker transitions out of vertex vk at step τ + ∆ depends only on deg(v ) and not on the state of L(τ). Thus, we can only graph we studied that shows little difference between k FS and MultipleRW. decompose the Poisson process describing a departure from ′ We also perform an extreme experiment that focuses on the state L = (v v ) into m independent stochastic n 1 m the impact of loosely connected components on the assorta- processes, where the i-th process is a Poisson process with tive mixing estimates. Consider a graph that consists of two parameter λ = deg(v ) i = 1 m. The above is equiva- i i instances of a random undirected Barabási-Albert [5] graph, lent to the stochastic process of a MultipleRW process with 5 m random walkers and budget B, where the cost of sampling GA and GB , with 5 10 vertices each and average degrees 2 and 10, respectively,× joined by a single edge connecting a vertex v is an exponentially distributed random variable the two smallest degree vertices in G and G (ties are re- with rate deg(v). A B solved arbitrarily). Henceforth, we use G to denote the The DFS is equivalent to a FS process via the Uniformiza- AB above graph. It is worth noting that over the G graph, tion property of Markov chains [8, Chapter 7.5]. The tran- AB sition probability matrix of the Uniformized Markov chain SingleRW consistently findsr ˆ = 0 over all 100 runs. This is because SingleRW only estimated the assortative mixing (with unitary uniformization parameter) at the embedded of either subgraph A or subgraph B, which are both zero. transition points is Over GAB MultipleRW performs almost as bad as SingleRW P = I D−1Q = D−1A while FS is able to accurately estimate r. − which is also the transition probability matrix of a FS pro- 6.2 In- and Out-degree Distribution Estimates cess. We now focus on estimating the in-degree distribution. Let θ = θi ∀i∈L denote the in-degree distribution, where { } 6. RESULTS θi is the fraction of vertices with in-degree i. In our simu- ∞ In this section we compare FS with SingleRW and Multi- lations we estimate γi = k=i+1 θk, the CCDF of θ, using pleRW. We also contrast FS with random vertex and edge equation (7). We choose to estimate the CCDF instead of sampling. The experiments consist of executing these sam- the density because the CCDF is the plot of choice when it pling methods on a variety of real world graphs. The datasets comes to displaying degree distributions. Each simulation used in the simulations are summarized in Table 1: “Flickr”, consists of 10 000 runs (sample paths) used to compute the “Livejournal”, and “YouTube” are popular photosharing, empirical CNMSE (equation (2)). The CNMSE is used to blog (weblog), and video sharing websites, respectively. Users compare the accuracy of the estimates obtained from FS are represented as vertices of a graph. In these websites a (dimension m 10 1000 ), SingleRW, and MultipleRW user can subscribe to other user updates; an edge (u v) ex- (m 10 1000∈walkers). { } For the sake of conciseness, we ists between users u and v if user u subscribes to user v. At restrict∈ { our presentation} to a handful of representative re- “Livejournal” and “YouTube” it is possible to query the in- sults. coming and outgoing edges of a given user. Further details of Consider first two representative results from the Flickr these three datasets can be found in [26]. “Internet RLT” is graph, whose in-degree CCDF (complementary cumulative a router-level Internet graph collected from traceroute mea- distribution function) log-log plot is shown in Figure 3. The surements of 23 monitors distributed over the world [13]. sampling budget is B = 17 152 = V 100, which amounts Note that some of these graphs contain disconnected com- to sampling 1% of the vertices. In| the| first simulation, we ponents (subgraphs). are restricted to the Largest Connected Component (LCC) In the following simulations the starting vertex of each (which contains 94% of the vertices). The objective is to random walker is chosen uniformly at random from the set test if FS can outperform SingleRW and MultipleRW even

398 Graph r FS MultipleRW SingleRW Bias NMSE Bias NMSE Bias NMSE | | | | | | Flickr 0007 8% 108 752% 765 619% 2732 LiveJournal 007 05% 011 12% 016− 1% 017 Internet RLT 017− 3% 033− 2% 032 17% 044 Youtube 003 0001% 002 2% 003 1% 01 − − GAB 008 001% 012 70% 072 100% 100

Table 2: Assortative mixing coefficient estimate bias and the module of the estimator NMSE ; r is the true value of the global clustering coefficient and these values are estimated value over 100 runs. The sampling budget is |V |100 for all graphs.

3 3 2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 1 2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 3 22222222222 3 222222 33 222 333 05 22 33333333 3333 33 33333 2 333333333++++++++ 01 33333 33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333 ++ 333333 3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333 3333333333 3333 +++ 3333333333333333 02 33 ++++ 33333333333333333333 ++ 333333333333333333333 ++ −2 3333333333333333333333333333 ++++ 333333333333333333333333333333333333333333 ++++++++ 10 33333333333333333333333333333333333333333333333 ++++++++++++++++++++++++++++++++++++++++++++++ 33333333333333333333333333333333333333333333333333333333 01 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3333333333333333333333333333333333333333333333333333333333333333333333 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 333333333333333333333333333333333333333333333333333333333333333333333333333333 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 33333333333333333333333333333333333333333333333333333333333333333333333333333 +++++++++++++++++++++++++++++++++++++++++++++++++ − 333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333 ++++++++++ 3 33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333 +++++++ 10 33333333333333333333333333333333333333333333333333333333333333333333333 3 ++++ 333333333333333333333333333333333333333333333333333333333333 ++ 33333333333333333333333333333333333333333333 3333333333333333333333333333333333333 CCDF 333333333333333333 33333333333333333333 −4 3333333333333 002 33333333333 33 CNMSE 10 333333 3333 −2 33 33 10 33 2 − 33 SingleRW 3 5 33 10 3 + 3 FS (m = 1000) 33 + 2 33 MutipleRW (m = 1000) −6 3 10 3 −3 2 4 5 10 0 10 10 10 10 2 4 5 vertex in-degree 0 10 10 10 10 vertex in-degree Figure 3: (Flickr) Log-log plot of the in-degree CCDF. Figure 5: (Flickr) The log-log plot of the CNMSE of the in-degree 222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 distribution estimates with budget B = |V |100. 222222222222222222222222222 2222222222222222222222222222222222222222222222222222222222222222222222222222222 22222222 22222 05 222 22 ++++++++33333333 2 ++33 +++333 33++333333++ 02 3333++ 3333333333333333333333333333333++ 0.65 33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333++++ 33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333 ++++++++++++++ 3333333333333 +++++++++++++++++++++++++++++++++++++++++++ 01 3333333 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3333 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 0.6 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++ ++++++++ +++++ ++

) 0.55

002 n ( CNMSE −2 1 0.5 ˆ 10 θ 3 2 SingleRW 3 FS (m = 1000) + 0.45 + MutipleRW (m = 1000) 2 SingleRW 0.4 FS (m = 1000) − MultipleRW (m = 1000) 10 3 0.35 0 10 102 104 105 3 3 5 6 vertex in-degree 10 5 × 10 |V |100 1 × 10 10 Random walk steps (n) Figure 4: (LCC of Flickr) The log-log plot of the CNMSE of the in-degree distribution estimates with budget B = |V |100. Figure 6: (LCC of Flickr) Four sample paths of θˆ1 (θ1 = 053) as a function of the number of steps n (horizontal axis in log scale). when there are no disconnected components. Figure 4 shows value of θ1 as some vertices with in-degree one lie outside a log-log plot of the CNMSE of FS (m = 1000), SingleRW, the LCC. In one of the runs, SingleRW starts in a small dis- and MultipleRW (m = 1000). In this experiment FS out- connected component and, thus, grossly overestimates the performs both SingleRW and MultipleRW. It is interesting value of θ1. For a similar reason, i.e., walkers starting at to note that the estimates obtained by SingleRW are more small disconnected components, MultipleRW grossly over- accurate than the estimates obtained by MultipleRW. Now estimates the value of θ1. The MultipleRW rapid increase 3 consider the complete Flickr graph. Figure 5 shows a log-log of θˆ1 at around n = 10 steps needs further investigation. It plot of the CNMSE of the in-degree distribution estimates. may be due to the transient of the random walk (discussed Contrasting the plots shown in Figures 4 and 5 we see that in Section 4.4). Even when n 1 (not shown in Figure 6) ≫ the gap between FS and both SingleRW and MultipleRW the MultipleRW estimate is unable to converge to θ1. Modi- has significantly increased, favoring FS. fying both SingleRW and MultipleRW methods to cope with To better understand the differences between these sam- disconnected components is an interesting open problem. pling methods, Figure 6 focuses on four runs (sample paths) For the sake of conciseness, we omit the results of the of the simulation over the complete Flickr graph. Figure 6 simulations over the remaining graphs (Table 1) as they plots the evolution of θˆ1 (the estimate of θ1) as a function are similar to the results observed over the Flickr graph. of n (the number of steps in the random walk). At each run However, consider the out-degree distribution estimates of of the simulator both FS and MultipleRW start at the same Livejournal. Figure 7 shows a log-log plot of the CCDF of initial set of vertices (chosen using random vertex sampling). the out-degrees. The log-log plot of the CNMSE is shown Figure 6 shows that all four FS sample paths (runs) quickly in Figure 8 for FS (m = 100), SingleRW, and MultipleRW converge to the value of θ1. For SingleRW, three of the four (m = 100) with sampling budget B = V 10. From Fig- runs start inside the LCC. These runs do not converge to the ure 8 we see that estimates of vertices with| small| out-degrees

399 Moreover, as the starting vertex of each random walker is 3 3 1 33 3333 chosen uniformly at random, GA, which has the same num- 333333 333333 33333 3333 01 3333 ber of vertices as GB but 15 of the edges, receives more 3333 3333 3333 3333 33333 random walkers than its per edge “share”. Consequently, −2 3333333 333333333 10 333333333 333333333333 MultipleRW oversamples G . 3333333333333 A 333333333333333 3333333333333 −3 3333333333333333333 10 3333333333333333333333333333333 Figure 9 shows the results of four simulation runs and 3333333333333333333333333333333 333333333333333333333333333333 333333333333333333333333333333333333333333333333 333333333333333333333333333333333333333333333333333333333 ˆ 333333333333333333333333333333333333333333333333333333333333333 plots the evolution of the estimates of θ10 (θ10) as a function CCDF − 333333333333333333333333333333 4 3333333333333333333333333333333333333333 10 333333333333333333333333333333333333 33333333333333333333333 333333333333333333 33333333333 of the number of steps. In this simulation note that: (1) FS 333333333 −5 33333 333 10 3333 333 quickly converges to a value that is close to the correct value; 33 3 3 −6 3 (2) two out of the four SingleRW runs overestimate θ10 and 10 3 3 3 3 the remaining two underestimate it; (3) three out of the four

2 4 5 MultipleRW runs converge to the same, incorrect, fraction 0 10 10 10 10 vertex out-degree (underestimating the true value of θ10). FS is designed to be robust to disconnected or loosely connected components. All Figure 7: (Livejournal) Log-log plot of the out-degree CCDF. of the FS runs quickly converge to a good estimates of θ10. Figure 10 also shows that the CNMSE for FS is consistently lower than the CNMSE for SingleRW and MultipleRW. in FS are up to one order of magnitude more accurate than those obtained from both SingleRW and MultipleRW.

22222222222222 22222++223333333333333333 05 22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 222222222 22233333++++++++++++++ 22222222222222222222222222222 22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222333+++++ 2222222222 22222222222222222222222222222222222222222222222222222 33+++ 22222222 333333+++++333 333333333333333333333 2222 333333333333++++ 3 3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333 2222 33333333333+++++ 1 33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333 33333333333 22222 333++++++++++++++ 2222 +++++3++ 3 222222222222222 222222222222222222222 2222 3 3 222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 02 2222 333 333333333333333333333333333333333333333333333333333333333333333333333333333 +3 2 222222222222 2222222 2222 333 333333333333333333333333333333333 3333333333333333333333333333333333333333333333333333333333333333333333333333 333+ 3 2 22222 333 333 3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333+ 05 2222 3333 3333 3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333+ 22 33 33333 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 22 33 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 01 22 333 ++++++++++ +++++++++++++++++++ 2 3 333 +++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 3333333333 ++ 333333 3 ++ 3333333 ++++ 02 2 33333 ++ +++++ 3 3 ++ ++ +++ +++ +++ ++++++++++ +++ 01 +++++++ +++ +++++++ ++++ ++++ CNMSE +++ ++++ ++++ ++++++++++++++++++ 002 3 +++++ ++++++++++++++++++++++++++++++++++++++++++++++++++ +++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 +++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++ 3 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + SingleRW CNMSE +++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++ −2 + ++++++++++++++++ 10 FS (m = 1000) + + 2 3 + MutipleRW (m = 1000) 002 + SingleRW FS (m = 1000) + − 10 2 MutipleRW (m = 1000) 2

0 10 102 104 vertex in-degree 1 10 102 104 vertex in-degree Figure 8: (Livejournal) The log-log plot of the CNMSE of the out- degree distribution estimation with sampling budget B = |V |100 Figure 10: (GAB graph) The log-log plot of the CNMSE of the (CNMSE over 10 000 runs). degree distribution estimation with sampling budget B = |V |100 (CNMSE over 10 000 runs). 6.3 FS v.s. Stationary MultipleRW & SingleRW SingleRW FS (m = 100) We now compare FS with SingleRW and MultipleRW, MultipleRW (K = 100) when the latter two start in steady state. Figure 11 shows 0048 the results (over the Flickr graph) of the same simulation )

n scenario used to obtain the results in Figure 5, except that ( 10

ˆ now MultipleRW and SingleRW both start in steady state. θ 0024 While SingleRW has improved slightly (most notably at the tail errors), the benefit of starting in steady state is most 0012 felt by the MultipleRW method. In this simulation we see 0 that the large estimation errors of MultipleRW in the previ- 1 5 × 103 104 ous simulations were due to the starting vertices being sam- Random walk steps (n) pled uniformly at random. It is interesting to observe that MultipleRW starting in steady state and FS have similar Figure 9: (GAB graph) Four paths of θˆ10 as a function of the estimation errors. number of steps n (θ10 = 0024). The next experiment focuses on studying the impact of 6.4 FS v.s. Random Independent Sampling loosely connected components on the degree distribution es- In Section 3 we showed that, if the degrees of two neigh- timates. For this we use the two Barabási-Albert joined boring vertices are independent, random edge sampling is graphs GAB presented in Section 4.2.2. The experiment con- more accurate than random vertex sampling when it comes sists of estimating the degree distribution of GAB using FS to estimating the tail of the degree distribution. In this sec- (m = 100), SingleRW, and MultipleRW (m = 100). Again, tion we observe this to be true over large real world graphs; both FS and MultipleRW start at the initial set of vertices we also observe that the accuracy of FS closely matches the in each simulation (chosen uniformly at random). In this accuracy of random edge sampling. In the following simula- experiment the hypothesis is that, for small sampling bud- tions we estimate the in-degree distribution. Random edge gets, each random walker will see the degree distribution of sampling uses the estimator θˆi, equation (7) (the estimator either GA or GB but not the degree distribution of GAB . used for sampled vertices is trivial).

400 Random Edge Sampling (10% hit ratio) 3 FS (m = 1000) (10% hit ratio) + Random Vertex Sampling (10% hit ratio) 2 30 22222222 22222 22222222 2222 22++++++++ 2222 05 ++ 22 33333333 2222 222 8 222222 +++33 22222 2222333 2222222222222 22++++22 22222222222222222222222 33333333 22++333333 222222222222222222222222222222222222222222 33 223322++ 222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 333 02 332233333322++333333++ 22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 3333 33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333322333322++++ 22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 33 33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333 222222++++++22++ 222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 33333333333333 33333333333333 222222+++222++++2222++ 1 222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 33333333333333333333333 333333 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++22222222++++++22+++++++++222222222222222222++22++++222222++++++2222222222++++++ 222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 3333333333333333333333333333333333333333333333333333 333 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++22222222222222+++++++++++++++2222222222222+++++++222222222222222222222++++++++++++22222222222222++++++++2222++++++222222++++++++++22222222222222222222222222222222222222 2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333 33 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333 ++++++++ 01 3 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333 ++ +++++++++++++++++++++++++22222222222222222222222222222++++++++++++++++++++++++++22222222222222222222+++++++++++++222222222222222222222222++++++++++++++++++++++++++22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333322222222222233322222233333333333333333333333333333333333333333333333333322222222222222222222223333333333333333333333333333333333333333333333333332222222222222222222222222222333333333333333333333333333333332222222233333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333 +++ 22222222222222222+2222++++222++22222+++222222+++++222222+++++222222+++2222222222222222+++++++++222222222222222222222222222 3 2222222222222222222222222222222222222222222222222222222222222222222 ++++++ 22222222222+++++++++++ 22222222222222222222222222222222222222222222222222 ++++++++ 2222 +++++++ 222222222222222222222222222222222 ++++++++++++++ 2 +++++ 2222222222222222222222 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ 22222222222 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 01 2222222 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 22222+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ CNMSE 22 ++++++ +++2+2+2+++++ +22 3 2 CNMSE 002 002 −2 3 SingleRW 3 10 −2 + 10 FS (m = 1000) + 2 2 MutipleRW (m = 1000) 2 − + 10 3 0 10 102 103 104 0 10 102 104 105 vertex in-degree vertex in-degree Figure 13: (Livejournal) The log-log plot shows the CNMSE of Figure 11: (Flickr) The log-log plot of the CNMSE of the the in-degree distribution estimation with budget B = |V |100 = in-degree distribution estimation of MultipleRW and SingleRW 52844 (CNMSE over 10 000 runs). starting in steady state; sampling budget B = |V |100 (NMSE over 10 000 runs). ratio. For random edge sampling we assume a hit ratio of 1% (the choice of 1% is arbitrary). Figure 13 shows a log-log In our first simulation we set the sampling cost of ran- plot of the CNMSE of our simulation over the (complete) dom vertex sampling to one and random edge sampling has Livejournal graph with sampling budget B = V 100 = cost two (as each edge samples two vertices). The sam- 52844. We observe that FS (m = 1000), which| | samples pling budget is B = V 100. We label this simulation | | m = 1000 random vertices and (on average) crawls B 10 m “100% hit ratio” to indicate the unitary cost of randomly vertices, outperforms random edge sampling. Also note− that sampling vertices. Figure 12 shows a log-log plot of the FS estimates are more accurate than the estimates obtained NMSE (not the CNMSE ) of our simulation over the (com- from random vertex sampling for all but the three smallest plete) Flickr graph. Here we use the NMSE (instead of the in-degrees. This indicates that FS is more robust to low hit CNMSE ) in order to be able to compare our results with ratios than random vertex and edges sampling. the ones presented in equations (3) and (4). The vertical SingleRW 3 line indicates the average in-degree. Note that random edge FS (m = 100) + sampling is more (less) accurate than random vertex sam- 15 MultipleRW (K = 100) 2 pling at estimating in-degrees larger (smaller) than the av- 3 3 erage in-degree, as predicted by equations (3) and (4) of our 3 2 3 3 model in Section 3. We also observe that the accuracy of 1 3 2 33 3 2 2 33 FS (m = 1000) closely matches the accuracy of random edge 2 33 2 2 2 2 333 3 2 2 33 3 2 2 2 2 2 2 2 2 2222 2 2 2 3 2 2 sampling. 2 2 2 2 222 2 2 2 2 22 2 2 2 2 22 2 2 2222222 2 2 3 2 NMSE 2 22 2 2 2 2 2 222 3 2 3 2 2 22222 2222 22 22 2 22 222 2 2222 322322 Random Edge Sampling (100% hit ratio) 2 22 22 23 2 2222 2 23 222 2 2 2 222233322222 2222 22222 2 2 2 3 22 22 232 22232 22 222 FS (m = 1000) (100% hit ratio) + 05 2 22223 2 322 2 2 2 3 3 33 Random Vertex Sampling (100% hit ratio) 2 3 3 3 3 33 3 3 3 3 333 333 3333 33333 333333333333333 33 3 33 3 03 3333333333333333333333333333333 333333333333333333333 3333333333333 333333333 + + + + ++ + ++ ++ +++++ + + + +++++ ++ ++++ +++++++++++++++++++++ + ++ + + ++++ +++++++++++++++ +++++ +++++++++++++++++++++++++ 015 +++++ ++++ + + ++ ++ ++ ++ ++++++ +++++++++ 30 − 10 2 2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 2 8 22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 2222222222222222222222222222222222222222222222222222 1 50 100 150 22222222222222222222222222222222 222222222222222222222222222 2222222222222222222222222 Group index 222222222222222222222 222222222222222 +3+333 2222222222222 +3+3+3+3+33+3+333+++3+333 1 222222222222 +33+3+33+3+3+333+33+3+3+3+++3+3333+++333+3+++3+333+333+33333 22222222 3+3+3+33+3+3+3+3+3+3+3++33+3++3+333+3++++3+333+3+3+++3+3+++333++++++3+33+++3+333+++3+3333+33333 average in-degree 222222 3+3+3+33+3+33++3+3+333+++3+3+3+3+3+3+3+3++3+333++3+3+33 222222222222 +3+33+3+3+3+3+3+++3+333+33+++333+3+++333+3+3+3+3+++3333+333+3+3+3+3+33+3++3+33++3333+3+3+3++3+33+3+3 22222 +33+3+33++33+3+3+33++3+333+3+++3+3+3++3+3+3+3+3+3+3+33+3+3+3+3+3+3+3+3+3+3+3+3+3++3+3+3+3+33+ +3 22222222 3++33+3+3+3+++3+3+333++3+33++3+333+3++33+3+3+++333+333+++33++3+3+33+3+3+++3+ +3+3+33+3+ +3 222222 +3+++3+3+3++33+3333+++3+333+333+333+++333+++++3++++3++33+3++3+333+3+3+++3++3+3+3+ ++3+3 Figure 14: (Flickr) The NMSE of the density estimates of the 2222 ++++3+3+3+++333+3+++33+3+333+++333333+++3333++++333+3+3+333+3+3 +3 222+++++3++3+++333+3++3+3+++3++33+3+3+3+3+3 +2+++32+32+3+3++3+3+33 +++3+3+3+32+32323233 most popular groups in the Flickr graph. 01 ++3+3+333222 NMSE +33 22 2 +3 22 22 + 2 002 3 2 −2 6.5 Density of Special Interest Groups 10 2 In a variety of complex networks, e.g. on-line social net- − 10 3 works, each vertex (user) is associated with multiple labels 0 10 102 104 105 that represent group affiliations, e.g. user interests, user ge- vertex in-degree olocation, among others. For example, in the Flickr graph 21% of the users belong to one or more special interest Figure 12: (Flickr) The log-log plot shows the NMSE of the in- groups [26]. Let denote the set of groups in the Flickr degree distribution estimation with budget B = |V |100 = 18612 graph and θ denoteL the fraction of vertices that belong to (CNMSE over 10 000 runs). l group l . In the simulations we estimate θl using FS Some complex networks exhibit a sparse user-id space. (m = 100),∈ L SingleRW, and MultipleRW (m = 100) with In this scenario a fraction of the sampling budget B can budget B = V 100. Figure 14 shows the NMSE (from be spent querying invalid users-ids. Motivated by recent 10 000 runs) of| the| most popular 200 groups ordered in de- experiments over the MySpace network [30], the following creasing popularity. FS is clearly superior to both SingleRW experiment assumes that only 10% of the user-ids are valid, and MultipleRW. Even when restricting the random walks i.e., on average only one in every ten randomly sampled to the largest connected component, FS still noticeably out- vertices are valid. We denote this value (10%) to be the hit performs MultipleRW (m = 100) and SingleRW.

401 E[Cˆ] (NMSE) used in [9] to make the Markov chain associated to the ran- dom walker nonreversible, which can speed up the mixing of Graph BC FS SingleRW MultipleRW the original RW. Unfortunately, it is unclear if this method Flickr 1% 014 013 (004) 012 (033) 016 (018) can be successfully used to estimate characteristics of com- LiveJournal 1% 016 016 (002) 016 (002) 017 (006) plex networks. In networks that cannot be crawled (e.g., the Internet Table 3: Global clustering coefficient estimates. C is the true topology), samples must be obtained along shortest paths, ˆ value of the global clustering coefficient and C is its estimated and vertex degrees cannot be queried, [1] shows that ob- value. served vertex degrees are biased. Our work, however, as- 6.6 Global Clustering Coefficient Estimates sumes a graph can be crawled and vertex degrees queried. Our scenario admits a RW with an unbiased estimator. Mul- In our last set of experiments we evaluate the accuracy tiple random walks also find other applications besides the of estimating the global clustering coefficient using FS, Sin- one presented in this work. They are used to collect Web gleRW, and MultipleRW. Our simulations show a small dif- data [10], search P2P networks [6, 38], and decrease the time ference between FS (m = 1000), SingleRW, MultipleRW to discover “new wireless nodes” [2]. Dependent multiple ˆ (m = 1000). Let C be the clustering coefficient and C de- random walks are also used in percolation theory [3]. note its estimated value. Table 3 presents the empirical value of E[Cˆ] and the empirical NMSE of the clustering co- efficient, given by 8. DISCUSSION AND FUTURE WORK In this work we presented a new and promising random E[(Cˆ C)2] NMSE = − walk-based method (Frontier sampling) that mitigates the C estimation errors caused by subgraphs that “trap” a random over 10 000 runs of FS, SingleRW, and MultipleRW over the walker. Frontier sampling (FS) uses multiple (m) mutually Flickr and Livejournal graphs. From the results of Table 3 dependent random walkers starting from vertices sampled we see that FS accurately estimates the global clustering uniformly at random. The FS samples are shown to be the coefficient and has smaller error than both SingleRW and projection (onto the original graph) of a special type of m- MultipleRW. dimensional (single) random walker. Simulations over real world graphs in Section 6 show that Frontier sampling (FS) 7. RELATED WORK is more robust than single and multiple independent random walkers (starting out of steady state) to estimate in-degree This section is devoted to review the related literature. FS distributions and the fraction of users that belong to a so- can be classified as a Markov Chain Monte Carlo (MCMC) cial group. We also present evidence, using an analytical method. Other MCMC-based methods have been applied to argument (also substantiated by simulations), that random characterize complex networks. Applications include, but walks (in particular, FS) are better suited to estimate the are not limited to estimating characteristics of a popula- tail (all degrees greater than the average) of degree distri- tion [36] (e.g. estimation of HIV seroprevalence among drug butions than random vertex sampling. FS can also be made users [24]), content density in peer-to-peer networks [16, 23, fully distributed without incurring in any coordination or 29, 35], uniformly sampling Web pages from the Internet [17, communication costs. 33], and uniformly sampling Web pages from a search en- The ideas behind FS can have far reaching implications, gine’s index [4]. The above literature is mostly concerned from estimating characteristics of dynamic networks to the with random walks that seek to sample vertices uniformly design of new MCMC-based approximation algorithms. (also known as Metropolized Random Walks or Metropolis- RW) [16, 17, 33, 4, 35]. The accuracy of RW and Metropolis- RW (MRW) is compared in [15, 29], and in a variety of ex- 9. ACKNOWLEDGMENTS periments RW estimates are shown to be consistently more We would like to thank Weibo Gong for many helpful dis- accurate than or equal to MRW estimates. cussions and Alan Mislove for kindly making available some The above literature does not consider the use of mul- of the data used in this paper. This research was sponsored tiple random walks to address the problem of estimating by the ARO under MURI W911NF-08-1-0233, and the U.S. characteristics of disconnected or loosely connected graphs. Army Research Laboratory under Cooperative Agreement While multiple independent random walkers have been used Number W911NF-09-2-0053. The views and conclusions as a convergence test in the literature, our simulations in contained in this document are those of the author(s) and Section 6 show that independent walkers are not suited to should not be interpreted as representing the official poli- sample loosely connected graphs when the starting vertices cies, either expressed or implied, of the U.S. Army Research are selected uniformly at random. Laboratory or the U.S. Government. The U.S. Government A number of real complex networks are known to have dis- is authorized to reproduce and distribute reprints for Gov- connected or loosely connected components. A large body ernment purposes notwithstanding any copyright notation of MCMC literature is dedicated to overcome the locality hereon. problem described in Section 4.3. However, the literature either assumes that the graph is very structured, e.g., a 2 10. REFERENCES dimensional lattice, or that the graph is completely known. These assumptions make the solutions inapplicable to our [1] Dimitris Achlioptas, Aaron Clauset, David Kempe, problem. A comprehensive list of MCMC methods and their and Cristopher Moore. On the bias of traceroute characteristics can be found in [32]. sampling: Or, power-law degree distributions in Projecting a RW onto a higher dimensional space has been regular graphs. J. ACM, 56(4):1–28, 2009.

402 [2] Chen Avin and Bhaskar Krishnamachari. The power [21] David A. Levin, Yuval Peres, and Elizabeth L. of choice in random walks: An empirical study. Wilmer. Markov Chains and Mixing Times. AMS, Comput. Netw., 52(1):44–60, 2008. 2009. [3] P. Balister, B. Bollobás, and A. Stacey. Dependent [22] L. Lovász. Random walks on graphs: a survey. percolation in two dimensions. Prob. Theory and Combinatorics, 2:1–46, 1993. Related Fields, 117(4):495–513, 2000. [23] Laurent Massoulié, Erwan Le Merrer, Anne-Marie [4] Ziv Bar-Yossef and Maxim Gurevich. Random Kermarrec, and Ayalvadi Ganesh. Peer counting and sampling from a search engine’s index. J. ACM, sampling in overlay networks: random walk methods. 55(5):1–74, 2008. In Proc. of the PODC, pages 123–132, 2006. [5] A.-L. Barabási and R. Albert. Emergence of scaling in [24] Courtney McKnight, Don Des Jarlais, Heidi Bramson, random networks. Science, 286:509–512, 1999. Lisa Tower, Abu S. Abdul-Quader, Chris Nemeth, and [6] Nabhendra Bisnik and Alhussein A. Abouzeid. Douglas Heckathorn. Respondent-driven sampling in a Optimizing random walk search algorithms in p2p study of drug users in New York City: Notes from the networks. Computer Networks, 51(6):1499–1514, 2007. field. Journal of Urban Health, 83(6):154–159, 2006. [7] S. Boccaletti, V. Latora, Y. Moreno, M. Chavez, and [25] Sean Meyn and Richard L. Tweedie. Markov Chains D.-U. Hwang. Complex networks: Structure and and Stochastic Stability. Cambridge University Press, dynamics. Physics Reports, 424(4-5):175–308, 2006. 2009. [8] Christos G. Cassandras and Stephane Lafortune. [26] Alan Mislove, Massimiliano Marcon, Krishna P. Introduction to Discrete Event Systems. Gummadi, Peter Druschel, and Bobby Bhattacharjee. Springer-Verlag, Inc., 2006. Measurement and Analysis of Online Social Networks. [9] Fang Chen, László Lovász, and Igor Pak. Lifting In Proc. of the IMC, October 2007. Markov chains to speed up mixing. In Proc. of STOC, [27] M. E. J. Newman. Assortative mixing in networks. pages 275–281, 1999. Phys. Rev. Lett., 89(20):208701, Oct 2002. [10] Junghoo Cho and Hector Garcia-Molina. Parallel [28] M. E. J. Newman. The structure and function of crawlers. In Proc. of the WWW, pages 124–135, 2002. complex networks. SIAM Review, 45(2):167–256, 2003. [11] Nathan Eagle, Alex S. Pentland, and David Lazer. [29] Amir H. Rasti, Mojtaba Torkjazi, Reza Rejaie, Nick Inferring friendship network structure by using mobile Duffield, Walter Willinger, and Daniel Stutzbach. phone data. PNAS, 106(36):15274–15278, August Respondent-driven sampling for characterizing 2009. unstructured overlays. In Proc. of the IEEE Infocom, [12] W. Feller. An Introduction to Probability Theory and pages 2701–2705, April 2009. its Applications, volume 1. John Wiley & Sons, New [30] Bruno Ribeiro, William Gauvin, Benyuan Liu, and York, 3rd edition, 1968. Don Towsley. On MySpace account spans and double [13] Coperative Association for Internet Data Analysis. Pareto-like distribution of friends. In IEEE Infocom CAIDA’s Internet topology data kit #0304, 2003. 2010 Workshop, Mar 2010. [14] Charles J. Geyer. Practical Markov Chain Monte [31] Bruno Ribeiro and Donald Towsley. Estimating and Carlo. Statistical Science, 7(4):473–483, 1992. sampling graphs with multidimensional random walks. [15] Minas Gjoka, Maciej Kurant, Carter T. Butts, and arXiv:1002.1751v2, 2010. Athina Markopoulou. A walk in Facebook: Uniform [32] Christian P. Robert and George Casella. Monte Carlo sampling of users in online social networks. In Proc. of Statistical Methods. Springer-Verlag, 2nd edition, 2005. the IEEE Infocom, March 2010. [33] Paat Rusmevichientong, David M. Pennock, Steve [16] Christos Gkantsidis, Milena Mihail, and Amin Saberi. Lawrence, and Lee C. Giles. Methods for sampling Random walks in peer-to-peer networks: algorithms pages uniformly from the world wide web. In AAAI and evaluation. Perform. Eval., 63(3):241–263, March Fall Symposium on Using Uncertainty Within 2006. Computation, pages 121–128, 2001. [17] Monika R. Henzinger, Allan Heydon, Michael [34] Thomas Schank and Dorothea Wagner. Mitzenmacher, and Marc Najork. On near-uniform url Approximating clustering-coefficient and transitivity. sampling. In Proceedings of the WWW, pages Journal of Graph Algorithms and Applications, 295–308, 2000. 9(2):265–275, 2004. [18] Marlom A. Konrath, Marinho P. Barcellos, and [35] Daniel Stutzbach, Reza Rejaie, Nick Duffield, Rodrigo B. Mansilha. Attacking a swarm with a band Subhabrata Sen, and Walter Willinger. On unbiased of liars: evaluating the impact of attacks on sampling for unstructured peer-to-peer networks. bittorrent. In P2P ’07: Proceedings of the Seventh IEEE/ACM Trans. Netw., 17(2):377–390, 2009. IEEE International Conference on Peer-to-Peer [36] Erik Volz and Douglas D. Heckathorn. Probability Computing, pages 37–44, Washington, DC, USA, based estimation theory for Respondent-Driven 2007. IEEE Computer Society. Sampling. Journal of Official Statistics, 2008. [19] Jure Leskovec and Christos Faloutsos. Sampling from [37] D.J. Watts and S.H. Strogatz. Collective dynamics of large graphs. In Proc. of the KDD, pages 631–636, “small world” networks. Nature, 393:440–442, June 2006. 1998. [20] Jure Leskovec, Kevin J. Lang, Anirban Dasgupta, and [38] Ming Zhong and Kai Shen. Random walk based node Michael W. Mahoney. Statistical properties of sampling in self-organizing networks. SIGOPS Oper. community structure in large social and information Syst. Rev., 40(3):49–55, 2006. networks. In Proc. of the WWW, pages 695–704, 2008.

403