networkx 2.8.2 Pypi GitHub Homepage
Other Docs
NotesParametersRaisesReturnsBackRef
windmill_graph(n, k)

Notes

The node labeled :None:None:`0` will be the node connected to all other nodes. Note that windmill graphs are usually denoted :None:None:`Wd(k,n)`, so the parameters are in the opposite order as the parameters of this method.

Parameters

n : int

Number of cliques

k : int

Size of cliques

Raises

NetworkXError

If the number of cliques is less than two If the size of the cliques are less than two

Returns

G : NetworkX Graph

windmill graph with n cliques of size k

Generate a windmill graph. A windmill graph is a graph of n cliques each of size k that are all joined at one node. It can be thought of as taking a disjoint union of n cliques of size k, selecting one point from each, and contracting all of the selected points. Alternatively, one could generate n cliques of size :None:None:`k-1` and one node that is connected to all other nodes in the graph.

Examples

>>> G = nx.windmill_graph(4, 5)
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

networkx.generators.community.windmill_graph

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /networkx/generators/community.py#436
type: <class 'function'>
Commit: