26-09 — Graph Theory Basics

Phase: Combinatorics | Subject: 26-09 Prerequisites: 26-03-combinations.md, 26-05-pigeonhole-principle.md Next subject: 26-10-combinatorial-proofs.md


Learning Objectives

By the end of this subject, you will be able to:

  1. Define graphs: vertices, edges, adjacency, incidence, degree
  2. State and prove the Handshaking Lemma
  3. Classify graphs: simple, complete, bipartite, trees, planar
  4. Compute paths, cycles, and connectivity
  5. Apply Euler's formula for planar graphs

Core Content

Basic Definitions

A graph $G = (V, E)$ is a set of vertices $V$ and edges $E$ (unordered pairs of vertices).

The Handshaking Lemma

$$\sum_{v \in V} \deg(v) = 2|E|$$

Corollary: In any graph, the number of vertices of odd degree is even.

Paths and Cycles

Trees

A tree is a connected acyclic graph.

Properties (all equivalent for an $n$-vertex graph): - Connected and acyclic - $n-1$ edges - Connected, and removing any edge disconnects it - Any two vertices connected by exactly one path

Example: A tree with $n$ vertices has exactly $n-1$ edges.

Eulerian and Hamiltonian

Planar Graphs and Euler's Formula

A graph is planar if it can be drawn in the plane without edge crossings.

Euler's Formula: For a connected planar graph with $v$ vertices, $e$ edges, and $f$ faces (including the outer face):

$$v - e + f = 2$$

Corollary: For a simple planar graph with $v \geq 3$: $e \leq 3v - 6$. This proves $K_5$ is nonplanar: $v=5, e=10$, but $3(5)-6=9 < 10$.


Key Terms

Worked Examples

Example 1: Degree Sequence

Is there a graph with degree sequence (3, 3, 3, 3, 2)?

Solution: Sum of degrees = $3+3+3+3+2 = 14$ (even — OK by Handshaking). By Havel-Hakimi, sort descending: 3, 3, 3, 3, 2. Remove the first (3) and subtract 1 from the next 3: 2, 2, 2, 2. Next: remove 2, subtract 1 from next 2: 1, 1, 2. Sort: 2, 1, 1. Remove 2, subtract 1 from next 2: 0, 0 — valid! So yes, such a graph exists.

Click for answer Yes. The Havel-Hakimi algorithm confirms this is a graphical sequence.

Example 2: Tree Edges

How many edges does a forest of 3 trees with 15 total vertices have?

Solution: A tree with $n_i$ vertices has $n_i - 1$ edges. For 3 trees with $n_1 + n_2 + n_3 = 15$: Total edges = $(n_1 - 1) + (n_2 - 1) + (n_3 - 1) = 15 - 3 = 12$.

Click for answer 12 edges. A forest with $k$ trees and $n$ vertices has $n - k$ edges.

Example 3: Planarity

Use Euler's formula to show $K_{3,3}$ is nonplanar.

Solution: $K_{3,3}$ has $v=6$ vertices, $e=9$ edges. In a planar bipartite graph with no triangles, $e \leq 2v - 4$. Check: $2(6)-4 = 8 < 9$. So $K_{3,3}$ cannot be planar.

Click for answer $K_{3,3}$ violates the strengthened bound for triangle-free planar graphs. It's nonplanar.


Quiz

Q1: What does the concept of Degree primarily refer to in this subject?

A) The definition and application of Degree B) A computational error related to Degree C) A visual representation of Degree D) A historical anecdote about Degree

Correct: A)

Q2: Which of the following is the key formula discussed in this subject?

A) A simplified version of G = (V, E)... B) G = (V, E) C) An unrelated formula from a different topic D) The inverse operation of the formula in question

Correct: B)

Q3: What is the primary purpose of Adjacent?

A) It is primarily a historical notation system B) It is used only in advanced research contexts C) It replaces all other methods in this domain D) It is used to adjacent in mathematical analysis

Correct: D)

Q4: Which statement about Complete graph is TRUE?

A) Complete graph is a fundamental concept covered in this subject B) Complete graph is not related to this subject C) Complete graph is mentioned only as a historical footnote D) Complete graph is an advanced topic beyond this subject's scope

Correct: A)

Q5: Based on the worked examples in this subject, what is the correct result?

A) An unrelated numerical value B) A different result from a common mistake C) The inverse of the correct answer D) Tree Edges

Correct: D)

Q6: How are Complete graph and Distance related?

A) Complete graph is a special case of Distance B) Complete graph and Distance are completely unrelated topics C) Complete graph and Distance are closely related concepts D) Complete graph is the inverse of Distance

Correct: C)

Q7: What is a common pitfall when working with Basic Definitions?

A) A common mistake is confusing Basic Definitions with a similar concept B) The main error with Basic Definitions is using it when it is not needed C) Basic Definitions is always computed the same way in all contexts D) Basic Definitions has no common misconceptions

Correct: A)

Q8: When should you apply The Handshaking Lemma?

A) The Handshaking Lemma is not practically useful B) Use The Handshaking Lemma only in pure mathematics contexts C) Apply The Handshaking Lemma to solve problems in this subject's domain D) Avoid The Handshaking Lemma unless explicitly instructed

Correct: C)

Practice Problems

  1. How many edges in $K_7$ (complete graph on 7 vertices)?

    Click for answer $\binom{7}{2} = 21$ edges.

  2. A graph has 10 vertices each of degree 4. How many edges?

    Click for answer $\sum \deg = 40 = 2|E|$, so $|E| = 20$.

  3. Can a tree have 7 vertices and 7 edges? Justify.

    Click for answer No. A tree on $n$ vertices has exactly $n-1$ edges. 7 vertices → 6 edges.

  4. Is the complete bipartite graph $K_{2,3}$ planar?

    Click for answer Yes. $v=5, e=6$. $3v-6 = 9 \geq 6$. And $K_{2,3}$ can be drawn without crossings.

  5. What is the maximum number of edges in a simple graph with 5 vertices?

    Click for answer $\binom{5}{2} = 10$ edges ($K_5$, the complete graph on 5 vertices).


Summary

Key takeaways:


Pitfalls



Next Steps

Next up: 26-10-combinatorial-proofs.md — the art of proving combinatorial identities by counting the same thing in two ways.