Graph Theory

Graph theory studies graphs — collections of objects (vertices) connected pairwise by relations (edges). One-line statement: a graph encodes which pairs of a set are related. Key result in words: deep structure (connectivity, colorability, planarity, matchings, flows) follows from simple combinatorial axioms. Applies in computer science, networks, chemistry, operations research, and discrete optimization. Founded by Leonhard Euler in 1736 with the Königsberg bridges problem; matured in the 19th–20th centuries.

A graph is a pair where is a finite set of vertices and is a set of edges, each edge joining two vertices. Graph theory matters because an enormous variety of structures — road networks, molecules, social ties, circuit layouts, scheduling constraints — reduce to vertices-and-edges, so a single theory yields algorithms and theorems usable across disciplines. The field studies invariants (degree, connectivity, chromatic number), structural decompositions (trees, planar embeddings), and optimization (shortest paths, flows, matchings). A surprising fact: whether a graph can be drawn in the plane without edge crossings is characterized by forbidding just two graphs as minors (Kuratowski's Theorem / Wagner's theorem) — an infinite family of constraints collapses to a finite one. Graph theory sits at the boundary of pure combinatorics and applied computer science.

The Core Insight

Almost any system of pairwise relations can be abstracted to a graph, and once abstracted, the same combinatorial tools apply regardless of the original domain. The structure of a graph is governed by local data (vertex degrees, neighborhoods) that constrains global properties (connectivity, cycles, colorability). The art of graph theory is translating a question — "Can we schedule these exams?", "Is this network robust?", "Can this molecule exist?" — into a statement about vertices and edges, then exploiting universal theorems.

Formal Statement

Graph

A (simple, undirected) graph is an ordered pair where:

  • is a finite nonempty set of vertices (also nodes),
  • is a set of edges, each an unordered pair of distinct vertices.

We write for the order and for the size. Two vertices joined by an edge are adjacent; an edge is incident to its endpoints. Variants:

  • A multigraph allows multiple edges between the same pair.
  • A graph with loops allows edges .
  • A directed graph (digraph) uses ordered pairs (arcs).
  • A weighted graph assigns .

Degree

The degree of a vertex is the number of edges incident to it. In a simple graph,

1
⟳count neighbors directly; each adjacency contributes exactly one to the count.

The minimum and maximum degrees are and .

Handshaking Lemma

For any finite graph ,

2
⟳each edge has two endpoints, so summing degrees double-counts every edge.

A corollary: the number of vertices of odd degree is even.

3
⟳split the sum in [2] into odd- and even-degree parts; the total is even, the even part is even, so the odd part has even cardinality.

Adjacency Matrix

For , the adjacency matrix is the matrix with

4
⟳read off adjacency as a 0/1 incidence indicator; for simple graphs is symmetric with zero diagonal.

The number of walks of length from to equals the entry of :

5
⟳induct on ; matrix multiplication sums over all intermediate vertices, exactly enumerating concatenations of a walk of length with one edge.

Connectivity and Paths

A walk is an alternating sequence of vertices and edges; a path is a walk with no repeated vertex; a cycle is a closed path. is connected if every pair of vertices is joined by a path. A maximal connected subgraph is a connected component. The distance is the length of a shortest – path (or ).

Why It Holds / Derivation

Handshaking Lemma

We prove equation [2].

  1. Consider the set of incidences .
  2. Count by vertices. For each vertex , the number of incidences involving is exactly (one per incident edge). Hence .
  3. Count by edges. Each edge has exactly two endpoints, contributing exactly incidences. Hence .
  4. Equating the two counts: .

Walk-Counting Formula

We prove [5] by induction on .

  1. Base : counts the walks of length 1 (single edges) from to . True.
  2. Inductive step: Assume counts walks of length from to . A walk of length from to is a walk of length from to some intermediate vertex , followed by an edge .
  3. Summing over all valid :
6
⟳this is the definition of matrix multiplication ; each term counts (walks to ) × (edge ).
  1. The right side counts exactly all length- walks, completing the induction.

Leonhard Euler | 1707–1783

Euler launched graph theory in 1736 by solving the Seven Bridges of Königsberg: could a citizen cross each of the city's seven bridges exactly once and return home? Euler abstracted the four landmasses into vertices and the bridges into edges, then showed the walk is impossible because more than two vertices had odd degree. This established the principle — still central — that the answer depends only on the abstract incidence structure, not on geometry. Euler also gave the polyhedral formula , foundational to planar graph theory and topology. His genius was recognizing that a physical puzzle reduces to a counting argument over degrees.

Building Intuition

Think of a graph as a "relationship diagram." Vertices are entities; an edge means "these two are directly linked." Almost every property has a tangible reading:

  • Degree = popularity / number of direct connections.
  • Connected = you can travel between any two points.
  • Path = a route with no backtracking through the same place.
  • Cycle = a round trip returning to start.
  • Bipartite = the entities split into two camps, with links only between camps (think jobs vs. applicants).
  • Tree = a minimally connected network — remove any edge and it falls apart; add any edge and you create a loop.

The handshaking lemma is just "at a party, the total number of handshake-ends is twice the number of handshakes." The adjacency-matrix power trick says "to count -step journeys, multiply the one-step map by itself times" — propagation of reachability through repeated composition.

A simple graph with five vertices, showing degrees and a highlighted cycle

a b c d e deg(a)=2 gold = 4-cycle b–c–e–d–b

Worked Examples

Verifying the Handshaking Lemma

Given: A graph on with edges . So . Step 1 — compute degrees.
  • : edges →
  • : edges →
  • : edges →
  • : edges →
  • : edges →
Step 2 — sum degrees. . Step 3 — check against . . ✓ Step 4 — odd-degree count. Odd-degree vertices: → exactly , which is even, consistent with [3].

Counting walks via matrix powers

Given: A path graph on vertices with adjacency matrix
7
⟳entry 1 marks each adjacent pair; vertex 2 is the center adjacent to both ends.
Step 1 — square .
8
⟳multiply ; since vertex 2 reaches itself via and .
Step 2 — interpret entries. Number of length-2 walks from vertex 1 to vertex 3 is (the walk ). Number of length-2 closed walks at center vertex 2 is . Step 3 — total closed length-2 walks (each edge traversed forward+back gives 2 closed walks; edges → 4). ✓

Common Misconceptions

"A walk, path, trail, and cycle are the same thing." They are not:
  • Walk: vertices/edges may repeat.
  • Trail: no repeated edge (vertices may repeat).
  • Path: no repeated vertex (hence no repeated edge).
  • Cycle/Circuit: closed; a cycle additionally has no repeated internal vertex.

Confusing these breaks theorems: an Eulerian trail uses every edge once; a Hamiltonian path uses every vertex once. These are vastly different in difficulty — Eulerian existence is decided instantly by degree parity, while Hamiltonicity is NP-complete.

Degree sequence does not determine the graph

Two graphs can have identical degree sequences yet not be isomorphic. Consider degree sequence on six vertices:

  • Graph A: a single 6-cycle .
  • Graph B: two disjoint triangles .

Both have every vertex of degree 2 and satisfy [2] (, ). But is connected while is not — they are not isomorphic. Hence the degree sequence is a necessary but not sufficient invariant for graph identity.

Connections

