# Prove that every vertex has degree of 2

I have to prove that in a graph $G$ with $n$ vertices and $n$ edges which has no isolated or pendant vertices, every vertex has degree 2.

Now I know that $$\sum_{v\in V} d(v)=2|E|=2n$$

but I suppose I also have to prove every vertex has same degree and I'm not sure how to do that.

• What is a "pendant" vertex? – JMoravitz Sep 14 '17 at 19:45
• @JMoravitz Presumably of degree 1. – Théophile Sep 14 '17 at 19:45

Hint: From the equation you gave, we can divide both sides by $n$ to get the average degree:
$$\frac1n \sum_{v\in V} d(v)=2$$