# GraphComplement

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:

Graph complement of directed graphs:

## Scope(6)

GraphComplement works with undirected graphs:

Directed graphs:

Multiple graphs:

Mixed graphs:

Use rules to specify the graph:

GraphComplement works with large graphs:

## Properties & Relations(7)

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:
{"ft_lang_label":"__label__en","ft_lang_prob":0.8145616,"math_prob":0.968855,"size":1560,"snap":"2023-14-2023-23","text_gpt3_token_len":343,"char_repetition_ratio":0.2377892,"word_repetition_ratio":0.03902439,"special_character_ratio":0.20128205,"punctuation_ratio":0.16605166,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.992489,"pos_list":[0,1,2,3,4],"im_url_duplicate_count":[null,5,null,4,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-03-27T14:46:19Z\",\"WARC-Record-ID\":\"<urn:uuid:3652e899-2bf6-41ad-af59-bfd96e50337e>\",\"Content-Length\":\"91973\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:241f681e-313e-4b37-9efe-4fe9220e381a>\",\"WARC-Concurrent-To\":\"<urn:uuid:4ce73bfd-6fa9-4bf4-82f9-3b333c010d2e>\",\"WARC-IP-Address\":\"140.177.205.163\",\"WARC-Target-URI\":\"https://reference.wolfram.com/language/ref/GraphComplement.html\",\"WARC-Payload-Digest\":\"sha1:63TQWCFLBFGIMNKPRRM4OO2YBL5T6AEE\",\"WARC-Block-Digest\":\"sha1:F65VANNFNUNXBFI5QWD56L3TS6M7TXDN\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-14/CC-MAIN-2023-14_segments_1679296948632.20_warc_CC-MAIN-20230327123514-20230327153514-00309.warc.gz\"}"}