# Random geometric graph

Part of a series on :
Network science :
Theory :
Graph
Complex network
Contagion
Small-world
Scale-free
Community structure
Percolation
Evolution
Controllability
Graph drawing
Social capital
Link analysis
Optimization
Reciprocity
Closure
Homophily
Transitivity
Preferential attachment
Balance theory
Network effect
Social influence :
Network types :
Informational (computing)
Telecommunication
Transport
Social
Scientific collaboration
Biological
Artificial neural
Interdependent
Semantic
Spatial
Dependency
Flow
on-Chip :
Graphs :
MetricsAlgorithms :
Centrality
Degree
Motif
Clustering
Degree distribution
Assortativity
Distance
Modularity
Efficiency :
Models :
ListsCategories :
Topics
Software
Network scientists
Category:Network theory
Category:Graph theory :
vte :
In graph theory, a random geometric graph (RGG) is the mathematically simplest spatial network, namely an undirected graph constructed by randomly placing N nodes in some metric space (according to a specified probability distribution) and connecting two nodes by a link if and only if their distance is in a given range, e.g. smaller than a certain neighborhood radius, r.
Random geometric graphs resemble real human social networks in a number of ways. For instance, they spontaneously demonstrate community structure - clusters of nodes with high modularity. Other random graph generation algorithms, such as those generated using the Erdős–Rényi model or Barabási–Albert (BA) model do not create this type of structure. Additionally, random geometric graphs display degree assortativity according to their spatial dimension: "popular" nodes (those with many links) are particularly likely to be linked to other popular nodes.
Percolation theory on the random geometric graph (the study of its global connectivity) is sometimes called the Gilbert disk model after the work of Edgar Gilbert, who introduced these graphs and percolation in them in a 1961 paper. A real-world application of RGGs is the modeling of ad hoc networks. Furthermore they are used to perform benchmarks for graph algorithms.

## Definition

In the following, let G = (V, E) denote an undirected Graph with a set of vertices V and a set of edges E ⊆ V × V. The set sizes are denoted by |V| = n and |E| = m. Additionally, if not noted otherwise, the metric space [0,1)$^d$ with the euclidean distance is considered, i.e. for any points $x,y\in [0,1)^{d}$ the euclidean distance of x and y is defined as
    $d(x,y)=||x-y||_{2}={\sqrt {\sum _{i=1}^{d}(x_{i}-y_{i})^{2}}}$.
A random geometric graph (RGG) is an undirected geometric graph with nodes randomly sampled from the uniform distribution of the underlying space [0,1)$^d$. Two vertices p, q ∈ V are connected if, and only if, their distance is less than a previously specified parameter r ∈ (0,1), excluding any loops. Thus, the parameters r and n fully characterize a RGG.

## Algorithms
### Naive algorithm

The naive approach is to calculate the distance of every vertex to every other vertex. As there are n(n−1)/2 {\textstyle {\frac {n(n-1)}{2}}} possible connections that are checked, the time complexity of the naive algorithm is Θ(n$^2$){\textstyle \Theta (n^{2})}. The samples are generated by using a random number generator (RNG) on $[0,1)^{d}$. Practically, one can implement this using d random number generators on $[0,1)$, one RNG for every dimension.

#### Pseudocode

As this algorithm is not scalable (every vertex needs information of every other vertex), Holtgrewe et al. and Funke et al. have introduced new algorithms for this problem.

### Distributed algorithms
#### Holtgrewe et al.

