cdlib.benchmark.GRP¶
-
GRP
(n: int, s: float, v: float, p_in: float, p_out: float, directed: bool = False, seed: object = 42) → [<class 'object'>, <class 'object'>]¶ Generate a Gaussian random partition graph.
A Gaussian random partition graph is created by creating k partitions each with a size drawn from a normal distribution with mean s and variance s/v. Nodes are connected within clusters with probability p_in and between clusters with probability p_out.
Parameters: - n – Number of nodes in the graph
- s – Mean cluster size
- v – Shape parameter. The variance of cluster size distribution is s/v.
- p_in – Probabilty of intra cluster connection.
- p_out – Probability of inter cluster connection.
- directed – hether to create a directed graph or not. Boolean, default False
- seed – Indicator of random number generation state.
Returns: A networkx synthetic graph, the set of communities (NodeClustering object)
Example: >>> from cdlib.benchmark import GRP >>> G, coms = GRP(100, 10, 10, 0.25, 0.1)
References: Ulrik Brandes, Marco Gaertler, Dorothea Wagner, Experiments on Graph Clustering Algorithms, In the proceedings of the 11th Europ. Symp. Algorithms, 2003.