In graph theory, the complement or inverse of a graph G is a graph H on the same vertices such that two distinct vertices of H are adjacent if and only if they are not adjacent in G. That is, to generate the complement of a graph, one fills in all the missing edges required to form a complete graph, and removes all the edges that were previously there. It is not, however, the set complement of the graph; only the edges are complemented
What it means is that the complement of the graph will:
- have the same set of vertices.
- the edges which were not in the original graph will be in the complement graph
- and edges which were there in the original graph will not be there in the complement graph.
To get complement of a graph, add those edges that will make the graph complete, and remove the original edges.
In case of a complete graph, it's complement will be a null graph(i.e. same no. of vertices but no edges).
Another way to interpret is in matrix form.
For a graph, draw it's adjacency matrix, (i.e. M[i][j] = 1 if i and j are adjacent, otherwise M[i][j] = 0). To get the complement, change all 0's to 1's and 1's to 0's.
In case of a complete graph, all the entries will be 1. Hence, in complement graph's matrix all the entries will be 0, representing null graph.
Hope it helps :)