This algorithm, which was proposed by Holtgrewe et al., was the first distributed RGG generator algorithm for dimension 2. It partitions the unit square into equal sized cells with side length of at least $r$. For a given number $P=p^{2}$ of processors, each processor is assigned k/p × k/p {\textstyle {k \over p}\times {k \over p}} cells, where k=⌊1/r⌋.{\textstyle k=\left\lfloor {1/r}\right\rfloor .} For simplicity, P{\textstyle P} is assumed to be a square number, but this can be generalized to any number of processors. Each processor then generates n/P {\textstyle {\frac {n}{P}}} vertices, which are then distributed to their respective owners. Then the vertices are sorted by the cell number they fall into, for example with Quicksort. Next, each processor then sends their adjacent processors the information about the vertices in the border cells, such that each processing unit can calculate the edges in their partition independent of the other units. The expected running time is O(n/P log⁡ n/P){\textstyle O({\frac {n}{P}}\log {\frac {n}{P}})}. An upper bound for the communication cost of this algorithm is given by $T_{all-to-all}(n/P,P)+T_{all-to-all}(1,P)+T_{point-to-point}(n/(k\cdot {P})+2)$, where $T_{all-to-all}(l,c)$ denotes the time for an all-to-all communication with messages of length l bits to c communication partners. $T_{point-to-point}(l)$ is the time taken for a point-to-point communication for a message of length l bits.
Since this algorithm is not communication free, Funke et al. proposed a scalable distributed RGG generator for higher dimensions, which works without any communication between the processing units.

#### Funke et al.

The approach used in this algorithm is similar to the approach in Holtgrewe: Partition the unit cube into equal sized chunks with side length of at least r. So in d = 2 this will be squares, in d = 3 this will be cubes. As there can only fit at most ⌊1/r⌋{\textstyle {\left\lfloor {1/r}\right\rfloor }} chunks per dimension, the number of chunks is capped at ⌊1/r⌋$^d${\textstyle {\left\lfloor {1/r}\right\rfloor }^{d}}. As before, each processor is assigned ⌊1/r⌋$^d$/P {\textstyle {\left\lfloor {1/r}\right\rfloor }^{d} \over P} chunks, for which it generates the vertices. To achieve a communication free process, each processor then generates the same vertices in the adjacent chunks by exploiting pseudorandomization of seeded hash functions. This way, each processor calculates the same vertices and there is no need for exchanging vertex information.
For dimension 3, Funke et al. showed that the expected running time is O((m+n)/P+log⁡P){\textstyle O({\frac {m+n}{P}}+\log {P})}, without any cost for communication between processing units.

## Properties
### Isolated vertices and connectivity

The probability that a single vertex is isolated in a RGG is (1−πr$^2$)$^{n−1}${\textstyle (1-\pi r^{2})^{n-1}}. Let X{\textstyle X} be the random variable counting how many vertices are isolated. Then the expected value of X{\textstyle X} is E(X)=n(1−πr$^2$)$^{n−1}$=ne$^{−πr2n}$−O(r$^4$n){\textstyle E(X)=n(1-\pi r^{2})^{n-1}=ne^{-\pi r^{2}n}-O(r^{4}n)}. The term μ=ne$^{−πr2n}${\textstyle \mu =ne^{-\pi r^{2}n}} provides information about the connectivity of the RGG. For μ⟶0{\textstyle \mu \longrightarrow 0}, the RGG is asymptotically almost surely connected. For $\mu \longrightarrow \infty$, the RGG is asymptotically almost surely disconnected. And for μ=Θ(1){\textstyle \mu =\Theta (1)}, the RGG has a giant component that covers more than n/2 {\textstyle {\frac {n}{2}}} vertices and $X$ is Poisson distributed with parameter $\mu$. It follows that if μ=Θ(1){\textstyle \mu =\Theta (1)}, the probability that the RGG is connected is P[X=0]∼e$^{−μ}${\textstyle P[X=0]\sim e^{-\mu }} and the probability that the RGG is not connected is P[X>0]∼1−e$^{−μ}${\textstyle P[X>0]\sim 1-e^{-\mu }}.
For any l$_p${\textstyle l_{p}}-Norm ( 1≤p≤∞{\textstyle 1\leq p\leq \infty }) and for any number of dimensions $d>2$, a RGG possesses a sharp threshold of connectivity at r∼(ln⁡(n)/α$_{p, d}$n)$^{1/d}${\textstyle r\sim \left({\ln(n) \over \alpha _{p, d}n}\right)^{1 \over d}} with constant $\alpha _{p,d}$. In the special case of a two-dimensional space and the euclidean norm ($d=2$ and $p=2$) this yields r∼√(ln⁡(n)/πn){\textstyle r\sim {\sqrt {\ln(n) \over \pi n}}}.

