networkx.generators.community.windmill_graph¶
-
windmill_graph
(n, k)[source]¶ Generate a windmill graph. A windmill graph is a graph of
n
cliques each of sizek
that are all joined at one node. It can be thought of as taking a disjoint union ofn
cliques of sizek
, selecting one point from each, and contracting all of the selected points. Alternatively, one could generaten
cliques of sizek-1
and one node that is connected to all other nodes in the graph.Parameters: - n (int) – Number of cliques
- k (int) – Size of cliques
Returns: G – windmill graph with n cliques of size k
Return type: NetworkX Graph
Raises: NetworkXError
– If the number of cliques is less than two If the size of the cliques are less than twoExamples
>>> G = nx.windmill_graph(4, 5)
Notes
The node labeled
0
will be the node connected to all other nodes. Note that windmill graphs are usually denotedWd(k,n)
, so the parameters are in the opposite order as the parameters of this method.