GraphComplement

GraphComplement[g]
gives the graph complement of the graph g.

GraphComplement[{vw,}]
uses rules vw to specify the graph g.

Details and OptionsDetails and Options

  • The graph complement has the same vertices and edges defined by two vertices being adjacent only if they are not adjacent in g.
  • GraphComplement works with undirected graphs, directed graphs, multigraphs, and mixed graphs.

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

Graph complement of cycle graphs:

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

Graph complement of directed graphs:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
Introduced in 2010
(8.0)
| Updated in 2015
(10.3)
Translate this page: