{'fraction_non_alphanumeric': 0.05683229813664596, 'fraction_numerical': 0.014720496894409938, 'mean_word_length': 3.5858729706636288, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 9, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
On the Stretch Factor of Randomly Embedded Random Graphs

We consider a random graph G(n,p) whose vertex set V has been randomly embedded in the unit square and whose edges are given weight equal to the geometric distance between their end vertices. Then each pair {u,v} of vertices have a distance in the weighted graph, and a Euclidean distance. The stretch factor of the embedded graph is defined as the maximum ratio of these two distances, over all u,v in V. We give upper and lower bounds on the stretch factor (holding asymptotically almost surely), and show that for p not too close to 0 or 1, these bounds are best possible in a certain sense. Our results imply that the stretch factor is bounded with probability tending to 1 if and only if n(1-p) tends to 0, answering a question of O'Rourke.


Introduction
Let G be a graph embedded in the plane. For every two points u and v, let d(u, v) denote their Euclidean distance. Make G weighted by putting weight d(u, v) on every edge uv. For two vertices u and v, let d G (u, v) denote their shortest-path distance on (weighted) G. The stretch factor of G is defined as where the maximum is taken over all vertices u, v. If G is disconnected then its stretch factor is undefined.
The stretch factor (also known as the spanning ratio or the dilation) is a well studied parameter in discrete geometry, see for instance the book [6] or the recent survey [2]. An important problem in this context is the following. Given n points on the plane, find a set of O(n) pairs of them, such that when you create a geometric graph by adding the segments joining the points in each pair, this geometric graph has bounded stretch factor. A possible approach is to choose a random set of pairs. Suppose that we randomly choose M distinct pairs from the set of all n 2 pairs of points, and add the corresponding edges. Then, one can ask, how large should M be to guarantee that the stretch factor is bounded, with probability tending to 1? In this paper we show that if the initial points are chosen uniformly at random from the unit square, then we need almost all edges to guarantee a bounded stretch factor, hence this method is inefficient.
The setting is as follows. Select n points uniformly at random from the unit square, and then form a random geometric graph G on these points by joining each pair independently with probability p, where p is in general a function of n. This is not a "random geometric graph" in the sense of Penrose [7], because points are joined without regard to their geometric distance. However, one can call this a randomly embedded random graph, since you get the same thing if you start from an Erdős-Rényi random graph with parameters n, p and embed each of its vertices into a random point in the unit square. The stretch factor of G is a random variable and we denote it by F (n, p). We study the asymptotic behaviour of F (n, p) when n is large, and give probabilistic lower and upper bounds for it. In the following, asymptotically almost surely means with probability 1 − o(1), where the asymptotics is with respect to n.
In the open problem session of CCCG 2009 [3], O'Rourke asked the following question: for what range of p is F (n, p) bounded asymptotically almost surely? As a conclusion of our bounds, we answer this question as follows. Let λ > 1 be any fixed constant, and note that ω(1) denotes a function that tends to infinity as n grows. If n(1 − p) = ω(1), then asymptotically almost surely F (n, p) > λ. If n(1 − p) = Θ(1), then F (n, p) > λ with probability Ω(1). Finally, if n(1 − p) = o(1), then asymptotically almost surely F (n, p) < λ.
Our main lower bound is the following theorem. Theorem 1. Let w(n) = ω(1). Then asymptotically almost surely Let λ be fixed. This theorem implies that if n(1 − p) = ω(1), then asymptotically almost surely F (n, p) > λ. This strengthens the result of the first author [5], who proved the same thing for p < 1 − Ω(1).
Let CON denote the event "G is connected." Recall that if the graph is disconnected, then its stretch factor is undefined. For any p < 1, this happens with a positive probability, hence E[F (n, p)] is undefined. It is then natural to bound E[F (n, p)|CON] instead.
Our main upper bound is the following theorem.
The more interesting case is when n(1 − p) = Θ(1). In this regime Theorem 2 states that E [F (n, p)| CON] = O(1). So, one may wonder if there is a constant λ such that asymptotically almost surely F (n, p) < λ. However, Lemma 8 (which is the main lemma in the proof of Theorem 1) implies that this is not the case: for any fixed λ, with probability Ω(1) we have CON and F (n, p) > λ. In other words, the random variable F (n, p) is not concentrated. In this case one might expect that the distribution of F (n, p) tends to some nontrivial limit if n(1 − p) is constant.
Lemma 8 actually implies that for a wide range of p, the first conclusion of Theorem 2 is tight, in the sense that w(n) cannot be replaced with a constant. Namely, the following is true.
Theorem 3. Assume that p = Ω(1) and n(1 − p) = Ω(1). There is no absolute constant C for which asymptotically almost surely There is a nontrivial gap between our lower and upper bounds when p = o (1). It remains open to determine which of the bounds are closer to the correct answer in this regime.
The following notation will be used in the rest of the paper. For a point Q and nonnegative real R, C(Q, R) denotes the intersection of the disc with centre Q and radius R and the unit square, and F simply denotes F (n, p). We often identify each vertex with the point it has been embedded into. All logarithms are in natural base.

The Lower Bound
In this section we prove Theorems 1 and 3. First we need an easy geometric result.
Proof. By symmetry, we may assume that Q lies in the upper left quarter of the unit square. If 0 ≤ R ≤ 1/2, then the bottom right quarter of the disc with centre Q and radius R lies completely inside the unit square, and hence the intersection area is at least πR 2 /4 ≥ πR 2 /32. If 1/2 < R ≤ √ 2, then C(Q, R) contains C(Q, 1/2), so its area is at least Let c be such that 1/51 < c < 1/16π and cn is an even integer. Notice that here, as in the rest of the paper, we always mean 1/(ab) when we write 1/ab. Lemma 5. Choose cn points independently and uniformly at random from the unit square. Build a graph H on these vertices, by joining two vertices if their distance is at most 2/ √ n. With probability at least 1 − O(1/n), H has at least cn/2 isolated vertices.
Proof. Let X be the number of edges of H. Then we have X = i<j X i,j , where X i,j is the indicator variable for the distance between vertices i and j being at most 2/ √ n. Note that if vertex i has been embedded in point p i , then X i,j = 1 if and only if vertex j is embedded in C(p i , 2/ √ n). So by Proposition 4 we have We claim that Var [X] = O(n). Note that if {i, j} and {k, l} are two disjoint sets of vertices, then ≤ M 2 . Otherwise, let j = l. Then for X i,j = X k,j = 1 to happen, both vertices i and k should be embedded at distance at most 2/ √ n from where vertex j has been embedded, the probability of which is not more than q 2 2 . Hence in this case E [X i,j X k,l ] ≤ q 2 2 , and the number of such pairs of pairs is not more than (cn) 3 . Consequently, and so By Chebyshev's inequality, Thus with probability 1 − O(1/n), H has at most 2E [X] ≤ 4c 2 πn edges. If this is the case, then it has at least cn − 8c 2 πn ≥ cn/2 isolated vertices, and this completes the proof. Now, back to the main problem. Assume that the n vertices are embedded one by one, and the edges are exposed at the end. Consider the moment when exactly cn vertices have been embedded. Build an auxiliary graph on these vertices, by joining two vertices if their distance is at most 2/ √ n. By Lemma 5, with probability 1 − O(1/n), this graph has at least cn/2 isolated vertices. We condition on the embedding of the first cn vertices such that this event holds. Let A be a set of cn/2 isolated vertices in this graph. The vertices in A are called the primary vertices, the vertices that are one of the first cn vertices but are not in A are called far vertices, and the vertices that have not been embedded yet are called the secondary vertices.
Let m = cn/2 be the number of primary vertices, and n ′ = n(1 − c) be the number of secondary vertices. A primary disc is a set of the form C(v, 1/ √ n), where v ∈ A; the vertex v is called the centre of the primary disc. So, we have m primary discs, say R 1 , R 2 , . . . , R m . Let W be the set of points of the unit square that are not contained in any primary disc. Notice that by the definition of A, the primary discs are disjoint, and no far vertex is contained in any primary disc.
Consider the following process for embedding the secondary vertices and exposing all of the edges of G: 1. Note that {W, R 1 , R 2 , . . . , R m } is a partition of the unit square. In the first phase, to each secondary vertex, independently, we randomly assign an element of the partition, with probability proportional to the area of that element. Thus for each primary disc it is known how many secondary vertices it contains, but their exact position is not known.
2. In the second phase, for each secondary vertex we choose a random point in the corresponding element, and place the vertex at that point.
3. In the third phase, for every pair of vertices we add an edge independently with probability p.
Clearly this process generates random geometric graphs with the same distribution as before, however it makes the analysis easier.
Lemma 6. With probability 1 − exp (−Ω(n)), after the first phase, there exist at least e −8 m primary discs containing exactly two vertices: one primary (the centre) and one secondary.
To prove this lemma we will use the following large deviation inequality, which is Corollary 2.27 in Janson et al. [4].

Proposition 7 ([4]
). Let Z 1 , Z 2 , . . . , Z n be a sequence of independent random variables, and suppose that the function f satisfies |f (x 1 , x 2 , . . . , x n ) − f (y 1 , y 2 , . . . , y n )| ≤ c , whenever the vectors (x 1 , x 2 , . . . , x n ) and (y 1 , y 2 , . . . , y n ) differ only in one of the coordinates. Then, Proof of Lemma 6. Recall that we have n ′ secondary vertices, and to each of them, independently, we randomly assign an element of the partition {W, R 1 , R 2 , . . . , R m }, with probability proportional to the area of that element. By Proposition 4, the area of each primary disc is between π/4n and π/n; so for every 1 ≤ i ≤ m, the probability that R i contains exactly one secondary vertex is at least as n ′ ≥ n/2. Let p 1 = π exp(−2π)/8.
Let X be the number of primary discs that contain exactly one secondary vertex. Since every primary disc contains exactly one primary vertex (its centre), to prove the lemma we need to show that we have X ≥ e −8 m with probability 1 − exp (−Ω(n)). The calculation above shows that E [X] ≥ mp 1 . Since p 1 > 2e −8 , showing that completes the proof of the lemma.
To every secondary vertex v we assign a variable Z v , which equals k if v is assigned to R k in the first phase, and equals 0 if v is assigned to W. Since the assignment in the first phase is done independently, the random variables {Z v : v secondary} are independent. Moreover, changing the value of Z v for a single vertex will change X by at most 2. Hence by Proposition 7 we have Therefore, with probability 1 − exp (−Ω(n)), there exist at least e −8 m primary discs containing exactly two vertices.
A primary disc R containing exactly two vertices u and v is called nice if the distance between u and v is less than 1/λ √ n, and u and v are not adjacent in G. We claim that the existence of a nice primary disc R implies that the stretch factor of G is larger than λ. To see this, assume, by symmetry, that u is the vertex of the centre of R. The (weighted) distance between u and v in G is at least 1/ √ n, since any (u, v)-path in G must go out of R at the very first step. However, the Euclidean distance between u and v is at most 1/λ √ n, and we have Theorem 1 follows immediately from the following lemma.
Lemma 8. For any positive λ we have Proof. Consider a primary disc R such that after the first phase, it has been determined that R contains exactly two vertices, u and v, where u is the centre of R. Then for R to be nice, in the second phase v should be placed in C(u, 1/λ √ n), and in the third phase u and v should become nonadjacent in G. The probability of the former is at least even if the disc of radius 1/ √ n centred at u is not wholly contained in the unit square, and the probability of the latter is 1 − p. These two events are independent, so the probability that R is not nice is at most 1 − (1 − p)λ −2 .
By Lemma 6, once the first phase finishes, with probability 1 − exp(−Ω(n)) there exists a set B of at least e −8 m primary discs, such that each primary disc in B contains exactly two vertices. We condition on this event in the following. The crucial observation is that the events happening during the second and third phases inside each primary disc in B are independent of the others. In particular, the events {R is nice : R ∈ B} are mutually independent; hence the probability that none of the primary discs in B become nice during the second and third phases, is at most

The Upper Bound
In this section we prove Theorem 2. We will use the following version of the Chernoff bound. This is Theorem 2.1 in Janson et al. [4].
Proposition 9 ( [4]). Let X = X 1 + · · · + X m , where the X i are independent identically distributed indicator random variables. Then for any ǫ ≥ 0, Lemma 10. For any positive λ, . Let u and v be arbitrary vertices. First, we show that with probability at least 1 − exp(−p 2 n/16), u and v have at least p 2 n/4 common neighbours. The expected number of common neighbours of u and v is p 2 (n − 2) > p 2 n/2, and since the edges appear independently, by Proposition 9, the probability that u and v have less than p 2 n/4 common neighbours is less than exp(−p 2 n/16). In the following, we condition on the event that u and v have at least p 2 n/4 common neighbours.
Now, consider the random embedding of the graph. For any t ≥ 0, if u and v are adjacent, or if d(u, v) ≥ t and u and v have a common neighbour w with d(u, w) ≤ λt, then we would have d G (u, v) ≤ (2λ + 1)d(u, v) so the pair is not bad. To give an upper bound for the probability of badness of the pair, we compute the probability that u and v are nonadjacent, and ih ≤ d(u, v) ≤ (i + 1)h, and they have no common neighbour w with d(u, w) ≤ λih, and sum over i.
Let us condition on the embedding of vertex u, and denote by a(u, s) the area of the set of points in the unit square at distance at most s from u, and let q = 1 − p. Then since u and v have at least p 2 n/4 common neighbours and these common neighbours are embedded independently, for any h > 0 a(u, λih)) p 2 n/4 .
Proof of Theorem 2. We need to show that if p 2 n ≥ 33 log n and w(n) = ω(1), then asymptotically almost surely we have and that if p 2 n ≥ 113 log n, then For the first part, let λ = w(n) √ n(1−p) 2p . By Lemma 10, Pr[F > s| CON] ds ≤ 1 + ǫ .
Assuming the graph is connected, for any pair {u, v} of vertices there is a path having at most n − 1 edges joining them, so d G (u, v) < n √ 2. Hence, if F > s, then there exists a pair {u, v} of nonadjacent vertices with d(u, v) < n √ 2/s. Let u be a fixed vertex. Let A u be the event that there exists a vertex, not adjacent to u, at distance less than n √ 2/s from u. By the union bound, Pr[A u ] < 2πn 3 (1−p)/s 2 . The probability that there exists a vertex u for which A u happens is by the union bound less than 2πn 4 (1 − p)/s 2 . Therefore, We will now bound the second term in the right hand side of (1). Notice that for any fixed embedding of the vertices, the event "F > λ" is a decreasing property (with respect to the edges in the graph), and the event "G is connected" is an increasing one. Hence by the correlation inequalities (see, e.g., Theorem 6. Therefore, since p 2 n > 113 log n,