NetworKit::HyperbolicSpace Class Reference

`#include <HyperbolicSpace.h>`

## Public Member Functions

HyperbolicSpace ()=default

virtual ~HyperbolicSpace ()=default

## Static Public Member Functions

static void fillPoints (vector< double > &angles, vector< double > &radii, double R, double alpha)

static void fillPoints (vector< double > &angles, vector< double > &radii, double minPhi, double maxPhi, double minR, double maxR, double alpha)

static double poincareMetric (double firstangle, double firstR, double secondangle, double secondR)
This distance measure is taken from the PoincarĂ© disc model. More...

static double nativeDistance (double firstangle, double firstR, double secondangle, double secondR)

static double poincareMetric (Point2D< double > a, Point2D< double > b)

static Point2D< double > polarToCartesian (double phi, double r)

static std::map< index, Point
< float > >
polarToCartesian (const vector< double > &angles, const vector< double > &radii)
Convenience function for visualizations which expect coordinates as map<index,Point<float> > More...

static void cartesianToPolar (Point2D< double > a, double &phi, double &r)

static void getEuclideanCircle (Point2D< double > hyperbolicCenter, double hyperbolicRadius, Point2D< double > &euclideanCenter, double &euclideanRadius)
Converts a hyperbolic circle to a Euclidean circle. More...

Project radial coordinates of the hyperbolic plane into the Poincare disk model. More...

Project radial coordinates of the Poincare model into the hyperbolic plane. More...

static double getExpectedDegree (double n, double alpha, double R)

static double searchTargetRadiusForColdGraphs (double n, double k, double alpha, double epsilon)

static double getTargetRadius (double n, double m, double alpha=1, double T=0, double epsilon=0.01)

static double effectiveAreaInCell (double minPhi, double maxPhi, double minR, double maxR, double alpha)

static double hyperbolicSpaceInEuclideanCircle (double r_c, double d_c, double R)

static double maxRinSlice (double minPhi, double maxPhi, double phi_c, double r_c, double euRadius)

## Constructor & Destructor Documentation

 NetworKit::HyperbolicSpace::HyperbolicSpace ( )
default
 virtual NetworKit::HyperbolicSpace::~HyperbolicSpace ( )
virtualdefault

## Member Function Documentation

 void NetworKit::HyperbolicSpace::cartesianToPolar ( Point2D< double > a, double & phi, double & r )
static
Parameters
 a cartesian coordinates phi empty double value to receive angular coordinate r empty double value to receive radial coordinate
 static double NetworKit::HyperbolicSpace::effectiveAreaInCell ( double minPhi, double maxPhi, double minR, double maxR, double alpha )
inlinestatic
static

Project radial coordinates of the Poincare model into the hyperbolic plane.

Parameters
Returns
radial coordinate in the hyperbolic plane
 void NetworKit::HyperbolicSpace::fillPoints ( vector< double > & angles, vector< double > & radii, double R, double alpha )
static
Parameters
 angles empty vector to hold angular coordinates of generated points radii empty vector to hold radial coordinates of generated points R radius of the hyperbolic disk alpha dispersion parameter for the node positions

Fill preallocated vectors with randomly sampled points in native coordinates

 void NetworKit::HyperbolicSpace::fillPoints ( vector< double > & angles, vector< double > & radii, double minPhi, double maxPhi, double minR, double maxR, double alpha )
static
Parameters
 angles empty vector to hold angular coordinates of generated points radii empty vector to hold radial coordinates of generated points stretch multiplier for the radius of the hyperbolic disk alpha dispersion parameter for the node positions

Fill preallocated vectors with randomly sampled points in native coordinates

for the radial coordinate distribution, I took the probability density from Greedy Forwarding in Dynamic Scale-Free Networks Embedded in Hyperbolic Metric Spaces f (r) = sinh r/(cosh R âˆ’ 1) sinh = cosh+const

 void NetworKit::HyperbolicSpace::getEuclideanCircle ( Point2D< double > hyperbolicCenter, double hyperbolicRadius, Point2D< double > & euclideanCenter, double & euclideanRadius )
static

Converts a hyperbolic circle to a Euclidean circle.

Parameters
 hyperbolicCenter center of the hyperbolic circle, given in cartesian coordinates within the poincare disk hyperbolicRadius radius of the hyperbolic circle euclideanCenter point to receive the center of the Euclidean circle, given in cartesian coordinates euclidenRadius double to receive the radius of the Euclidean circle
static
 static double NetworKit::HyperbolicSpace::getExpectedDegree ( double n, double alpha, double R )
inlinestatic
 static double NetworKit::HyperbolicSpace::getTargetRadius ( double n, double m, double alpha = `1`, double T = `0`, double epsilon = `0.01` )
inlinestatic
 static double NetworKit::HyperbolicSpace::hyperbolicAreaToRadius ( double area )
inlinestatic
Parameters
 area The area of the hyperbolic circle return Radius of a hyperbolic circle with the given area
static

Project radial coordinates of the hyperbolic plane into the Poincare disk model.

Parameters
Returns
radial coordinate in the Poincare model
 double NetworKit::HyperbolicSpace::hyperbolicSpaceInEuclideanCircle ( double r_c, double d_c, double R )
static
Parameters
 r_c radial coordinate of the circle center d_c radius of the Euclidean circle R radius of the hyperbolic base disk

Now, the integral. It is 4{min}^{max} {acos}({r_c^2-d_c^2+r^2}{2r_c r}) {1}{1-r^2} ( ({acosh}( 1 + 2{r^2}{1 - r^2})))\,dr This solution was computed by WolframAlpha

 double NetworKit::HyperbolicSpace::maxRinSlice ( double minPhi, double maxPhi, double phi_c, double r_c, double euRadius )
static
 double NetworKit::HyperbolicSpace::nativeDistance ( double firstangle, double firstR, double secondangle, double secondR )
static
Parameters
 firstangle angular coordinate of the first point firstR radial coordiante of the first point secondangle angular coordinate of the second point secondR radial coordinate of the second point
Returns
distance between two points in native hyperbolic representation
 double NetworKit::HyperbolicSpace::poincareMetric ( double firstangle, double firstR, double secondangle, double secondR )
static

This distance measure is taken from the PoincarĂ© disc model.

Parameters
 firstangle angular coordinate of the first point firstR radial coordiante of the first point secondangle angular coordinate of the second point secondR radial coordinate of the second point
Returns
distance between two points in the poincare metric
 double NetworKit::HyperbolicSpace::poincareMetric ( Point2D< double > a, Point2D< double > b )
static
Parameters
 a first point in cartesian coordinates b second point in cartesian coordinates
Returns
distance between a and b in the poincare metric
 Point2D< double > NetworKit::HyperbolicSpace::polarToCartesian ( double phi, double r )
static
Parameters
 phi angular coordinate of point r radial coordinate of point
Returns
cartesian coordinates represented by phi and r
 std::map< index, Point< float > > NetworKit::HyperbolicSpace::polarToCartesian ( const vector< double > & angles, const vector< double > & radii )
static

Convenience function for visualizations which expect coordinates as map<index,Point<float> >