Skip to content

Chapter 13. Complement Graphs

The complement of a graph records the missing edges of the graph. It keeps the same vertices, removes the existing edges, and adds exactly those edges that were absent before.

Complementation is defined most naturally for simple graphs. If loops and multiple edges are allowed, extra conventions are needed. In this chapter, all graphs are finite simple undirected graphs unless stated otherwise.

13.1 Definition

Let

G=(V,E) G=(V,E)

be a simple graph. The complement of GG, written

G, \overline{G},

is the graph with the same vertex set as GG, where two distinct vertices are adjacent in G\overline{G} exactly when they are not adjacent in GG. This is the standard definition of graph complementation.

Thus

V(G)=V(G). V(\overline{G})=V(G).

For distinct vertices u,vV(G)u,v \in V(G),

{u,v}E(G) \{u,v\}\in E(\overline{G})

if and only if

{u,v}E(G). \{u,v\}\notin E(G).

Equivalently, the edge set of G\overline{G} is

E(G)={{u,v}:u,vV, uv, {u,v}E(G)}. E(\overline{G}) = \{\{u,v\}:u,v\in V,\ u\ne v,\ \{u,v\}\notin E(G)\}.

The complement exchanges adjacency and non-adjacency.

13.2 Complement Relative to a Complete Graph

For a simple graph on nn vertices, the complete graph KnK_n contains every possible edge.

The complement of GG is obtained from KnK_n by removing the edges of GG:

E(G)=E(Kn)E(G). E(\overline{G}) = E(K_n) \setminus E(G).

This formula is often the cleanest way to think about complements.

The graph GG and its complement together fill the complete graph:

E(G)E(G)=E(Kn), E(G) \cup E(\overline{G}) = E(K_n),

and

E(G)E(G)=. E(G) \cap E(\overline{G}) = \varnothing.

Thus GG and G\overline{G} split all possible edges between the same vertex set.

13.3 Number of Edges

A simple graph on nn vertices can have at most

(n2)=n(n1)2 \binom{n}{2}=\frac{n(n-1)}{2}

edges.

If GG has mm edges, then its complement has

(n2)m \binom{n}{2}-m

edges. This follows because every possible edge belongs to exactly one of GG or G\overline{G}.

For example, if GG has 66 vertices and 77 edges, then

E(G)=(62)7=157=8. |E(\overline{G})| = \binom{6}{2}-7 = 15-7 = 8.

Complementation turns sparse graphs into dense graphs and dense graphs into sparse graphs.

13.4 Degree in the Complement

Let GG be a simple graph of order nn. For any vertex vv,

degG(v)=n1degG(v). \deg_{\overline{G}}(v) = n-1-\deg_G(v).

There are n1n-1 possible neighbors of vv. Each one is either adjacent to vv in GG or adjacent to vv in G\overline{G}, but not both.

Thus the degree sequence of the complement can be computed directly from the degree sequence of GG.

If GG has degree sequence

(d1,d2,,dn), (d_1,d_2,\ldots,d_n),

then G\overline{G} has degrees

(n1d1, n1d2, , n1dn), (n-1-d_1,\ n-1-d_2,\ \ldots,\ n-1-d_n),

then sorted if one wants the usual nonincreasing degree sequence.

13.5 Examples

If GG is the empty graph on nn vertices, then no pair of distinct vertices is adjacent in GG. Therefore every pair is adjacent in G\overline{G}. Hence

G=Kn. \overline{G}=K_n.

If G=KnG=K_n, then every possible edge is already present. Therefore no edge remains for the complement, so

Kn \overline{K_n}

is the empty graph on nn vertices. These two examples are standard consequences of the definition.

For a path P4P_4 with vertices

1,2,3,4 1,2,3,4

and edges

{1,2},{2,3},{3,4}, \{1,2\},\{2,3\},\{3,4\},

the possible edges in K4K_4 are

{1,2},{1,3},{1,4},{2,3},{2,4},{3,4}. \{1,2\},\{1,3\},\{1,4\},\{2,3\},\{2,4\},\{3,4\}.

Removing the path edges leaves

E(P4)={{1,3},{1,4},{2,4}}. E(\overline{P_4}) = \{\{1,3\},\{1,4\},\{2,4\}\}.

Thus P4\overline{P_4} is also a path on four vertices, with vertex order

3,1,4,2. 3,1,4,2.

13.6 Complement of a Cycle

Let CnC_n be the cycle graph on nn vertices.

Each vertex in CnC_n has degree 22. Therefore each vertex in the complement has degree

