GraphComplement

GraphComplement[g]

gives the graph complement of the graph g.

GraphComplement[{vw,}]

uses rules vw to specify the graph g.

Details 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.

Examples

open allclose all

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]=

Scope  (6)

Properties & Relations  (7)

See Also

GraphDifference  GraphUnion  GraphIntersection  GraphDisjointUnion  BooleanGraph

Introduced in 2010
(8.0)
| Updated in 2015
(10.3)