User:Flogr/sandbox

Generating hyperbolic geometric graphs
Krioukov et al. describe a model to generate hyperbolic geometric graphs with uniformly random node distribution (as well as generalized versions) in $$\mathbb{H}_\zeta^2$$ that yield a power-law distribution and other interesting properties. The angular coordinate $$\theta$$ of each point/node is chosen uniformly random from $$[0, 2\pi]$$, while the density function for the radial coordinate r is chosen according to the probability distribution $$\rho$$:


 * $$\rho(r) = \alpha \frac{\sinh(\alpha r)}{\cosh(\alpha R) - 1}$$

The growth parameter $$\alpha > 0$$ controls the distribution: For $$\alpha = \zeta$$, the distribution is uniform in $$\mathbb{H}_\zeta^2$$, for smaller values the nodes are distributed more towards the center of the disk and for bigger values more towards the border. In this model, edges between nodes $$u$$ and $$v$$ exist iff $$d_{uv} < R$$. The average degree is controlled by the radius $$R$$ of the hyperbolic disk. It can be shown, that for $$\alpha / \zeta > 1/2$$ the node degrees follow a power law distribution with exponent $$\gamma = 1 + 2\alpha / \zeta$$.

The image depicts randomly generated graphs for different values of $$\alpha$$ and $$R$$ in $$\mathbb{H}_1^2$$. It can be seen how $$\alpha$$ has an effect on the distribution of the nodes and $$R$$ on the connectivity of the graph. The native representation is used for the visualization of the graph, therefore edges are straight lines.

Quadratic complexity generator
The naive algorithm for the generation of hyperbolic geometric graphs distributes the nodes on the hyperbolic disk by choosing the angular and radial coordinates of each point are sampled randomly. For every pair of nodes it is then checked whether the distance between them is smaller than $$R$$. The pseudocode looks as follows:


 * $$ V = \{ \}, E = \{ \} $$
 * for $$ i \gets 0 $$ to $$ N - 1 $$ do
 * $$ \theta \gets U[0, 2\pi] $$
 * $$ r \gets \frac{1}{\alpha} \text{acosh} (1 + (\cosh \alpha R - 1) U[0, 1]) $$
 * $$ V = V \cup \{ (r, \theta)\} $$
 * for every pair  $$ (u, v) \in V \times V, u \neq v$$ do
 * if $$ d_{uv} < R $$ then
 * $$ E = E \cup \{ (u,v) \} $$
 * return $$ V, E $$

$$ N $$ is the number of nodes to generate, the distribution of the radial coordinate by the probability density function $$ \rho $$ is achieved by using inverse transform sampling. $$U$$denotes the uniform sampling of a value in the given interval. Because the algorithm checks for edges for all pairs of nodes, the runtime is quadratic. For applications where $$ N $$ is big, this is not viable any more and algorithms with subquadratic runtime are needed.