All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
NetworKit::PowerlawDegreeSequence Class Reference

#include <PowerlawDegreeSequence.h>

Public Member Functions

 PowerlawDegreeSequence (count minDeg, count maxDeg, double gamma)
 Generates a powerlaw degree sequence with the given minimum and maximum degree, the powerlaw exponent gamma. More...
 
 PowerlawDegreeSequence (const std::vector< double > &degreeSequence)
 Generates a powerlaw degree sequence that fits the given degree sequence in terms of minimum, maximum and average degree. More...
 
 PowerlawDegreeSequence (const Graph &g)
 Generates a powerlaw degree sequence that fits the degree sequence of the given graph in terms of minimum, maximum and average degree. More...
 
void setMinimumFromAverageDegree (double avgDeg)
 Tries to set the minimum degree such that the specified average degree is expected. More...
 
void setGammaFromAverageDegree (double avgDeg, double minGamma=-1, double maxGamma=-6)
 Tries to set the powerlaw exponent gamma such that the specified average degree is expected. More...
 
void setMinimumDegree (count minDeg)
 Sets the minimum degree. More...
 
count getMinimumDegree () const
 Gets the minimum degree. More...
 
count getMaximumDegree () const
 Gets the maximum degree. More...
 
void setGamma (double gamma)
 Sets the exponent gamma. More...
 
double getGamma () const
 Gets the exponent gamma. More...
 
void run ()
 Execute the generation process. More...
 
double getExpectedAverageDegree () const
 Returns the expected average degree. More...
 
std::vector< countgetDegreeSequence (count numNodes) const
 Returns a degree sequence of numNodes degrees with even degree sum. More...
 
count getDegree () const
 Returns a degree drawn at random with a power law distribution. More...
 

Constructor & Destructor Documentation

NetworKit::PowerlawDegreeSequence::PowerlawDegreeSequence ( NetworKit::count  minDeg,
NetworKit::count  maxDeg,
double  gamma 
)

Generates a powerlaw degree sequence with the given minimum and maximum degree, the powerlaw exponent gamma.

Parameters
minDegThe minium degree
maxDegThe maximum degree
gammaThe powerlaw exponent
NetworKit::PowerlawDegreeSequence::PowerlawDegreeSequence ( const std::vector< double > &  degreeSequence)

Generates a powerlaw degree sequence that fits the given degree sequence in terms of minimum, maximum and average degree.

Parameters
degreeSequenceThe degree sequence to fit.
NetworKit::PowerlawDegreeSequence::PowerlawDegreeSequence ( const Graph g)

Generates a powerlaw degree sequence that fits the degree sequence of the given graph in terms of minimum, maximum and average degree.

Parameters
gThe input graph to fit

Member Function Documentation

NetworKit::count NetworKit::PowerlawDegreeSequence::getDegree ( ) const

Returns a degree drawn at random with a power law distribution.

Returns
A degree that follows the generated distribution.
std::vector< NetworKit::count > NetworKit::PowerlawDegreeSequence::getDegreeSequence ( NetworKit::count  numNodes) const

Returns a degree sequence of numNodes degrees with even degree sum.

Parameters
numNodesThe number of nodes
Returns
The generated degree sequence.
double NetworKit::PowerlawDegreeSequence::getExpectedAverageDegree ( ) const

Returns the expected average degree.

Returns
The expected average degree.
double NetworKit::PowerlawDegreeSequence::getGamma ( ) const
inline

Gets the exponent gamma.

Returns
gamma
count NetworKit::PowerlawDegreeSequence::getMaximumDegree ( ) const
inline

Gets the maximum degree.

Returns
The maximum degree.
NetworKit::count NetworKit::PowerlawDegreeSequence::getMinimumDegree ( ) const

Gets the minimum degree.

Returns
The minimum degree.
void NetworKit::PowerlawDegreeSequence::run ( )

Execute the generation process.

void NetworKit::PowerlawDegreeSequence::setGamma ( double  gamma)

Sets the exponent gamma.

Parameters
gammaThe exponent, must be negative.
void NetworKit::PowerlawDegreeSequence::setGammaFromAverageDegree ( double  avgDeg,
double  minGamma = -1,
double  maxGamma = -6 
)

Tries to set the powerlaw exponent gamma such that the specified average degree is expected.

Parameters
avgDegThe average degree
minGammaThe minimum gamma to use, default: -1
maxGammaThe maximum gamma to use, default: -6
void NetworKit::PowerlawDegreeSequence::setMinimumDegree ( NetworKit::count  minDeg)

Sets the minimum degree.

Parameters
minDegThe degree that shall be set as minimum degree
void NetworKit::PowerlawDegreeSequence::setMinimumFromAverageDegree ( double  avgDeg)

Tries to set the minimum degree such that the specified average degree is expected.

Exceptions
std::runtime_errorIf it is not possible to find a minimum degree such that the expected average is avgDeg.
Parameters
avgDegThe average degree

The documentation for this class was generated from the following files: