This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

CompleteGraphQ

CompleteGraphQ[g]
yields True if the graph g is a complete graph, and False otherwise.
CompleteGraphQ
yields True if the subgraph induced by vlist is a complete graph, and False otherwise.
  • A graph is complete if there is an edge between every pair of distinct vertices.
Test whether a graph is complete:
Petersen graph is not a complete graph:
Test whether a graph is complete:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=
In[4]:=
Click for copyable input
Out[4]=
In[5]:=
Click for copyable input
Out[5]=
In[6]:=
Click for copyable input
Out[6]=
 
Petersen graph is not a complete graph:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
Test undirected or directed graphs:
Test subgraphs:
CompleteGraphQ gives False for anything that is not a complete graph:
Test large graphs:
A complete graph has no self-loops:
A TreeGraph is not a complete graph:
The only complete path graphs are triangles (undirected):
And the directed path:
A complete graph on vertices has edges:
The complete graph is a cycle graph :
The complete graph is a wheel graph :
The complete graph is the line graph of the star graph :
A complete graph is an -regular graph:
The GraphComplement of a complete graph is an empty graph:
For a complete graph, all entries outside the diagonal are 1s in the AdjacencyMatrix:
Complete graphs are their own cliques:
New in 8