1. Introduction: How to Use This Article
This article provides a single-page panoramic view of undergraduate graph theory. For each topic, we present the key definitions, major theorems, and algorithms in concise form.
How to use this page:
Newcomers: read the sections in order to build a coherent picture of the subject.
Review or exam preparation: jump to any section from the table of contents.
Competitive programming reference: Section 14, “ Theorem and Algorithm Directory,”{} collects all the major results in one list.
The dependency diagram below shows how the main topics are interrelated.
graph TD
A["Basic Definitions"] --> B["Paths and Connectivity"]
B --> C["Trees and Forests"]
B --> D["Eulerian and Hamiltonian Graphs"]
C --> E["Shortest Paths"]
B --> E
B --> F["Directed Graphs and Topological Sorting"]
B --> G["Matchings and Coverings"]
G --> H["Network Flow"]
A --> I["Planar Graphs"]
I --> J["Graph Coloring"]
A --> K["Algebraic Graph Theory"]
C --> L["Matroids and the Greedy Algorithm"]
style A fill:#f5f5f5,stroke:#333,color:#000
style E fill:#f5f5f5,stroke:#333,color:#000
style H fill:#f5f5f5,stroke:#333,color:#000
style L fill:#f5f5f5,stroke:#333,color:#000
2. Basic Definitions
An undirected graphG=(V,E) consists of a finite set V (the vertex set) and a set E⊆(2V) of two-element subsets of V (the edge set). A directed graphG=(V,A) has arcs given by ordered pairs A⊆V×V.
In an undirected graph, the degreedeg(v) of a vertex v is the number of edges incident to v. In a directed graph, one distinguishes the in-degreedeg−(v) and the out-degreedeg+(v).
In an undirected graph G=(V,E), v∈V∑deg(v)=2∣E∣
In particular, the number of vertices of odd degree is always even.
Complete graphKn: the graph on n vertices in which every pair of vertices is adjacent. ∣E∣=(2n).
Complete bipartite graphKm,n: V=V1∪V2 with ∣V1∣=m, ∣V2∣=n, and every vertex in V1 adjacent to every vertex in V2.
ComplementGˉ: E(Gˉ)=(2V)∖E(G).
Graphs G1=(V1,E1) and G2=(V2,E2) are isomorphic if there exists a bijection φ:V1→V2 such that {u,v}∈E1⟺{φ(u),φ(v)}∈E2.
For more details:
https://interconnectd.app/articles/frCbKNxQy0LCIv0iVHDZ
3. Paths and Connectivity
A vertex sequence v0,v1,…,vk in which each consecutive pair is joined by an edge is called a walk. If no vertex is repeated, it is a path. If v0=vk, it is a cycle.
A graph G is connected if for every pair of vertices u,v there exists a path from u to v. A maximal connected subgraph is called a connected component.
The vertex connectivityκ(G) is the minimum number of vertices whose removal disconnects G. The edge connectivityλ(G) is the minimum number of edges whose removal disconnects G.
κ(G)≤λ(G)≤δ(G)
where δ(G)=minv∈Vdeg(v) is the minimum degree.
A vertex whose removal increases the number of connected components is called a cut vertex. An edge whose removal increases the number of connected components is called a bridge.
A graph G is bipartite⟺G contains no odd cycle.
For two vertices s and t in a graph G, the maximum number of internally vertex-disjoint s–t paths equals the minimum size of an s–t separating set.
For more details:
https://interconnectd.app/articles/HIsIycrl4LGkftbzmrIU
4. Trees and Forests
A connected graph with no cycles is called a tree. A graph with no cycles (not necessarily connected) is called a forest.
For a graph T on n vertices, the following are equivalent:
T is a tree (connected and acyclic).
T is connected and has ∣E∣=n−1.
T is acyclic and has ∣E∣=n−1.
There is exactly one path between any two vertices.
T is connected, but removing any edge disconnects it.
T is acyclic, but adding any edge creates a cycle.
The number of labeled trees on n vertices is nn−2.
A spanning tree of a graph G is a subgraph of G that includes every vertex of G and is a tree.
In an edge-weighted graph, a spanning tree whose total edge weight is minimized is called a minimum spanning tree (MST).
Key algorithms:
Kruskal's algorithm: sort edges by weight and add each edge that does not create a cycle. O(∣E∣log∣E∣).
Prim's algorithm: grow the tree from a starting vertex by always adding the minimum-weight edge leaving the current tree. O(∣E∣log∣V∣).
For any cut (a partition of V into two nonempty sets), the minimum-weight edge crossing the cut belongs to some MST.
For more details:
https://interconnectd.app/articles/YzatnhNAeHrFWs5N5rdK
5. Eulerian and Hamiltonian Graphs
A closed walk that traverses every edge exactly once is called an Eulerian circuit. A graph that admits an Eulerian circuit is called an Eulerian graph.
A connected graph G is Eulerian ⟺ every vertex of G has even degree.
A cycle that visits every vertex exactly once is called a Hamiltonian cycle.
If G is a simple graph on n≥3 vertices with δ(G)≥n/2, then G has a Hamiltonian cycle.
If G is a simple graph on n≥3 vertices such that deg(u)+deg(v)≥n for every pair of non-adjacent vertices u,v, then G has a Hamiltonian cycle.
For more details:
https://interconnectd.app/articles/1TJ9SYhKvLV6xsyieLaV
6. Shortest Path Problems
In a graph with edge weights w:E→R, the shortest path from s to t is a path minimizing the sum of edge weights. We write dist(s,t) for this minimum total weight.
Key algorithms:
BFS: single-source shortest paths in unweighted graphs. O(∣V∣+∣E∣).
Dijkstra: single-source shortest paths with non-negative weights. O((∣V∣+∣E∣)log∣V∣) (binary heap).
Bellman–Ford: single-source shortest paths allowing negative weights. O(∣V∣∣E∣). Also detects negative cycles.
Floyd–Warshall: all-pairs shortest paths. O(∣V∣3).
DAG shortest paths: relax edges in topological order. O(∣V∣+∣E∣).
In a graph with non-negative edge weights, Dijkstra's algorithm maintains the invariant that the distance label of every finalized vertex equals its true shortest-path distance from the source.
Bellman–Ford detects a negative cycle reachable from the source s if and only if an update occurs during the ∣V∣-th iteration.
For more details:
https://interconnectd.app/articles/ffriRQaeeGIg10QEJCU1
7. Directed Graphs and Topological Sorting
A directed graph G is strongly connected if for every pair of vertices u,v there exist directed paths from u to v and from v to u. A maximal strongly connected subgraph is called a strongly connected component (SCC).
Contracting each SCC of a directed graph to a single vertex yields a DAG (directed acyclic graph).
SCC algorithms:
A topological sort of a DAG G is a total ordering v1,v2,…,vn of its vertices such that (vi,vj)∈A⇒i<j.
A directed graph admits a topological sort ⟺ it is a DAG.
For more details:
https://interconnectd.app/articles/nNEOHtN9fe6Uf9vDnOdQ
8. Matchings and Coverings
A set of edges M⊆E in which no two edges share an endpoint is called a matching. A matching of maximum cardinality is called a maximum matching.
An augmenting path with respect to a matching M is a path whose edges alternate between edges not in M and edges in M, and whose endpoints are both unmatched.
A matching M is maximum ⟺ there is no augmenting path with respect to M.
In a bipartite graph G=(X∪Y,E), a perfect matching of X exists ⟺∣N(S)∣≥∣S∣ for every S⊆X (Hall's condition).
In a bipartite graph, the size of a maximum matching equals the size of a minimum vertex cover.
The stable matching problem (given preference lists for n agents on each side, find a matching with no blocking pair) can be solved in O(n2) time.
For more details:
https://interconnectd.app/articles/TeuUPkNltaVHPIozeFhd
9. Network Flow
A flow network is a tuple (G,c,s,t) consisting of a directed graph G=(V,A), a capacity function c:A→R≥0, a source s, and a sink t. A flowf:A→R≥0 is a function satisfying the capacity constraint f(e)≤c(e) and the conservation of flow at every vertex other than s and t.
For S⊆V with s∈S and t∈/S, the capacity of the cut(S,V∖S) is c(S,V∖S)=∑(u,v)∈A,u∈S,v∈/Sc(u,v).
The value of a maximum flow equals the capacity of a minimum cut.
Key algorithms:
Ford–Fulkerson method: iteratively find augmenting paths in the residual graph.
Edmonds–Karp: use BFS to select augmenting paths. O(∣V∣∣E∣2).
Dinic's algorithm: uses level graphs and blocking flows. O(∣V∣2∣E∣).
The maximum matching in a bipartite graph can be computed by adding a source s and a sink t, assigning unit capacities, and solving the resulting maximum flow problem.
For more details:
https://interconnectd.app/articles/LvJFQmlPzZAIqGzkpcIv
10. Planar Graphs
A graph is planar if it can be drawn in the plane without edge crossings. Such a drawing is called a plane graph.
For a connected plane graph G, V−E+F=2
where V is the number of vertices, E the number of edges, and F the number of faces (including the outer face).
In a simple connected planar graph with ∣V∣≥3, ∣E∣≤3∣V∣−6. In particular, K5 is not planar. If G is triangle-free (as in the K3,3 case), then ∣E∣≤2∣V∣−4.
A graph G is planar ⟺G contains no subdivision of K5 or K3,3 as a subgraph.
The dual graphG∗ of a plane graph G has a vertex for each face of G, and two vertices of G∗ are joined by an edge whenever the corresponding faces of G share a boundary edge.
For more details:
https://interconnectd.app/articles/wLP1cCOHrfu571MlDd3V
11. Graph Coloring
A vertex coloring of a graph G is an assignment of colors to vertices such that no two adjacent vertices receive the same color. If G can be colored with k colors, G is said to be k-colorable. The minimum such k is the chromatic numberχ(G).
ω(G)≤χ(G)≤Δ(G)+1where ω(G) is the clique number and Δ(G) is the maximum degree.
If G is a connected graph that is neither a complete graph nor an odd cycle, then χ(G)≤Δ(G).
Let P(G,k) denote the number of proper k-colorings of G. Then P(G,k) is a polynomial in k.
For the edge chromatic number (or chromatic index) χ′(G) of a simple graph G, Δ(G)≤χ′(G)≤Δ(G)+1.
Every planar graph is 4-colorable (χ(G)≤4).
For more details:
https://interconnectd.app/articles/rTuW1frjXvB379VAnpDK
12. Algebraic Graph Theory
The adjacency matrix of a graph G on n vertices is the n×n matrix A=(aij) where aij=1 if {i,j}∈E and aij=0 otherwise.
The (i,j)-entry of Ak equals the number of walks of length k from vertex i to vertex j.
The Laplacian matrix is L=D−A, where D is the diagonal degree matrix. L is positive semidefinite with eigenvalues 0≤λ1≤λ2≤⋯≤λn.
The multiplicity of the eigenvalue 0 in L equals the number of connected components of G. In particular, λ2>0⟺G is connected. The quantity λ2 is called the algebraic connectivity.
The number of spanning trees of G equals any cofactor of L (i.e., any (i,i)-cofactor of the Laplacian matrix).
For more details:
https://interconnectd.app/articles/VaqPp5RARg4xmSCQDDel
13. Matroids and the Greedy Algorithm
A matroid is a pair (E,I) consisting of a finite set E and a collection I⊆2E of subsets satisfying:
∅∈I.
If A∈I and B⊆A, then B∈I (hereditary property).
If A,B∈I and ∣A∣<∣B∣, then there exists b∈B∖A such that A∪{b}∈I (exchange property).
The members of I are called independent sets.
Given a graph G=(V,E), declare a subset of E to be independent if it contains no cycle. The resulting pair (E,I) is a matroid called the graphic matroid. Its independent sets are the forests of G, and its bases are the spanning trees.
If (E,I) is a matroid and w:E→R is a weight function, then the greedy algorithm—adding elements in decreasing order of weight, provided independence is maintained—produces a maximum-weight independent set.
If (E,I) satisfies the hereditary property, then the greedy algorithm yields a maximum-weight independent set for every weight function w if and only if (E,I) is a matroid.
For more details:
https://interconnectd.app/articles/XHUQNbZEzRsQZwUv2NGF
14. Theorem and Algorithm Directory
A one-line summary of the principal theorems and algorithms encountered in graph theory, for quick reference.
Fundamental theorems:
Handshaking lemma: ∑deg(v)=2∣E∣.
Bipartiteness criterion: no odd cycle ⟺ bipartite.
Edge count of a tree: a tree on n vertices has n−1 edges.
Cayley's formula: the number of labeled trees on n vertices is nn−2.
Euler's theorem: connected + all vertices of even degree ⟺ Eulerian circuit.
Dirac's theorem: δ(G)≥n/2 implies a Hamiltonian cycle.
Euler's polyhedron formula: V−E+F=2.
Kuratowski's theorem: no K5 or K3,3 subdivision ⟺ planar.
Four color theorem: every planar graph is 4-colorable.
Brooks's theorem: χ(G)≤Δ(G) (excluding complete graphs and odd cycles).
Vizing's theorem: Δ(G)≤χ′(G)≤Δ(G)+1.
Matching and flow theorems:
Berge's theorem: maximum matching ⟺ no augmenting path.
Hall's marriage theorem: ∣N(S)∣≥∣S∣⟺ perfect matching exists.
König's theorem: in bipartite graphs, maximum matching = minimum vertex cover.
Max-flow min-cut theorem: maximum flow = minimum cut.
Menger's theorem: maximum number of independent paths = minimum separating set.
Algebraic and structural theorems:
Matrix tree theorem: number of spanning trees = cofactor of the Laplacian.
Aktheorem: (Ak)ij= number of walks of length k.
Greedy optimality: the greedy algorithm is optimal on matroids.
Key algorithms:
BFS / DFS: O(∣V∣+∣E∣)
Dijkstra: O((∣V∣+∣E∣)log∣V∣)
Bellman–Ford: O(∣V∣∣E∣)
Floyd–Warshall: O(∣V∣3)
Kruskal: O(∣E∣log∣E∣)
Prim: O(∣E∣log∣V∣)
Kosaraju / Tarjan (SCC): O(∣V∣+∣E∣)
Dinic (max flow): O(∣V∣2∣E∣)
Gale–Shapley (stable matching): O(n2)
15. Appendix: Notation and Terminology
| Symbol |
Name |
Meaning |
| G=(V,E) |
Graph |
A vertex set V paired with an edge set E |
| deg(v) |
Degree |
Number of edges incident to v |
| δ(G) |
Minimum degree |
minvdeg(v) |
| Δ(G) |
Maximum degree |
maxvdeg(v) |
| κ(G) |
Vertex connectivity |
Min. vertices to remove to disconnect G |
| λ(G) |
Edge connectivity |
Min. edges to remove to disconnect G |
| Kn |
Complete graph |
The complete graph on n vertices |
| Km,n |
Complete bipartite graph |
Complete bipartite graph of sizes m,n |
| χ(G) |
Chromatic number |
Min. colors for a proper vertex coloring |
| χ′(G) |
Chromatic index |
Min. colors for a proper edge coloring |
| ω(G) |
Clique number |
Size of the largest clique |
| A |
Adjacency matrix |
aij=[{i,j}∈E] |
| L=D−A |
Laplacian |
Degree matrix minus adjacency matrix |
| MST |
Minimum spanning tree |
Spanning tree of minimum total weight |
| SCC |
Strongly connected component |
Maximal strongly connected subgraph |
| DAG |
Directed acyclic graph |
Directed graph with no directed cycles |
| NP-complete |
NP-complete |
Hardest problems in NP (verifiable in polynomial time) |