networkx 2.8.2 Pypi GitHub Homepage
Other Docs
ParametersBackRef
complete_graph(n, create_using=None)

A complete graph on n nodes means that all pairs of distinct nodes have an edge connecting them.

Parameters

n : int or iterable container of nodes

If n is an integer, nodes are from range(n). If n is a container of nodes, those nodes appear in the graph.

create_using : NetworkX graph constructor, optional (default=nx.Graph)

Graph type to create. If graph instance, then cleared before populated.

Return the complete graph :None:None:`K_n` with n nodes.

Examples

>>> G = nx.complete_graph(9)
... len(G) 9
>>> G.size()
36
>>> G = nx.complete_graph(range(11, 14))
... list(G.nodes()) [11, 12, 13]
>>> G = nx.complete_graph(4, nx.DiGraph())
... G.is_directed() True
See :

Back References

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

networkx.algorithms.community.kclique.k_clique_communities networkx.drawing.nx_pydot.graphviz_layout networkx.algorithms.connectivity.edge_augmentation.complement_edges networkx.classes.graph.Graph.update networkx.algorithms.cluster.transitivity networkx.algorithms.euler.is_eulerian networkx.drawing.nx_pydot.pydot_layout networkx.drawing.nx_agraph.from_agraph networkx.algorithms.cluster.clustering networkx.algorithms.link_prediction.preferential_attachment networkx.drawing.nx_agraph.to_agraph networkx.drawing.nx_pydot.from_pydot networkx.algorithms.link_prediction.common_neighbor_centrality networkx.algorithms.cluster.generalized_degree networkx.classes.function.common_neighbors networkx.algorithms.link_prediction.adamic_adar_index networkx.drawing.nx_pydot.to_pydot networkx.algorithms.cluster.square_clustering networkx.algorithms.planarity.is_planar networkx.algorithms.cluster.triangles networkx.algorithms.link_prediction.resource_allocation_index networkx.algorithms.link_prediction.jaccard_coefficient networkx.algorithms.cluster.average_clustering networkx.generators.classic.complete_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/classic.py#225
type: <class 'function'>
Commit: