Graph Theory Basics (AI HL)

Before you can run an algorithm on a graph, you need to be fluent in its vocabulary - vertices, edges, degree, and what it means for two graphs to secretly be "the same" graph in disguise. This page covers the handshaking lemma and degree sequences, with worked examples and the mistakes that lose marks. It's part of the broader Graph Theory topic.

11 questions on this sub-topic.

Practise graph theory basics → Try exam-style questions

Degree, and what it tells you

Covered under IB syllabus reference AHL3.14: vertices, edges, adjacent vertices and edges, and the degree of a vertex.

Handshaking lemma

\(\displaystyle\sum \deg(v) = 2E\)

Not in the formula booklet - it follows because every edge adds exactly 1 to the degree of each of its two endpoints. It also proves that any graph has an even number of odd-degree vertices.

Degree sequences

A proposed degree sequence can only belong to a real graph if it sums to an even number. Two isomorphic graphs must share the same degree sequence - but a matching sequence alone doesn't guarantee two graphs are isomorphic.

Use the sum test first to rule out impossible sequences, then compare sequences to rule out isomorphism.

Want the full syllabus wording and how graphs represent real networks and maps? See Graph Theory.

Worked examples

1
Easy
GDC
[3 marks]

A graph has 6 vertices with degrees \(3, 3, 4, 2, 2, 2.\)

(a) State the handshaking lemma.

(b) Find the number of edges.

Worked solution

(a) The sum of all vertex degrees equals twice the number of edges: \(\sum\deg(v) = 2E.\) A1

(b) Sum \(= 16 = 2E \Rightarrow E\) M1
\(= 8.\) A1

A GDC is permitted on this paper, so you may evaluate or verify this result directly on the calculator.

A1 \(\sum\deg=2E\) M1 Sum degrees A1 \(E=8\)
2
Hard
GDC
[5 marks]

Can a simple graph have degree sequence \(5, 5, 5, 5, 5\)? Explain.

Worked solution

Degree sum \(= 25\), which is odd. M1 A1
By handshaking the sum must equal \(2E\) (even). M1 A1
An odd sum is impossible, so no such graph exists. A1

A GDC is permitted on this paper, so you may evaluate or verify this result directly on the calculator.

M1 Sum degrees A1 \(25\) odd M1 \(\sum\deg=2E\) A1 Must be even A1 Impossible

Common mistakes

Ready to practise properly?

20 graph theory basics questions, marked instantly like the real exam.

Quick answers

What is the handshaking lemma?

The sum of all vertex degrees in a graph equals twice the number of edges, since every edge contributes 1 to the degree of each of its two endpoints.

Do two graphs with the same degree sequence have to be isomorphic?

No. A matching degree sequence is necessary for two graphs to be isomorphic, but not sufficient - the same degrees can be arranged into structurally different graphs.

← Back to Applications & Interpretation HL topics