Graph Theory Complements Let G be a simple graph with n vertices. What is the relation between the number of edges of G and the number of edges of the complement G'? 
In the example below, I noticed that by adding the vertices and edges of G and the edges of G' you get a total of 10. Then the number of edges in G' would be 3. It is the same for every graph with four vertices. Is there a formula for calculating the number of edges of G' based on the number of vertices and edges in G?

 A: Assuming that you’re talking about simple graphs (i.e., graphs without loops or multiple edges), there is a nice, straightforward relationship. If there are $n$ vertices, there are $\binom{n}2=\frac12n(n-1)$ pairs of distinct vertices, so there are $\binom{n}2$ possible edges. If $G$ has $m$ edges, then $G'$ must have every one of the possible edges that $G$ doesn’t have, so $G'$ has $\binom{n}2-m$ edges.
If there are $4$ vertices, for example, there are $\binom42=6$ possible edges, so if $G$ has $m$ edges, then $G'$ has $6-m$ edges.
A: The union of the two graphs would be the complete graph. So for an $n$ vertex graph, if $e$ is the number of edges in your graph and $e'$ the number of edges in the complement, then we have
$$e + e' = \binom{n}{2}$$
If you include the vertex number in your count, then you have
$$e + e' + n = \binom{n}{2} + n = \frac{n(n+1)}{2} = T_n$$
where $T_n$ is the $n$th triangular number. What you've noticed is that $T_4 = 10$, and this number will hold for all $4$ vertex graphs and their complements.
