Degrees add up to twice the edges
transcript
How popular is a person in a graph? Count the edges that touch them. That count is the degree. It is the first number to know about any vertex. Let us count some, and then add them up.
Look at vertex three. Three edges touch it. Vertex zero has two. Vertex five has none.
Degrees: two, two, two, three, one, zero. They add up to ten. There are five edges. Ten is twice five.
Each edge touches two vertices. It adds one to each degree. So the sum is two times the edges.
Follows go one way. Two arrows leave zero. One arrow arrives at zero. Out and in are counted apart.
Vertex one has two arrows arriving. None of its arrows leave. A big in-degree means a popular vertex. Spot it by counting arrivals. The town judge problem uses exactly this idea.
A directed graph has two degrees. Out counts the arrows leaving. In counts the arrows arriving. Full breakdown in the lecture.