{'fraction_non_alphanumeric': 0.04368808737617475, 'fraction_numerical': 0.009880619761239523, 'mean_word_length': 4.274079035498995, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Distribution-Free Models of Social Networks

The structure of large-scale social networks has predominantly been articulated using generative models, a form of average-case analysis. This chapter surveys recent proposals of more robust models of such networks. These models posit deterministic and empirically supported combinatorial structure rather than a specific probability distribution. We discuss the formal definitions of these models and how they relate to empirical observations in social networks, as well as the known structural and algorithmic results for the corresponding graph classes.


Introduction
Technological developments in the 21st century have given rise to large-scale social networks, such as the graphs defined by Facebook friendship relationships or followers on Twitter. Such networks arguably provide the most important new application domain for graph analysis in well over a decade.

Social Networks Have Special Structure
These properties are not generally possessed by Erdős-Rényi random graphs (in which each edge is present independently with some probability p); a new model is needed to capture them.
From an algorithmic standpoint, empirical results indicate that optimization problems are often easier to solve in social networks than in worst-case graphs. For example, lightweight heuristics are unreasonably effective in practice for finding the maximum clique or recovering dense subgraphs of a large social network.
The literature on models that capture the special structure of social networks is almost entirely driven by the quest for generative (i.e., probabilistic) models that replicate some or all of the four properties listed above. Dozens of generative models have been proposed, and there is little consensus about which is the "right" one. The plethora of models poses a challenge to meaningful theoretical work on social networks-which of the models, if any, is to be believed? How can we be sure that a given algorithmic or structural result is not an artifact of the model chosen?
This chapter surveys recent research on more robust models of large-scale social networks, which assume deterministic combinatorial properties rather than a specific generative model. Structural and algorithmic results that rely only on these deterministic properties automatically carry over to any generative model that produces graphs possessing these properties (with high probability). Such results effectively apply "in the worst case over all plausible generative models." This hybrid of worst-case (over input distributions) and average-case (with respect to the distribution) analysis resembles several of the semi-random models discussed elsewhere in the book, such as in the preceding chapters on pseudorandom data (Chapter 26) and prior-independent auctions (Chapter 27). Sections 2 and 3 of this chapter cover two models of social networks that are motivated by triadic closure, the second of the four signatures of social networks listed in Section 1. Sections 4 and 5 discuss two models motivated by heavy-tailed degree distributions.
2 Cliques of c-Closed Graphs

Triadic Closure
Triadic closure is the property that, when two members of a social network have a friend in common, they are likely to be friends themselves. In graph-theoretic terminology, two-hop paths tend to induce triangles.
Triadic closure has been studied for decades in the social sciences and there is compelling intuition for why social networks should exhibit strong triadic closure properties. Two people with a common friend are much more likely to meet than two arbitrary people, and are likely to share common interests. They might also feel pressure to be friends to avoid imposing stress on their relationships with their common friend.
The data support this intuition. Numerous large-scale studies on online social networks provide overwhelming empirical evidence for triadic closure. The plot in Figure 1, derived from the network of email communications at the disgraced energy company Enron, is representative. Other social networks exhibit similar triadic closure properties.

c-Closed Graphs
The most extreme version of triadic closure would assert that whenever two vertices have a common neighbor, they are themselves neighbors: whenever (u, v) and (v, w) are in the edge set E, so is (u, w). The class of graphs satisfying this property is not very interesting-it is precisely the (vertex-)disjoint unions of cliques-but it forms a natural base case for more interesting parameterized (a) Triadic closure in the Enron email network (b) Triadic closure in a random graph Figure 1: In the Enron email graph, vertices correspond to Enron employees, and there is an edge connecting two employees if one sent at least one email to the other. In (a), vertex pairs of this graph are grouped according to the number of common neighbors (indicated on the x-axis). The y-axis shows the fraction of such pairs that are themselves connected by an edge. The edge density-the fraction of arbitrary vertex pairs that are directly connected-is roughly 10 −4 . In (b), a cartoon of the analogous plot for an Erdős-Rényi graph with edge density p = 10 −4 is shown. Erdős-Rényi graphs are not a good model for networks like the Enron network-their closure rate is too small, and the closure rate fails to increase as the number of common neighbors increases.

definitions. 1
Our first definition of a class of graphs with strong triadic closure properties is that of c-closed graphs.
Definition 2.1 (Fox et al. (2020)). For a positive integer c, For a fixed number of vertices, the parameter c interpolates between unions of cliques (when c = 1) and all graphs (when c = |V | − 1). The class of 2-closed graphs-the graphs that do not contain a square (i.e., K 2,2 ) or a diamond (i.e., K 4 minus an edge) as an induced subgraph-is already non-trivial. The c-closed condition is a coarse proxy for the empirical closure rates observed in social networks (like in Figure 1), asserting that the closure rate jumps to 100% for vertices with c or more common neighbors.
Next is a less stringent version of the definition, which is sufficient for the main algorithmic result of this section. Definition 2.2 (Fox et al. (2020)). For a positive integer c, a vertex v of a graph G = (V, E) is c-good if whenever v has at least c common neighbors with another vertex u, (u, v) ∈ E. The graph G is weakly c-closed if every induced subgraph has at least one c-good vertex.
A c-closed graph is also weakly c-closed, as each of its vertices is c-good in each of its induced subgraphs. The converse is false; for example, a path graph is not 1-closed, but it is weakly 1closed (as the endpoints of a path are 1-good). Equivalent to Definition 2.2 is the condition that the graph G has an elimination ordering of c-good vertices, meaning the vertices can be ordered v 1 , v 2 , . . . , v n such that, for every i = 1, 2, . . . , n, the vertex v i is c-good in the subgraph induced by v i , v i+1 , . . . , v n (Exercise 1). Are real-world social networks c-closed or weakly c-closed for reasonable values of c? The next Table 1: The c-closure and weak c-closure of four well-studied social networks from the SNAP (Stanford Large Network Dataset) collection of benchmarks (http://snap.stanford.edu/). "email-Enron" is the network described in Figure 1; "p2p-Gnutella04" is the topology of a Gnutella peer-to-peer network circa 2002; "wiki-Vote" is the network of who votes on whom in promotion cases on Wikipedia; and "ca-GrQc" is the collaboration network of authors of papers uploaded to the General Relativity and Quantum Cosmology section of arXiv. For each network G, n indicates the number of vertices, m the number of edges, c the smallest value γ such that G is γ-closed, and "weak c" the smallest value γ such that G is weakly γ-closed.
These social networks are c-closed for much smaller values of c than the trivial bound of n − 1, and are weakly c-closed for quite modest values of c.

Computing a Maximum Clique: A Backtracking Algorithm
Once a class of graph has been defined, such as c-closed graphs, a natural agenda is to investigate fundamental optimization problems with graphs restricted to the class. We single out the problem of finding the maximum-size clique of a graph, primarily because it is one of the most central problems in social network analysis. In a social network, cliques can be interpreted as the most extreme form of a community.
The problem of computing the maximum clique of a graph reduces to the problem of enumerating the graph's maximal cliques 2 -the maximum clique is also maximal, so it appears as the largest of the cliques in the enumeration.
How does the c-closed condition help with the efficient computation of a maximum clique? We next observe that the problem of reporting all maximal cliques is polynomial-time solvable in cclosed graphs when c is a fixed constant. The algorithm is based on backtracking. For convenience, we give a procedure that, for any vertex v, identifies all maximal cliques that contain v. (The full procedure loops over all vertices.) 1. Maintain a history H, initially empty.   This subroutine reports all maximal cliques that contain v, whether the graph is c-closed or not (Exercise 2). In a c-closed graph, the maximum depth of the recursion is c-once |H| = c − 1, every pair of vertices in N \ {v} has c common neighbors (namely H ∪ {v}) and hence N must be a clique. The running time of the backtracking algorithm is therefore n c+O(1) in c-closed graphs. This simplistic backtracking algorithm is extremely slow except for very small values of c. Can we do better?

Computing a Maximum Clique: Fixed-Parameter Tractability
There is a simple but clever algorithm that, for an arbitrary graph, enumerates all of the maximal cliques while using only polynomial time per clique. Theorem 2.1 (Tsukiyama et al. (1977)). There is an algorithm that, given any input graph with n vertices and m edges, outputs all of the maximal cliques of the graph in O(mn) time per maximal clique.
Theorem 2.1 reduces the problem of enumerating all maximal cliques in polynomial time to the combinatorial task of proving a polynomial upper bound on the number of maximal cliques.
Computing a maximum clique of an arbitrary graph is an N P -hard problem, so presumably there exist graphs with an exponential number of maximal cliques. The Moon-Moser graphs are a simple and famous example. For n a multiple of 3, the Moon-Moser graph with n vertices is the perfectly balanced n 3 -tite graph, meaning the vertices are partitioned into n 3 groups of 3, and every vertex is connected to every other vertex except for the 2 vertices in the same group ( Figure 2). Choosing one vertex from each group induces a maximal clique, for a total of 3 n/3 maximal cliques, and these are all of the maximal cliques of the graph. More generally, a basic result in graph theory asserts that no n-vertex graph can have more than 3 n/3 maximal cliques. (1965)). Every n-vertex graph has at most 3 n/3 maximal cliques.

Theorem 2.2 (Moon and Moser
A Moon-Moser graph on n vertices is not c-closed even for c = n − 3, so there remains hope for a positive result for c-closed graphs with small c. The Moon-Moser graphs do show that the number of maximal cliques of a c-closed graph can be exponential in c (since a Moon-Moser graph on c vertices is trivially c-closed). Thus the best-case scenario for enumerating the maximal cliques of a c-closed graph is a fixed-parameter tractability result (with respect to the parameter c), stating that, for some function f and constant d (independent of c), the number of maximal cliques in an n-vertex c-closed graph is O(f (c) · n d ). The next theorem shows that this is indeed the case, even for weakly c-closed graphs. Theorem 2.3 (Fox et al. (2020)). Every weakly c-closed graph with n vertices has at most The following corollary is immediate from Theorems 2.1 and 2.3.

Proof of Theorem 2.3
The proof of Theorem 2.3 proceeds by induction on the number of vertices n. (One of the factors of n in the bound is from the n steps in this induction.) Let G be an n-vertex weakly c-closed graph. Assume that n ≥ 3; otherwise, the bound is trivial.
By assumption, G has a c-good vertex v. By induction, G \ {v} has at most (n − 1) 2 · 3 (c−1)/3 maximal cliques. (An induced subgraph of a weakly c-closed graph is again weakly c-closed.) Every maximal clique C of G \ {v} gives rise to a unique maximal clique in G (namely C or C ∪ {v}, depending on whether the latter is a clique). It remains to bound the number of uncounted maximal cliques of G, meaning the maximal cliques An uncounted maximal clique K must include v, with K contained in v's neighborhood (i.e., in the subgraph induced by v and the vertices adjacent to it). Also, there must be a vertex u / ∈ K such that K \ {v} ∪ {u} is a clique in G \ {v}; we say that u is a witness for K, as it certifies the non-maximality of K \ {v} in G \ {v}. Such a witness must be connected to every vertex of K \ {v}. It cannot be a neighbor of v, as otherwise K ∪ {u} would be a clique in G, contradicting K's maximality.
Choose an arbitrary witness for each uncounted clique of G and bucket these cliques according to their witness; recall that all witnesses are non-neighbors of v. For every uncounted clique K with witness u, all vertices of the clique K \ {v} are connected to both v and u. Moreover, because K is a maximal clique in G, K \ {v} is a maximal clique in the subgraph G u induced by the common neighbors of u and v.
How big can such a subgraph G u be? This is the step of the proof where the weakly c-closed condition is important: Because u is a non-neighbor of v and v is a c-good vertex, u and v have at most c − 1 common neighbors and hence G u has at most c − 1 vertices ( Figure 3). By the Moon-Moser theorem (Theorem 2.2), each subgraph G u has at most 3 (c−1)/3 maximal cliques. Adding up over the at most n choices for u, the number of uncounted cliques is at most n · 3 (c−1)/3 ; this sum over possible witnesses is the source of the second factor of n in Theorem 2.3. Combining this bound on the uncounted cliques with the inductive bound on the remaining maximal cliques of G yields the desired upper bound of Because v is a c-good vertex, u and v have at most c − 1 common neighbors.

Triangle-Dense Graphs
Our second graph class inspired by the strong triadic closure properties of social and information networks is the class of δ-triangle-dense graphs. These are graphs where a constant fraction of vertex pairs having at least one common neighbor are directly connected by an edge. Equivalently, a constant fraction of the wedges (i.e., two-hop paths) of the graph belong to a triangle. (In the social networks literature, this is also called the transitivity or the global clustering coefficient.) Because every triangle of a graph contains 3 wedges, and no two triangles share a wedge, the triangle density of a graph is between 0 and 1-the fraction of wedges that belong to a triangle. Triangle density is another coarse proxy for the empirical closure rates observed in social networks (like in Figure 1(a)).
The 1-triangle-dense graphs are precisely the unions of disjoint cliques, while triangle-free graphs constitute the 0-triangle-dense graphs. The triangle density of an Erdős-Rényi graph with edge probability p is concentrated around p (cf., Figure 1(b)). For an Erdős-Rényi graph to have constant triangle density, one would need to set p = Ω(1). This would imply that the graph is dense, quite unlike social networks. For example, in the year 2011 the triangle density of the Facebook graph was computed to be 0.16, which is five orders of magnitude larger than in a random graph with the same number of vertices (roughly 1 billion at the time) and edges (roughly 100 billion).

Visualizing Triangle-Dense Graphs
What do δ-triangle-dense graphs look like? Can we make any structural assertions about them, akin to separator theorems for planar graphs (allowing them to be viewed as "approximate grids") or the regularity lemma for dense graphs (allowing them to viewed as approximate unions of random bipartite graphs)?  Given that 1-triangle-dense graphs are unions of cliques, a first guess might be that δ-triangledense graphs look like the approximate union of approximate cliques (as in Figure 4(a)). Such graphs certainly have high triangle density; could there be an "inverse theorem," stating that these are in some sense the only graphs with this property?
In its simplest form, the answer to this question is "no," as δ-triangle-dense graphs become quite diverse once δ is bounded below 1. For example, adding a clique on n 2/5 vertices to an arbitrary bounded-degree n-vertex graph produces a δ-triangle-dense graph with δ = 1 − o(1) as n → ∞ (see Figure 4(b)).
Nonetheless, an inverse theorem does hold if we redefine what it means to approximate a graph by a collection of approximate cliques. Instead of trying to capture most of the vertices or edges (which is impossible, as the previous example shows), we consider the goal of capturing a constant fraction of the triangles of a graph by a collection of dense subgraphs.

An Inverse Theorem
To state an inverse theorem for triangle-dense graphs, we require a preliminary definition. 2. For each i = 1, 2, . . . , k, the subgraph induced by V i has radius at most 2.
In Definition 3.2, the vertex sets V 1 , V 2 , . . . , V k are disjoint but need not cover all of V ; in particular, the empty collection is technically a tightly knit family.
The following inverse theorem states that every triangle-dense graph contains a tightly-knit family that captures most of the "meaningful social structure"-a constant fraction of the graph's triangles.
Theorem 3.1 (Gupta et al. (2016)). There is a function f (δ) = O(δ 4 ) such that for every δtriangle dense graph G, there exists an f (δ)-tightly-knit family that contains an f (δ) fraction of the triangles of G.
Graphs that are not triangle dense, such as sparse Erdős-Rényi random graphs, do not generally admit ρ-tightly-knit families with constant ρ. The complete tripartite graph shows that Theorem 3.1 does not hold if the "radius-2" condition in Definition 3.1 is strengthened to "radius-1" (Exercise 4).

Proof Sketch of Theorem 3.1
The proof of Theorem 3.1 is constructive, and interleaves two subroutines. To state the first, define the Jaccard similarity of an edge (u, v) of a graph G as the fraction of neighbors of u and v that are neighbors of both: where N (·) denotes the neighbors of a vertex and the "-2" is to avoid counting u and v themselves. The first subroutine, called the cleaner, is given a parameter ǫ as input and repeatedly deletes edges with Jaccard similarity less than ǫ until none remain. Removing edges from the graph is worrisome because it removes triangles, and Theorem 3.1 promises that the final tightly knit family captures a constant fraction of the original graph's triangles. But removing an edge with low Jaccard similarity destroys many more wedges than triangles, and the number of triangles in the graph is at least a constant fraction of the number of wedges (because it is δ-triangle-dense). A charging argument along these lines shows that, provided ǫ is at most δ/4, the cleaner cannot destroy more than a constant fraction of the graph's triangles. The second subroutine, called the extractor, is responsible for extracting one of the clusters of the tightly-knit family from a graph in which all edges have Jaccard similarity at least ǫ. (Isolated vertices can be discarded from further consideration.) How is this Jaccard similarity condition helpful? One easy observation is that, post-cleaning, the graph is "approximately locally regular," meaning that the endpoints of any edge have degrees within a 1 ǫ factor of each other. Starting from this fact, easy algebra shows that every one-hop neighborhood of the graph (i.e., the subgraph induced by a vertex and its neighbors) has constant (depending on ǫ) density in both edges and triangles, as required by Theorem 3.1. The bad news is that extracting a one-hop neighborhood can destroy almost all of a graph's triangles (Exercise 4). The good news is that supplementing a one-hop neighborhood with a judiciously chosen subset of the corresponding two-hop neighborhood (i.e., neighbors of neighbors) fixes the problem. Precisely, the extractor subroutine is given a graph G in which every edge has Jaccard similarity at least ǫ and proceeds as follows: 1. Let v be a vertex of G with the maximum degree. Let d max denote v's degree and N (v) its neighbors. It is clear that the extractor outputs a set S of vertices that induces a subgraph with radius at most 2. As with one-hop neighborhoods, easy algebra shows that, because every edge has Jaccard similarity at least ǫ, this subgraph is dense in both edges and triangles. The important nonobvious fact, whose proof is omitted here, is that the number of triangles saved by the extractor (i.e., triangles with all three vertices in its output) is at least a constant fraction of the number of triangles it destroys (i.e., triangles with one or two vertices in its output). It follows that alternating between cleaning and extracting (until no edges remain) will produce a tightly-knit family meeting the promises of Theorem 3.1.

Power-Law Bounded Networks
Arguably the most famous property of social and information networks, even more so than triadic closure, is a power-law degree distribution, also referred to as a heavy-tailed or scale-free degree distribution.

Power-Law Degree Distributions and Their Properties
Consider a simple graph G = (V, E) with n vertices. For each positive integer d, let n(d) denote the number of vertices of G with degree d. The sequence {n(d)} is called the degree distribution of G. Informally, a degree distribution is said to be a power-law with exponent γ > 0 if n(d) scales as n/d γ .
There is some controversy about how to best fit power-law distributions to data, and whether such distributions are the "right" fit for the degree distributions in real-world social networks (as opposed to, say, lognormal distributions). Nevertheless, several of the consequences of a powerlaw degree distribution assumption are uncontroversial for social networks, and so a power-law distribution is a reasonable starting point for mathematical analysis.
This section studies the algorithmic benefits of assuming that a graph has an (approximately) power-law degree distribution, in the form of fast algorithms for fundamental graph problems. To develop our intuition about such graphs, let's do some rough calculations under the assumption that n(d) = cn/d γ (for some constant c) for every d up to the maximum degree d max ; think of d max as n β for some constant β ∈ (0, 1).
First, we have the implication When γ ≤ 1, d<∞ d −γ is a divergent series. In this case, we cannot satisfy the right-hand side of (1) with a constant c. For this reason, results on power-law degree distributions typically assume that γ > 1.
Next, the number of edges is exactly Thus, up to constant factors, d≤dmax d −γ+1 is the average degree. For γ > 2, d<∞ d −γ+1 is a convergent series, and the graph has constant average degree. For this reason, much of the early literature on graphs with power-law degree distributions focused on the regime where γ > 2. When γ = 2, the average degree scales with log n, and for γ ∈ (1, 2), it scales with (d max ) 2−γ , which is polynomial in n.
One of the primary implications of a power-law degree distribution is upper bounds on the number of high-degree vertices. Specifically, under our assumption that n(d) = cn/d γ , the number of vertices of degree at least k can be bounded by

PLB Graphs
The key definition in this section is a more plausible and robust version of the assumption that n(d) = cn/d γ , for which the conclusions of calculations like those in Section 4.1 remain valid. The definition allows individual values of n(d) to deviate from a true power law, while requiring (essentially) that the average value of n(d) in sufficiently large intervals of d does follow a power law.
Definition 4.1 (Berry et al. (2015); Brach et al. (2016)). A graph G with degree distribution {n(d)} is a power-law bounded (PLB) graph with exponent γ > 1 if there is a constant c > 0 such that Many real-world social networks satisfy a mild generalization of this definition, in which n(d) is allowed to scale with n/(d + t) γ for a "shift" t ≥ 0; see the Notes for details. For simplicity, we continue to assume in this section that t = 0.
Definition 4.1 has several of the same implications as a pure power law assumption, including the following lemma (cf. (2)).
Lemma 4.1. Suppose G is a PLB graph with exponent γ > 1. For every c > 0 and natural number k, The proof of Lemma 4.1 is technical but not overly difficult; we do not discuss the details here. The first part of the next lemma provides control over the number of high-degree vertices and is the primary reason why many graph problems are more easily solved on PLB graphs than on general graphs. The second part of the lemma bounds the number of wedges of the graph when γ ≥ 3.  (3) to PLB graphs, while part (b) follows from Lemma 4.1 (see Exercise 5).

Counting Triangles
Many graph problems appear to be easier in PLB graphs than in general graphs. To illustrate this point, we single out the problem of triangle counting, which is one of the most canonical problems in social network analysis. For this section, we assume that our algorithms can determine in constant time if there is an edge between a given pair of vertices; these lookups can be avoided with a careful implementation (Exercise 6), but such details distract from the main analysis.
As a warm up, consider the following trivial algorithm to count (three times) the number of triangles of a given graph G ("Algorithm 1"): • For every vertex u of G: -For every pair v, w of u's neighbors, check if u, v, and w form a triangle.
Note that the running time of Algorithm 1 is proportional to the number of wedges in the graph G. The following running time bound for triangle counting in PLB graphs is an immediate corollary of Lemma 4.2 (b), applied to Algorithm 1.
Corollary 4.0.1. Triangle counting in n-vertex PLB graphs with exponent 3 can be carried out in O(n log n) time. If the exponent is strictly greater than 3, it can be done in O(n) time.
Now consider an optimization of Algorithm 1 ("Algorithm 2"): • Direct each edge of G from the lower-degree endpoint to the higher-degree endpoint (breaking ties lexicographically) to obtain a directed graph D.
• For every vertex u of D: -For every pair v, w of u's out-neighbors, check if u, v, and w form a triangle in G.
Each triangle is counted exactly once by Algorithm 2, in the iteration where the lowest-degree of its three vertices plays the role of u. Remarkably, this simple idea leads to massive time savings in practice.
A classical way to capture this running time improvement mathematically is to parameterize the input graph G by its degeneracy, which can be thought of as a refinement of the maximum degree. The degeneracy α(G) of a graph G can be computed by iteratively removing a minimum-degree vertex (updating the vertex degrees after each iteration) until no vertices remain; α(G) is then the largest degree of a vertex at the time of its removal. (For example, every tree has degeneracy equal to 1.) We have the following guarantee for Algorithm 2, parameterized by a graph's degeneracy: Theorem 4.1 (Chiba and Nishizeki (1985)). For every graph with m edges and degeneracy α, the running time of Algorithm 2 is O(mα).
Proof. Let G = (V, E) denote an n-vertex PLB graph with exponent γ ∈ (2, 3). Denote the degree of vertex v in G by d v and its out-degree in the directed graph D by d + v . The running time of , so the analysis boils down to bounding the outdegrees in D. One trivial upper bound is d + v ≤ d v for every v ∈ V . Because every edge is directed from its lower-degree endpoint to its higher-degree endpoint, we also have d + v ≤ d≥dv n(d). By Claim 4.2(a), the second bound is O(nd −γ+1 v ). The second bound is better than the first roughly when d v ≥ nd −γ+1 v , or equivalently when d v ≥ n 1/γ . 3 The running time bound actually holds for all γ ∈ (1, 3), but is an improvement only for γ > 2.
Let V (d) denote the set of degree-d vertices of G. We split the sum over vertices according to how their degrees compare to n 1/γ , using the first bound for low-degree vertices and the second bound for high-degree vertices: Applying Lemma 4.1 (with c = 2) to the sum over low-degree vertices, and using the fact that with γ < 3 the sum d d 2−γ is divergent, we derive The second sum is over the highest-degree vertices, and Lemma 4.1 does not apply. On the other hand, we can invoke Claim 4.2(a) to obtain the desired bound: The same reasoning shows that Algorithm 2 runs in O(n log n) time in n-vertex PLB graphs with exponent γ = 3, and in O(n) time in PLB graphs with γ > 3 (Exercise 9).

Discussion
Beyond triangle counting, which computational problems should we expect to be easier on PLB graphs than on general graphs? A good starting point is problems that are relatively easy on bounded-degree graphs. In many cases, fast algorithms for bounded-degree graphs remain fast for graphs with bounded degeneracy. In these cases, the degeneracy bound for PLB graphs (Exercise 8) can already lead to fast algorithms for such graphs. For example, this approach can be used to show that all of the cliques of a PLB graph with exponent γ > 1 can be enumerated in subexponential time (see Exercise 10). In some cases, like in Theorem 4.2, one can beat the bound from the degeneracy-based analysis through more refined arguments.

The BCT Model
This section gives an impressionistic overview of another set of deterministic conditions meant to capture properties of "typical networks," proposed by Borassi et al. (2017) and hereafter called the BCT model. The precise model is technical with a number of parameters; we give only a high-level description that ignores several complications.
To illustrate the main ideas, consider the problem of computing the diameter max u,v∈V dist(u, v) of an undirected and unweighted n-vertex graph G = (V, E), where dist(u, v) denotes the shortestpath distance between u and v in G. Define the eccentricity of a vertex u by ecc(u) := max v∈V dist (u, v), so that the diameter is the maximum eccentricity. The eccentricity of a single vertex can be computed in linear time using breadth-first search, which gives a quadratic-time algorithm for computing the diameter. Despite much effort, no subquadratic (1 + ǫ)-approximation algorithm for computing the graph diameter is known for general graphs. Yet there are many heuristics that perform well in real-world networks. Most of these heuristics compute the eccentricities of a carefully chosen subset of vertices. An extreme example is the TwoSweep algorithm: 1. Pick an arbitrary vertex s, and perform breadth-first search from s to compute a vertex t ∈ arg max v∈V dist(s, v).
2. Use breadth-first search again to compute ecc(t) and return the result.
This heuristic always produces a lower bound on a graph's diameter, and in practice usually achieves a close approximation. What properties of "real-world" graphs might explain this empirical performance?
The BCT model is largely inspired by the metric properties of random graphs. To explain, for a vertex s and natural number k, let τ s (k) denote the smallest length ℓ so that there are at least k vertices at distance (exactly) ℓ from s. Ignoring the specifics of the random graph model, the ℓ-step neighborhoods (i.e., vertices at distance exactly ℓ) of a vertex in a random graph resemble uniform random sets of size increasing with ℓ. We next use this property to derive a heuristic upper bound on dist(s, t). Define ℓ s := τ s ( √ n) and ℓ t := τ t ( √ n). Since the ℓ s -step neighborhood of s and the ℓ t -step neighborhood of t act like random sets of size √ n, a birthday paradox argument implies that they intersect with non-trivial probability. If they do intersect, then ℓ s + ℓ t is an upper bound on dist(s, t). In any event, we can adopt this inequality as a deterministic graph property, which can be tested against real network data. 4 Property 5.1. For all s, t ∈ V , dist(s, t) ≤ τ s ( √ n) + τ t ( √ n).
One would expect this distance upper bound to be tight for pairs of vertices that are far away from each other, and in a reasonably random graph, this will be true for most of the vertex pairs. This leads us to the next property. 5 Property 5.2. For all s ∈ V : for "most" t ∈ V , dist(s, t) > τ s ( √ n) + τ t ( √ n) − 1.
The third property posits a distribution on the τ s ( √ n) values. Let T (k) denote the average n −1 s∈V τ s (k).
Property 5.3. There are constants c, γ > 0 such that the fraction of vertices s satisfying τ s ( A consequence of this property is that the largest value of τ s ( √ n) is T ( √ n) + log c n + Θ(1). As we discuss below, these properties will imply that simple heuristics work well for computing the diameter of a graph. On the other hand, these properties do not generally hold in real-world graphs. The actual BCT model has a nuanced version of these properties, parameterized by vertex degrees. In addition, the BCT model imposes an approximate power-law degree distribution, in the spirit of power-law bounded graphs (Definition 4.1 in Section 4). This nuanced list of properties can be empirically verified on a large set of real-world graphs.
Nonetheless, for understanding the connection of metric properties to diameter computation, it suffices to look at Properties 5.1-5.3. We can now bound the eccentricities of vertices. The properties imply that Fix u and imagine varying v to estimate ecc(u). For "most" vertices v, dist(u, v) ≥ τ u ( √ n) + τ v ( √ n) − 1. By Property 5.3, one of the vertices v satisfying this lower bound will also satisfy . Combining, we can bound the eccentricity by The bound (4) is significant because it reduces maximizing ecc(u) over u ∈ V to maximizing τ u ( √ n).
Pick an arbitrary vertex s and consider a vertex u that maximizes dist(s, u). By an argument similar to the one above (and because most vertices are far away from s), we expect that dist(s, u) ≈ τ s ( √ n) + τ u ( √ n). Thus, a vertex u maximizing dist(s, u) is almost the same as a vertex maximizing τ u ( √ n), which by (4) is almost the same as a vertex maximizing ecc(u). This gives an explanation of why the TwoSweep algorithm performs so well. Its first use of breadth-first search identifies a vertex u that (almost) maximizes ecc(u). The second pass of breadth-first search (from u) then computes a close approximation of the diameter. The analysis in this section is heuristic, but it captures much of the spirit of algorithm analysis in the BCT model. These results for TwoSweep can be extended to other heuristics that choose a set of vertices through a random process to lower bound the diameter. In general, the key insight is that most distances dist (u, v) in the BCT model can be closely approximated as a sum of quantities that depend only on either u or v.

Discussion
Let's take a bird's-eye view of this chapter. The big challenge in the line of research described in this chapter is the formulation of graph classes and properties that both reflect real-world graphs and lead to a satisfying theory. It seems unlikely that any one class of graphs will simultaneously capture all the relevant properties of (say) social networks. Accordingly, this chapter described several graph classes that target specific empirically observed graph properties, each with its own algorithmic lessons: • Triadic closure aids the computation of dense subgraphs.
• Power-law degree distributions aid subgraph counting.
• ℓ-hop neighborhood structure influences the structure of shortest paths.
These lessons suggest that, when defining a graph class to capture "real-world" graphs, it may be important to keep a target algorithmic application in mind.
Different graph classes differ in how closely the definitions are tied to domain knowledge and empirically observed statistics. The c-closed and triangle-dense graph classes are in the spirit of classical families of graphs (e.g., planar or bounded-treewidth graphs), and they sacrifice precision in the service of generality, cleaner definitions, and arguably more elegant theory. The PLB and BCT frameworks take the opposite view: the graph properties are quite technical and involve many parameters, and in exchange tightly capture the properties of "real-world" graphs. These additional details can add fidelity to theoretical explanations for the surprising effectiveness of simple heuristics.
A big advantage of combinatorially defined graph classes-a hallmark of graph-theoretic work in theoretical computer science-is the ability to empirically validate them on real data. The standard statistical viewpoint taken in network science has led to dozens of competing generative models, and it is nearly impossible to validate the details of such a model from network data. The deterministic graph classes defined in this chapter give a much more satisfying foundation for algorithmics on real-world graphs.
Complex algorithms for real-world problems can be useful, but practical algorithms for graph analysis are typically based on simple ideas like backtracking or greedy algorithms. An ideal theory would reflect this reality, offering compelling explanations for why relatively simple algorithms have such surprising efficacy in practice.
We conclude this section with some open problems.
The definitions of c-closed and weakly c-closed graphs (Definitions 2.1-2.2) are from Fox et al. (2020), as is the fixed-parameter tractability result for the maximum clique problem (Theorem 2.3). Eppstein et al. (2010) proved an analogous result with respect to a different parameter, the degeneracy of the input graph. The reduction from efficiently enumerating maximal cliques to bounding the number of maximal cliques (Theorem 2.1) is from Tsukiyama et al. (1977). Moon-Moser graphs and the Moon-Moser bound on the maximum number of maximal cliques of a graph are from Moon and Moser (1965).
The definition of triangle-dense graphs (Definition 3.1) and the inverse theorem for them (Theorem 3.1) are from Gupta et al. (2016). The computation of the triangle density of the Facebook graph is detailed by Ugander et al. (2011).
The definition of power law bounded graphs (Definition 4.1) first appeared in Berry et al. (2015) in the context of triangle counting, but it was formalized and applied to many different problems by Brach et al. (2016), including triangle counting (Theorem 4.2), clique enumeration (Exercise 10), and linear algebraic problems for matrices with a pattern of non-zeroes that induces a PLB graph. Brach et al. (2016) also performed a detailed empirical analysis, validating Definition 4.1 (with small shifts t) on real data. The degeneracy-parameterized bound for counting triangles is essentially due to Chiba and Nishizeki (1985).
The BCT model (Section 5) and the fast algorithm for computing the diameter of a graph are due to Borassi et al. (2017).