### Hamiltonicity

It has been shown, that in the two-dimensional case, the threshold r∼√(ln⁡(n)/πn){\textstyle r\sim {\sqrt {\ln(n) \over \pi n}}} also provides information about the existence of a Hamiltonian cycle (Hamiltonian Path). For any $\epsilon >0$, if r∼√(ln⁡(n)/((π+ϵ)n)){\textstyle r\sim {\sqrt {\ln(n) \over (\pi +\epsilon )n}}}, then the RGG has asymptotically almost surely no Hamiltonian cycle and if r∼√(ln⁡(n)/(π−ϵ)n){\textstyle r\sim {\sqrt {\ln(n) \over (\pi -\epsilon )n}}} for any ϵ>0{\textstyle \epsilon >0}, then the RGG has asymptotically almost surely a Hamiltonian cycle.

### Clustering coefficient

The clustering coefficient of RGGs only depends on the dimension d of the underlying space [0,1)$^d$. The clustering coefficient is
C$_d$=1−H$_d$(1){\textstyle C_{d}=1-H_{d}(1)} for even $d$ and C$_d$=3/2−H$_d$(1/2){\textstyle C_{d}={3 \over 2}-H_{d}({1 \over 2})} for odd $d$ where$H_{d}(x)={1 \over {\sqrt {\pi }}}\sum _{i=x}^{d \over 2}{\Gamma (i) \over \Gamma (i+{1 \over 2})}\left({3 \over 4}\right)^{i+{1 \over 2}}$For large $d$, this simplifies to $C_{d}\sim 3{\sqrt {2 \over \pi d}}\left({3 \over 4}\right)^{d+1 \over 2}$.

## Generalized random geometric graphs

In 1988 Waxman generalised the standard RGG by introducing a probabilistic connection function as opposed to the deterministic one suggested by Gilbert. The example introduced by Waxman was a stretched exponential where two nodes $i$ and $j$ connect with probability given by H$_{ij}$=βe$^{−rij/r0}${\textstyle H_{ij}=\beta e^{-{r_{ij} \over r_{0}}}} where $r_{ij}$ is the euclidean separation and $\beta$, $r_{0}$ are parameters determined by the system. This type of RGG with probabilistic connection function is often referred to a soft random geometric Graph, which now has two sources of randomness; the location of nodes (vertices) and the formation of links (edges). This connection function has been generalized further in the literature H$_{ij}$=βe$^{−(rij/r0)η}${\textstyle H_{ij}=\beta e^{-\left({r_{ij} \over r_{0}}\right)^{\eta }}} which is often used to study wireless networks without interference. The parameter $\eta$ represents how the signal decays with distance, when $\eta =2$ is free space, $\eta >2$ models a more cluttered environment like a town (= 6 models cities like New York) whilst $\eta <2$ models highly reflective environments. We notice that for $\eta =1$ is the Waxman model, whilst as $\eta \to \infty$ and β=1{\textstyle \beta =1} we have the standard RGG. Intuitively these type of connection functions model how the probability of a link being made decays with distance.

### Overview of some results for Soft RGG

In the high density limit for a network with exponential connection function the number of isolated nodes is Poisson distributed, and the resulting network contains a unique giant component and isolated nodes only. Therefore by ensuring there are no isolated nodes, in the dense regime, the network is a.a.s fully connected; similar to the results shown in for the disk model. Often the properties of these networks such as betweenness centrality and connectivity are studied in the limit as the density $\to \infty$ which often means border effects become negligible. However, in real life where networks are finite, although can still be extremely dense, border effects will impact on full connectivity; in fact showed that for full connectivity, with an exponential connection function, is greatly impacted by boundary effects as nodes near the corner/face of a domain are less likely to connect compared with those in the bulk. As a result full connectivity can be expressed as a sum of the contributions from the bulk and the geometries boundaries. A more general analysis of the connection functions in wireless networks has shown that the probability of full connectivity can be well approximated expressed by a few moments of the connection function and the regions geometry.