Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Mathematics and Algorithms > Graphs & Networks > Graph Operations and Modifications > GraphComplement >
Mathematica > Visualization and Graphics > Graphs & Networks > Graph Operations and Modifications > GraphComplement >
Mathematica > Mathematics and Algorithms > Graphs & Networks > Constructing Graphs > Graph Operations and Modifications > GraphComplement >

GraphComplement

GraphComplement[g]
gives the graph complement of the graph g.
  • The graph complement has the same vertices and edges defined by two vertices being adjacent only if they are not adjacent in g.
Graph complement of cycle graphs:
Graph complement of directed graphs:
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]=
GraphComplement works with undirected graphs:
Directed graphs:
Works with large graphs:
The complement of a CompleteGraph is an edgeless graph:
The complement of the complement is the original graph (for simple graphs):
The complement of the graph can be obtained from its adjacency matrix:
An independent vertex set of the graph is a clique of its complement graph:
The complement of the line graph of is a Petersen graph:
The graph union of any simple graph and its complement is a complete graph:
The graph intersection of any graph and its complement is an empty graph:
New in 8
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF