Chapter · Math

Discrete Math & Combinatorics

The math of finite, countable things. Counting them, encoding them as graphs, computing on them efficiently. This is the substrate underneath computer science — and the chapter where combinatorial cleverness becomes its own kind of beauty.

The basics of counting (permutations, combinations, the binomial theorem) live in Statistics & Probability › Counting and Combinatorics. Start there if you haven't already.

Topics
Topic 1

Graph Theory Fundamentals

Vertices, edges, walks, paths, cycles. Adjacency representations, connectivity, the handshake lemma, special families, trees, and bipartite graphs.

15 min read
Topic 2

Graph Algorithms

BFS, DFS, Dijkstra, Bellman-Ford, MST (Kruskal and Prim), and topological sort — described in prose and worked diagrams, not code.

15 min read
Topic 3

Trees & Spanning Trees

The simplest graphs that still connect everything. Rooted trees, binary trees, spanning trees, and the MST algorithms (Kruskal, Prim) that find the cheapest skeleton of a weighted graph.

13 min read
Topic 4

The Traveling Salesperson Problem

Visit every city once, return home, minimise distance. The most famous NP-hard problem: brute force, nearest-neighbour, Christofides' 1.5-approximation, and Lin–Kernighan local search.

14 min read
Topic 5

Euler, Hamilton & Coloring

Euler's theorem on the Königsberg bridges, the harder Hamiltonian question (NP-complete), and graph coloring up to the Four Color Theorem.

14 min read
Topic 6

Generating Functions

Encoding a sequence as the coefficients of a power series. Algebra on the function = combinatorics on the sequence. Solving recurrences, deriving Binet's formula for Fibonacci.

14 min read