Graph theory studies networks made of points joined by lines. Each point is a vertex (plural: vertices) and each line joining two vertices is an edge.
Degree of a vertex
The degree of a vertex is the number of edges meeting at it. A loop (an edge from a vertex back to itself) counts as $2$. The sum of the degrees of all vertices equals twice the number of edges.
Key formula
Sum of degrees $=2\times(\text{number of edges})$. This is why the total degree of any graph is always even.
Weighted and directed graphs
In a weighted graph, each edge carries a number (a weight) such as distance, time or cost. In a directed graph each edge has an arrow showing direction; in an undirected graph the edges have no direction.
Worked example
A graph has $4$ vertices and $5$ edges. The sum of all degrees is $2\times5=10$. If three vertices have degrees $2,3,2$, the fourth vertex has degree $10-(2+3+2)=3$.
Remember
- Vertices are points; edges are the connecting lines.
- A loop adds $2$ to a degree.
- Weights label edges; arrows make a graph directed.