Graph theory basics and the handshake lemma
5 min read
Short answer
A graph is a set of vertices joined by edges. The degree of a vertex is the number of edges at it. Handshake lemma: , since every edge adds to the degrees of two vertices. So the number of odd-degree vertices is always even.
Trees
A tree is a connected graph with no cycles. A connected graph on vertices is a tree exactly when it has edges. Trees model hierarchies, family lines and file systems.
Eulerian paths
A connected graph has a path using every edge once exactly when at most two vertices have odd degree. This is Euler's answer to the Königsberg bridges problem.
Worked example
Can a graph have vertices with degrees ? If so, how many edges?
The degree sum is , which is even, so it is possible. Then edges. Degrees such as sum to , which is odd, so they cannot occur.
Try it yourself
How many edges does the complete graph have?
Show the answer
Each pair of the vertices is joined once: edges (also ).
Keep going with practice
Vidi's linear algebra lessons connect graphs to matrices through adjacency matrices.