rgg v0.1.0 RGG.Square.StaticCalculations

This module contains all of the functions that perform static calculations for the generation of RGGs.

Link to this section Summary

Functions

This function calculates the radius that is used to connect nodes in the square topology of graph. The parameters are n, and a. The returned radius will yield average degree a when connecting randomly generated points on the unit square

This function calculates the maximum number of buckets we can use when connecting nodes to achieve linear runtime when connecting the nodes.. The only parameter is r as we need to make sure we place nodes within radius r of each other within 1 bucket of each other.

Examples

iex>RGG.Square.StaticCalculations.calculate_radius_square(1000, 25) |> RGG.Square.StaticCalculations.num_buckets()
10

Link to this section Functions

Link to this function calculate_radius_square(n, a)

This function calculates the radius that is used to connect nodes in the square topology of graph. The parameters are n, and a. The returned radius will yield average degree a when connecting randomly generated points on the unit square.

Examples

iex> RGG.Square.StaticCalculations.calculate_radius_square(1000, 25)
0.08920620580763855

This function calculates the maximum number of buckets we can use when connecting nodes to achieve linear runtime when connecting the nodes.. The only parameter is r as we need to make sure we place nodes within radius r of each other within 1 bucket of each other.

Examples

iex>RGG.Square.StaticCalculations.calculate_radius_square(1000, 25) |> RGG.Square.StaticCalculations.num_buckets()
10