n12=n3. n-1-2=n-3.

So

Cn \overline{C_n}

is (n3)(n-3)-regular.

For example, C5C_5 is a cycle on five vertices. Its complement is also a cycle on five vertices:

C5C5. \overline{C_5}\cong C_5.

This is one of the simplest examples of a self-complementary graph.

13.7 Complement and Isomorphism

Complementation respects graph isomorphism.

If

GH, G \cong H,

then

GH. \overline{G} \cong \overline{H}.

Proof

Let

f:V(G)V(H) f:V(G)\to V(H)

be an isomorphism. Then for distinct vertices u,vu,v,

{u,v}E(G) \{u,v\}\in E(G)

if and only if

{f(u),f(v)}E(H). \{f(u),f(v)\}\in E(H).

Taking negations gives

{u,v}E(G) \{u,v\}\notin E(G)

if and only if

{f(u),f(v)}E(H). \{f(u),f(v)\}\notin E(H).

Therefore

{u,v}E(G) \{u,v\}\in E(\overline{G})

if and only if

{f(u),f(v)}E(H). \{f(u),f(v)\}\in E(\overline{H}).

So the same bijection ff is an isomorphism from G\overline{G} to H\overline{H}.

13.8 Double Complement

The complement of the complement is the original graph:

G=G. \overline{\overline{G}}=G.

This follows directly from the definition. A pair of distinct vertices is adjacent in G\overline{\overline{G}} exactly when it is not adjacent in G\overline{G}, which means it is adjacent in GG.

Thus complementation is an involution: applying it twice returns to the starting graph.

13.9 Complement and Induced Subgraphs

Complementation commutes with taking induced subgraphs.

If

SV(G), S\subseteq V(G),

then

G[S]=G[S]. \overline{G[S]} = \overline{G}[S].

On the left, one first takes the subgraph induced by SS, then complements it. On the right, one first complements GG, then takes the induced subgraph on SS.

Both graphs have vertex set SS. Two distinct vertices in SS are adjacent in either graph exactly when they are not adjacent in GG. This relationship is a standard property of graph complements.

This property is useful in clique theory, independent sets, and hereditary graph classes.

13.10 Cliques and Independent Sets

A clique in GG is a set of vertices that are pairwise adjacent.

An independent set in GG is a set of vertices that are pairwise non-adjacent.

Complementation exchanges these two notions.

A set SV(G)S\subseteq V(G) is a clique in GG if and only if SS is an independent set in G\overline{G}.

Similarly, SS is an independent set in GG if and only if SS is a clique in G\overline{G}. This clique-independent-set duality is a basic application of graph complementation.

Thus questions about cliques can often be translated into questions about independent sets in the complement.

13.11 Chromatic Number and Clique Cover

The chromatic number of a graph GG, written

χ(G), \chi(G),

is the minimum number of colors needed to color the vertices so that adjacent vertices receive different colors.

A proper coloring of GG partitions V(G)V(G) into independent sets.

Since independent sets in GG are cliques in G\overline{G}, a coloring of GG corresponds to a partition of V(G)V(\overline{G}) into cliques.

Thus the chromatic number of GG can be interpreted as the minimum number of cliques needed to cover the vertices of G\overline{G}.

This is another example of complement duality: coloring problems become clique-cover problems.

13.12 Connectivity and Complements

Connectivity behaves differently under complementation.

A disconnected graph may have a connected complement. In fact, if GG is disconnected and has at least two components, then G\overline{G} is connected.

Proof

Let uu and vv be distinct vertices.

If uu and vv lie in different components of GG, then they are not adjacent in GG, so they are adjacent in G\overline{G}.

If uu and vv lie in the same component of GG, choose a vertex ww in a different component. Then uu is adjacent to ww in G\overline{G}, and ww is adjacent to vv in G\overline{G}. Therefore there is a path

u,w,v u,w,v

in G\overline{G}.

Hence any two vertices are connected in G\overline{G}.

The converse is false. A connected graph may also have a connected complement. For example, P4P_4 and P4\overline{P_4} are both connected.

13.13 Complement and Adjacency Matrices

Let GG be a simple graph of order nn, and let AA be its adjacency matrix.

Let JJ be the n×nn\times n all-ones matrix, and let II be the identity matrix.

The adjacency matrix of the complement is

A(G)=JIA(G). A(\overline{G}) = J-I-A(G).