Graph theory connects to many areas:

  • Linear Algebra: the adjacency and Laplacian Matrix turn graph questions into eigenvalue problems (spectral graph theory); eigenvalues bound connectivity, expansion, and colorability.
  • Topology: planar graphs and the Euler characteristic link to surfaces and embeddings; graph minors relate to topological structure.
  • Combinatorics: enumeration (counting trees via Cayley's Formula), extremal results (Turán-type theorems), and Ramsey theory all live here.
  • Probability Theory: random graphs exhibit sharp threshold phenomena and underlie network science.
  • Computational Complexity: many canonical NP-complete problems (Hamiltonian cycle, graph coloring, clique) are graph problems; others (shortest path, max flow) are polynomial.
  • Group Theory: the automorphism group of a graph and Cayley graphs bridge algebra and combinatorics.

Real-World Applications

  1. Internet routing (OSPF, BGP): networks modeled as weighted graphs; Dijkstra's and Bellman–Ford algorithms compute shortest paths for packet delivery.
  2. Google's PageRank: the web is a directed graph; importance is the dominant eigenvector of a stochastic adjacency-derived matrix — spectral graph theory in production.
  3. Compiler register allocation: variables are vertices, "alive simultaneously" is an edge; assigning CPU registers without conflict is graph coloring of the interference graph.
  4. Chemistry (molecular graphs): atoms are vertices, bonds are edges; isomer enumeration, the Wiener index, and QSAR property prediction use graph invariants.
  5. Project scheduling (PERT/CPM): tasks form a directed acyclic graph; the critical path (longest path) determines minimum project duration.
  6. Social network analysis: centrality, community detection, and influence spread are graph algorithms on friendship/follower graphs.
  7. VLSI circuit layout & airline scheduling: planarity testing minimizes wire crossings; bipartite matching assigns crews to flights optimally.

Historical Development

  • 1736 — Euler solves the Seven Bridges of Königsberg, founding graph theory and characterizing Eulerian walks via degree parity.
  • 1750 — Euler states the polyhedral formula , later central to planar graphs.
  • 1847 — Gustav Kirchhoff applies tree-counting to electrical networks (Kirchhoff's matrix-tree theorem).
  • 1852 — Francis Guthrie poses the Four Color Problem (can every planar map be colored with four colors?).
  • 1857 — Arthur Cayley studies trees while enumerating chemical isomers; later proves labeled trees.
  • 1936 — Dénes Kőnig publishes the first textbook on graph theory, consolidating the field.
  • 1930 — Kazimierz Kuratowski characterizes planar graphs by forbidden subgraphs and .
  • 1956 — Edsger Dijkstra (pub. 1959) and contemporaries develop shortest-path and max-flow (Ford–Fulkerson, 1956) algorithms, launching algorithmic graph theory.
  • 1976 — Appel and Haken prove the Four Color Theorem with computer assistance — the first major theorem requiring a computer.
  • 1983–2004 — Robertson and Seymour's Graph Minors project proves every minor-closed family is characterized by finitely many forbidden minors.

Subtleties & Limits

Several deep questions remain partly open or computationally hard:

  • Graph Isomorphism: is there a polynomial-time algorithm to decide whether two graphs are isomorphic? Babai (2015) gave a quasi-polynomial algorithm, but its exact complexity status (P vs NP-intermediate) is unresolved.
  • Hamiltonicity & the Traveling Salesman: deciding whether a Hamiltonian cycle exists is NP-complete; no efficient characterization analogous to Eulerian degree-parity is known.
  • Reconstruction Conjecture (Kelly–Ulam, 1942): is every graph on vertices uniquely determined (up to isomorphism) by its multiset of vertex-deleted subgraphs? Still open.
  • Chromatic number bounds: while always holds (and Brooks's theorem refines it), computing exactly is NP-hard, and structural conjectures (e.g., Hadwiger's conjecture relating to minors) remain unproven in general.

See Also

Trees and Forests · Planar Graphs · Matching Theory · Eulerian and Hamiltonian Paths · Laplacian Matrix · Kuratowski's Theorem · Cayley's Formula · Network Flows

Before this

  • Set Theory — graphs are defined as sets of vertices and pairs; basic set operations are essential.
  • Mathematical Induction — the standard proof technique for graph theorems (e.g., walk-counting, tree properties).
  • Linear Algebra — adjacency/Laplacian matrices and their eigenvalues underlie spectral methods.
  • Combinatorics — counting arguments, binomial coefficients, and the pigeonhole principle recur constantly.
  • Relations and Functions — edges formalize binary relations; isomorphisms are structure-preserving bijections.

Where this leads

  • Network Flows — max-flow/min-cut theory built on directed weighted graphs.
  • Graph Coloring — chromatic theory, the Four Color Theorem, and scheduling applications.
  • Spectral Graph Theory — eigenvalues of graph matrices reveal connectivity and expansion.
  • Algorithmic Graph Theory — shortest paths, matchings, and the P-vs-NP landscape of graph problems.
  • Random Graphs — probabilistic models, thresholds, and the foundations of network science.