This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.
relaxed_caveman_graph(l, k, p, seed=None)¶
Return a relaxed caveman graph.
A relaxed caveman graph starts with
lcliques of size
k. Edges are then randomly rewired with probability
pto link different cliques.
G – Relaxed Caveman Graph
NetworkXError– If p is not in [0,1]
>>> G = nx.relaxed_caveman_graph(2, 3, 0.1, seed=42)
 Santo Fortunato, Community Detection in Graphs, Physics Reports Volume 486, Issues 3-5, February 2010, Pages 75-174. http://arxiv.org/abs/0906.0612