The matrix JIJ-I is the adjacency matrix of KnK_n. It has 11 in every off-diagonal position and 00 on the diagonal. Subtracting A(G)A(G) removes precisely the edges already present in GG. This matrix formula is a standard expression of graph complementation.

This formula connects graph complementation with algebraic graph theory.

13.14 Self-Complementary Graphs

A graph is self-complementary if it is isomorphic to its complement:

GG. G \cong \overline{G}.

This does not usually mean that

G=G G=\overline{G}

with the same labels. It means the two graphs have the same structure after relabeling.

Examples include P4P_4 and C5C_5.

If GG is self-complementary with nn vertices and mm edges, then

m=(n2)m. m = \binom{n}{2}-m.

Therefore

2m=(n2) 2m=\binom{n}{2}

and

m=n(n1)4. m=\frac{n(n-1)}{4}.

Hence

n(n1) n(n-1)

must be divisible by 44. This implies

n0(mod4) n\equiv 0 \pmod 4

or

n1(mod4). n\equiv 1 \pmod 4.

So a self-complementary graph can have order only congruent to 00 or 11 modulo 44.

13.15 Complements of Special Graphs

Several complements are immediate from the definition.

Graph GGComplement G\overline{G}
Empty graph on nn verticesKnK_n
KnK_nEmpty graph on nn vertices
P4P_4Isomorphic to P4P_4
C5C_5Isomorphic to C5C_5
CnC_n(n3)(n-3)-regular graph
Complete bipartite graph Km,nK_{m,n}Disjoint union KmKnK_m \cup K_n

For the last row, Km,nK_{m,n} has all edges between the two parts and no edges inside either part. Its complement has no edges between the parts, but it has all edges inside each part. Therefore

Km,n=KmKn. \overline{K_{m,n}} = K_m \cup K_n.

13.16 Complement and Density

The density of a simple graph on nn vertices is often measured by

E(G)(n2). \frac{|E(G)|}{\binom{n}{2}}.

If GG has density pp, then G\overline{G} has density

1p. 1-p.

Thus complementing a graph exchanges dense and sparse structure.

This can be useful in proofs. If a graph has many missing edges, its complement has many edges. Sometimes it is easier to reason about the complement than about the original graph.

13.17 Algorithmic Considerations

Explicitly constructing a complement may be expensive.

If GG is sparse, then G\overline{G} may be dense. A graph with nn vertices and only O(n)O(n) edges may have a complement with

Θ(n2) \Theta(n^2)

edges.

Therefore algorithms sometimes work with complements implicitly rather than materializing every missing edge. This distinction matters for large graphs because the complement can require much more memory than the original graph. Algorithmic work on complement graphs often studies traversal and connectivity without explicitly constructing the dense complement.

13.18 Example

Let

V={a,b,c,d,e} V=\{a,b,c,d,e\}

and

E(G)={{a,b},{a,c},{b,c},{d,e}}. E(G)= \{\{a,b\},\{a,c\},\{b,c\},\{d,e\}\}.

The complete graph on this vertex set has

(52)=10 \binom{5}{2}=10

edges.

The possible edges are

{a,b},{a,c},{a,d},{a,e},{b,c},{b,d},{b,e},{c,d},{c,e},{d,e}. \{a,b\},\{a,c\},\{a,d\},\{a,e\}, \{b,c\},\{b,d\},\{b,e\}, \{c,d\},\{c,e\},\{d,e\}.

Removing the four edges of GG, we get

E(G)={{a,d},{a,e},{b,d},{b,e},{c,d},{c,e}}. E(\overline{G})= \{\{a,d\},\{a,e\},\{b,d\},\{b,e\},\{c,d\},\{c,e\}\}.

Thus G\overline{G} is the complete bipartite graph

K3,2 K_{3,2}

with parts

{a,b,c} \{a,b,c\}

and

{d,e}. \{d,e\}.

This example shows how a graph made from a triangle and an edge can have a highly connected complement across the two parts.

13.19 Summary

The complement of a simple graph keeps the same vertex set and replaces edges by non-edges. If GG has nn vertices and mm edges, then

E=(n2)m. |\overline{E}|=\binom{n}{2}-m.

For each vertex,

degG(v)=n1degG(v). \deg_{\overline{G}}(v)=n-1-\deg_G(v).

Complementation is an involution:

G=G. \overline{\overline{G}}=G.

It exchanges cliques and independent sets, turns complete graphs into empty graphs, and often changes sparse graphs into dense graphs. Complement graphs are useful because they let one restate adjacency problems as non-adjacency problems and translate several graph properties into dual forms.