graphscope.nx.generators.community.relaxed_caveman_graph

graphscope.nx.generators.community.relaxed_caveman_graph(l, k, p, seed=None)[source]

Returns a relaxed caveman graph.

A relaxed caveman graph starts with l cliques of size k. Edges are then randomly rewired with probability p to link different cliques.

Parameters:
  • l (int) – Number of groups

  • k (int) – Size of cliques

  • p (float) – Probabilty of rewiring each edge.

  • seed (integer, random_state, or None (default)) – Indicator of random number generation state. See Randomness.

Returns:

G – Relaxed Caveman Graph

Return type:

NetworkX Graph

Raises:

NetworkXError – If p is not in [0,1]

Examples

>>> G = nx.relaxed_caveman_graph(2, 3, 0.1, seed=42)

References