A subgraph is a graph formed using some or all of the vertices and edges of another graph. A tree is a connected graph containing no cycles.
Subgraphs
If a graph has vertex set and edge set , a graph is a subgraph of when
Every edge retained in must connect the same vertices that it connects in . A subgraph may omit vertices, omit edges, be disconnected, or contain cycles.
For example, suppose has vertices and edges . A graph with vertices and edges is a subgraph of .
Trees
A tree must satisfy two conditions simultaneously: it is connected, meaning every pair of vertices is joined by a path, and acyclic, meaning it contains no closed path returning to its starting vertex.
| Feature | Subgraph | Tree |
|---|---|---|
| Relationship to another graph | Formed from selected vertices and edges | May exist independently or as a subgraph |
| Must be connected? | No | Yes |
| May contain a cycle? | Yes | No |
| Edge rule | Edges come from the original graph | A tree with vertices has edges |
In the example above, forms a tree: all three vertices are connected and there is no cycle. By contrast, forms a cycle and is therefore not a tree.
A common misconception is that any connected subgraph is a tree. This is false: a connected subgraph containing even one cycle is not a tree.
Exam Technique
This is HL-only content from AHL 3.14: Graph theory, applicable to GDC-active Paper 1, Paper 2, or Paper 3 questions. To justify that a graph is a tree, state both required properties: it is connected and contains no cycles; checking only that it has edges is insufficient without the relevant structural conditions.
