1

I am given this problem: Suppose you have a complete graph with $n$ edges. How many vertices does your graph have?

I have this math figured out so far: We know that a complete graph has $m$ vertices, with $m-1$ edges connected to each. This makes the sum of the total number of degrees $m(m-1)$. Then, since this sum is twice the number of edges, the number of edges is $\frac{m(m-1)}{2}$.

But I don't think that is the answer. I think I am missing a piece of the math, but I can't figure out what else I need to do. Can anyone help me with what I'm missing or doing wrong?

Mankind
  • 13,500
JCMcRae
  • 853

1 Answers1

3

Since your complete graph has $n$ edges, then $n = m(m-1)/2$, where $m$ is the number of vertices. You want to express $m$ in terms of $n$, and you can rewrite the above equation as the quadratic equation $$m^2/2-m/2 - n = 0,$$ which you can then solve for $m$. The solution will depend on $n$.

The equation is equivalent to $m^2-m-2n=0$, whose discriminant is $d=1+8n$, and thus $$m = \frac{1\pm\sqrt{1+8n}}{2}.$$ You of course throw away the negative solution.

Mankind
  • 13,500