Complement of a Graph — Definition, Formula & Example
The complement of a graph is the graph you get by keeping every vertex, erasing the existing edges, and drawing an edge between every pair of vertices that was not connected before. Two vertices are adjacent in the complement exactly when they are not adjacent in the original graph.
Let be a simple graph with vertices. Its complement (also written ) is the simple graph with vertex set and edge set . Equivalently, and are disjoint, and their union is the edge set of the complete graph on .
Key Formula
Where:
- = Number of vertices, which is the same in and
- = Number of edges in the original graph
- = Number of edges in the complement
- = Number of edges in the complete graph , which is every possible pair of distinct vertices
Worked Example
Problem: Let be the 5-cycle with vertices and edges , where means the edge . Find and describe its shape.
Step 1: Count every possible edge on 5 vertices. This is the edge count of .
Step 2: List all 10 pairs and remove the 5 edges of . The pairs that remain are the edges of the complement.
Step 3: Check the degrees. Every vertex has degree 2 in , so each has degree in . Following the edges gives one closed loop through all five vertices.
Answer: has edges . It forms the cycle , so it is another 5-cycle. A graph that is isomorphic to its own complement, like , is called self-complementary.
Why It Matters
In a discrete math course, complements let you turn one problem into another. A set of vertices is a clique in exactly when it is an independent set in , so a method for finding one also finds the other. Ramsey theory's classic result says that for any graph on 6 vertices, either the graph or its complement contains a triangle.
Common Mistakes
Mistake: Adding a loop at each vertex because no vertex is joined to itself in .
Correction: The complement uses only pairs of distinct vertices (). It is defined for simple graphs, and the complement of a simple graph is also simple, with no loops and no repeated edges.
