Skip to content

Commit

Permalink
Improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
k-karakatsanis committed Nov 3, 2015
1 parent 424fbea commit 2e221ff
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions networkx/generators/community.py
Expand Up @@ -415,6 +415,9 @@ def gaussian_random_partition_graph(n, s, v, p_in, p_out, directed=False,
def ring_of_cliques(num_cliques, clique_size):
"""Defines a "ring of cliques" graph.
A ring of cliques graph is consisting of cliques, connected through single
links. Each clique is a complete graph.
Parameters
----------
num_cliques : int
Expand Down Expand Up @@ -448,8 +451,6 @@ def ring_of_cliques(num_cliques, clique_size):
edges = itertools.combinations(range(i*clique_size, i*clique_size +
clique_size), 2)
G.add_edges_from(edges)
# connects the middle node of each clique
# with the first node of the next clique
G.add_edge(i*clique_size+1, (i+1)*clique_size %
(num_cliques*clique_size))
return G

0 comments on commit 2e221ff

Please sign in to comment.