Graph Theory Fundamentals
Introduction
Graph theory is the mathematical study of relationships between objects. A graph consists of vertices (also called nodes) connected by edges. This simple structure can model an enormous variety of real-world situations: social networks, transportation systems, molecular structures, computer networks, scheduling problems, and countless others.
The field originated in
Graph theory has become essential in computer science for data structures and algorithms, in operations research for optimization, in chemistry for molecular modeling, and in social sciences for network analysis. We will develop the fundamental definitions, properties, and theorems that form the basis of this rich field.
Basic Definitions
Graphs
A graph
In an undirected graph, each edge is an unordered pair
A simple graph has no loops (edges from a vertex to itself) and no multiple edges between the same pair of vertices. Unless otherwise specified, we consider simple undirected graphs.
Adjacency and Incidence
Two vertices
The neighborhood of a vertex
Degree
The degree of a vertex
A vertex of degree zero is called isolated. A vertex of degree one is called a leaf or pendant vertex. The minimum degree in a graph is denoted
A graph is called
The Handshaking Lemma
One of the most fundamental results in graph theory states:
Each edge contributes exactly
Paths and Connectivity
Walks, Paths, and Cycles
A walk in a graph is a sequence of vertices
A path is a walk with no repeated vertices. A cycle is a walk with
The path graph
Connectivity
A graph is connected if there exists a path between every pair of vertices. A maximal connected subgraph is called a connected component.
The distance
Special Types of Graphs
Complete Graphs
The complete graph
Bipartite Graphs
A graph is bipartite if its vertices can be partitioned into two disjoint sets
The complete bipartite graph
Trees
A tree is a connected graph with no cycles. Equivalently, a tree on
A forest is a graph with no cycles (a disjoint union of trees). A rooted tree has a designated root vertex, defining parent-child relationships.
Trees are fundamental in computer science for data structures (binary search trees, heaps) and algorithms (spanning trees, decision trees).
Graph Representations
Adjacency Matrix
The adjacency matrix
For undirected graphs,
Adjacency List
An adjacency list stores, for each vertex, a list of its neighbors. This representation uses
Eulerian and Hamiltonian Paths
Eulerian Paths and Circuits
An Eulerian path is a walk that uses every edge exactly once. An Eulerian circuit is an Eulerian path that starts and ends at the same vertex.
A connected graph has an Eulerian circuit if and only if every vertex has even degree. It has an Eulerian path (but not circuit) if and only if exactly two vertices have odd degree (these must be the endpoints).
This was Euler's original theorem from the Königsberg bridge problem. The condition can be checked in linear time, and an Eulerian path can be found efficiently using Hierholzer's algorithm.
Hamiltonian Paths and Cycles
A Hamiltonian path visits every vertex exactly once. A Hamiltonian cycle is a Hamiltonian path that returns to the starting vertex.
Unlike Eulerian paths, there is no simple characterization of graphs with Hamiltonian paths. Determining whether a Hamiltonian path exists is NP-complete. However, sufficient conditions exist:
Dirac's Theorem: If
Graph Coloring
A proper vertex coloring assigns colors to vertices such that no two adjacent vertices have the same color. The chromatic number
A graph is
The Four Color Theorem states that every planar graph is 4-colorable. This means any map can be colored with four colors such that no two adjacent regions have the same color.
Summary
A graph
A path visits vertices without repetition; a cycle returns to its start. A graph is connected if every pair of vertices has a path between them. Trees are connected acyclic graphs with
Special graph families include complete graphs
Eulerian paths (using every edge once) have a complete characterization via vertex degrees. Hamiltonian paths (visiting every vertex once) are harder to characterize computationally. Graph coloring assigns colors to vertices to avoid adjacent vertices sharing colors.