WOLFRAM

gives the graph complement of the graph g.

GraphComplement[{vw,}]

uses rules vw to specify the graph g.

Details and Options

  • GraphComplement is also known as edge-complementary graph.
  • 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)Summary of the most common use cases

Graph complement of cycle graphs:

Out[1]=1
Out[2]=2

Graph complement of directed graphs:

Out[1]=1
Out[2]=2

Scope  (6)Survey of the scope of standard use cases

GraphComplement works with undirected graphs:

Out[1]=1

Directed graphs:

Out[1]=1

Multiple graphs:

Out[1]=1

Mixed graphs:

Out[1]=1

Use rules to specify the graph:

Out[1]=1

GraphComplement works with large graphs:

Out[2]=2

Properties & Relations  (7)Properties of the function, and connections to other functions

The complement of a CompleteGraph is an edgeless graph:

Out[1]=1

The complement of the complement is the original graph (for simple graphs):

Out[1]=1

The complement of the graph can be obtained from its adjacency matrix:

Out[3]=3
Out[4]=4

An independent vertex set of the graph is a clique of its complement graph:

Out[1]=1
Out[2]=2
Out[3]=3

The complement of the line graph of is a Petersen graph:

Out[1]=1
Out[2]=2

The graph union of any simple graph and its complement is a complete graph:

Out[2]=2

The graph intersection of any graph and its complement is an empty graph:

Out[2]=2
Wolfram Research (2010), GraphComplement, Wolfram Language function, https://reference.wolfram.com/language/ref/GraphComplement.html (updated 2015).
Wolfram Research (2010), GraphComplement, Wolfram Language function, https://reference.wolfram.com/language/ref/GraphComplement.html (updated 2015).

Text

Wolfram Research (2010), GraphComplement, Wolfram Language function, https://reference.wolfram.com/language/ref/GraphComplement.html (updated 2015).

Wolfram Research (2010), GraphComplement, Wolfram Language function, https://reference.wolfram.com/language/ref/GraphComplement.html (updated 2015).

CMS

Wolfram Language. 2010. "GraphComplement." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/GraphComplement.html.

Wolfram Language. 2010. "GraphComplement." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/GraphComplement.html.

APA

Wolfram Language. (2010). GraphComplement. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GraphComplement.html

Wolfram Language. (2010). GraphComplement. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GraphComplement.html

BibTeX

@misc{reference.wolfram_2025_graphcomplement, author="Wolfram Research", title="{GraphComplement}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/GraphComplement.html}", note=[Accessed: 17-May-2025 ]}

@misc{reference.wolfram_2025_graphcomplement, author="Wolfram Research", title="{GraphComplement}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/GraphComplement.html}", note=[Accessed: 17-May-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_graphcomplement, organization={Wolfram Research}, title={GraphComplement}, year={2015}, url={https://reference.wolfram.com/language/ref/GraphComplement.html}, note=[Accessed: 17-May-2025 ]}

@online{reference.wolfram_2025_graphcomplement, organization={Wolfram Research}, title={GraphComplement}, year={2015}, url={https://reference.wolfram.com/language/ref/GraphComplement.html}, note=[Accessed: 17-May-2025 ]}