CompleteGraph

CompleteGraph[n]
gives the complete graph with n vertices .

CompleteGraph[{n1,n2,,nk}]
gives the complete k-partite graph with n1+n2++nk vertices .

Details and OptionsDetails and Options

  • CompleteGraph generates a Graph object.
  • CompleteGraph[n] gives a graph with n vertices and an edge between every pair of vertices.
  • CompleteGraph[{n1,n2,,nk}] gives a graph with n1++nk vertices partitioned into disjoint sets Vi with ni vertices each and edges between all vertices in different sets Vi and Vj, but no edges between vertices in the same set Vi.
  • CompleteGraph[,DirectedEdges->True] gives a directed complete graph.
  • CompleteGraph takes the same options as Graph.

ExamplesExamplesopen allclose all

Basic Examples  (4)Basic Examples  (4)

The first few complete graphs :

In[1]:=
Click for copyable input
Out[1]=

Bipartite graphs :

In[1]:=
Click for copyable input
Out[1]=

Directed complete graphs use two directional edges for each undirected edge:

In[1]:=
Click for copyable input
Out[1]=

Directed complete -partite graphs use directed edges from one group to another:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2010
(8.0)