Graph theory
A graph is a "map of connections": a set of vertices and the edges linking them. The number of edges at vertices reveals properties of the graph (the handshake lemma), the structure distinguishes trees and complete graphs, and Euler circuits and isomorphism let us compare and traverse graphs.
In plain words:
A graph is "dots" (vertices) and "lines" (edges) between them. The set V stores the vertices, and the set E stores pairs of vertices joined by an edge.
Example:
- V = {1, 2, 3}, E = {(1,2), (2,3)} — a chain of three vertices
- In a simple graph loops (an edge from a vertex to itself) and multiple edges are forbidden
- A graph is drawn however you like — only the pairs of connected vertices matter
Main rule:
The number of vertices is denoted ∣V∣ and the number of edges ∣E∣. Edges are unordered pairs of distinct vertices.
In plain words:
The degree of a vertex is the number of edges incident to it. A vertex with no edges at all has degree zero — it is called isolated.
Example:
- Chain 1—2—3: deg(1) = 1, deg(2) = 2, deg(3) = 1
- A cycle of 4 vertices: every degree is 2
- In the complete graph K_n every vertex has degree n − 1
Main rule:
Each edge contributes one unit of degree to its two vertices — so the degree is counted over the incident edges.
In plain words:
Each edge connects exactly two vertices, so it "works" for two degrees at once. Therefore the sum of all degrees is always even and equals twice the number of edges.
Example:
- Chain 1—2—3: 1 + 2 + 1 = 4 = 2 · (number of edges 2)
- In a graph with 5 edges the sum of all degrees equals 10
Main rule:
It follows from the lemma that the number of vertices of odd degree in any graph is necessarily even.
In plain words:
A path is a route along edges from one vertex to another. If a path starts and ends at the same vertex and repeats no vertices, it is a cycle.
Example:
- Path 1 → 2 → 3 in the chain 1—2—3
- Triangle 1-2-3-1 is a simple cycle of length 3
- The length of a path is the number of edges crossed
Main rule:
A simple path repeats no vertices; a cycle is a closed simple path of length at least 3.
In plain words:
A graph is connected if you can reach any vertex from any other along edges. If not, the graph breaks into connected components: connected "islands" with no edges between them.
Example:
- Chain 1—2—3 is connected — one component
- Two separate triangles — two components
- An isolated vertex is a component of one vertex
Main rule:
A connected component is a maximal connected subgraph: no vertex can be added to it without losing connectivity.
In plain words:
A tree is a connected graph without cycles: a branched structure with no closed loops. A tree with n vertices always has exactly n − 1 edges.
Example:
- With 4 vertices: the chain 1—2—3—4 contains 3 edges
- With 4 vertices: a "fork" (star with a center) also has 3 edges
- Everyday examples: a family tree, a folder scheme
Main rule:
Connectivity and the absence of cycles together are equivalent to the formula ∣E∣=∣V∣−1: any of these properties with the formula implies the third.
In plain words:
The complete graph Kn is "everyone with everyone": every pair of vertices is joined by an edge. The number of edges equals the number of ways to choose a pair of vertices.
Example:
- K_3 is a triangle: 3·2/2 = 3 edges
- K_5 has ten edges: 5·4/2 = 10
- Each vertex in K_n has degree n − 1
Main rule:
A complete graph has exactly as many edges as pairs of vertices: ∣E(Kn)∣=n(n−1)/2.
In plain words:
An Euler circuit traverses every edge exactly once and returns to the starting vertex. It exists when all vertex degrees are even; an Euler path (without the return) — when there are exactly two odd vertices.
Example:
- Square 1-2-3-4-1: all degrees are 2 — an Euler circuit exists
- Chain 1—2—3: degrees 1, 2, 1 — an Euler path exists, but not a circuit
- A four-pointed star: four odd degrees — neither a circuit nor a path
Main rule:
Euler's criterion: a circuit — all degrees even; a path — exactly two odd degrees (its endpoints).
In plain words:
Isomorphic graphs are "the same up to relabeling vertices": there is a one-to-one correspondence between their vertices that preserves edges. They can be drawn differently — the structure is the same.
Example:
- Chain 1-2-3 and chain a-b-c are isomorphic
- A hexagon and a square are NOT isomorphic: their cycles have different lengths
- A mirrored reflection of the same graph is the same graph
Main rule:
Isomorphism preserves vertex degrees and cycle sizes. Equal numbers of vertices and edges are a necessary but not sufficient condition.