Class PowerlawDegreeSequence

Inheritance Relationships

Base Type

Class Documentation

class PowerlawDegreeSequence : public NetworKit::Algorithm

Public Functions

PowerlawDegreeSequence(count minDeg, count maxDeg, double gamma)

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

Parameters:
  • minDeg – The minium degree

  • maxDeg – The maximum degree

  • gamma – The powerlaw exponent

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:

degreeSequence – The degree sequence to fit.

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:

g – The input graph to fit

void setMinimumFromAverageDegree(double avgDeg)

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

Throws:

std::runtime_error – If it is not possible to find a minimum degree such that the expected average is avgDeg.

Parameters:

avgDeg – The average degree

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.

Parameters:
  • avgDeg – The average degree

  • minGamma – The minimum gamma to use, default: -1

  • maxGamma – The maximum gamma to use, default: -6

void setMinimumDegree(count minDeg)

Sets the minimum degree.

Parameters:

minDeg – The degree that shall be set as minimum degree

count getMinimumDegree() const

Gets the minimum degree.

Returns:

The minimum degree.

inline count getMaximumDegree() const

Gets the maximum degree.

Returns:

The maximum degree.

void setGamma(double gamma)

Sets the exponent gamma.

Parameters:

gamma – The exponent, must be negative.

inline double getGamma() const

Gets the exponent gamma.

Returns:

gamma

virtual void run() override

Execute the generation process

double getExpectedAverageDegree() const

Returns the expected average degree.

Returns:

The expected average degree.

std::vector<count> getDegreeSequence(count numNodes) const

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

Parameters:

numNodes – The number of nodes

Returns:

The generated degree sequence.

count getDegree() const

Returns a degree drawn at random with a power law distribution

Returns:

A degree that follows the generated distribution.