Class ClusteredRandomGraphGenerator

Inheritance Relationships

Base Type

Class Documentation

class ClusteredRandomGraphGenerator : public NetworKit::StaticGraphGenerator

The ClusteredRandomGraphGenerator class is used to create a clustered random graph. The number of nodes and the number of edges are adjustable as well as the probabilities for intra-cluster and inter-cluster edges. In parallel the generated graph is not deterministic. To ensure determinism, use a single thread.

Public Functions

ClusteredRandomGraphGenerator(count n, count k, double pIntra, double pInter)

Creates a clustered random graph:

Parameters:
  • n[in] number of nodes

  • k[in] number of clusters

  • pIntra[in] intra-cluster edge probability

  • pInter[in] inter-cluster edge probability

virtual Graph generate() override

Generates a clustered random graph with the properties given in the constructor.

Returns:

The generated graph.

Partition getCommunities()

Returns the generated ground truth communities.

Returns:

The generated partition