ConceptComplete

Graph Theory Basics - Core Definitions

Graph theory provides a mathematical framework for studying pairwise relationships between objects. Graphs model networks, connections, and structures across computer science, operations research, social sciences, and pure mathematics.

DefinitionGraph

A graph G=(V,E)G = (V, E) consists of:

  • A set VV of vertices (or nodes)
  • A set EE of edges, where each edge connects two vertices

An edge between vertices uu and vv is denoted {u,v}\{u, v\} or simply uvuv. If edge e=uve = uv exists, we say uu and vv are adjacent or neighbors, and ee is incident to both uu and vv.

Graphs can be undirected (edges have no direction) or directed (each edge has a source and target vertex, forming a digraph). Unless stated otherwise, we consider simple undirected graphs: no multiple edges between vertices and no loops (edges from a vertex to itself).

DefinitionDegree

The degree of a vertex vv, denoted deg⁑(v)\deg(v) or d(v)d(v), is the number of edges incident to vv. In a directed graph, we distinguish in-degree degβ‘βˆ’(v)\deg^-(v) (incoming edges) and out-degree deg⁑+(v)\deg^+(v) (outgoing edges).

A vertex with degree 0 is isolated. A vertex with degree 1 is a leaf (or pendant vertex).

ExampleHandshaking Lemma

In any graph G=(V,E)G = (V, E), the sum of all vertex degrees equals twice the number of edges: βˆ‘v∈Vdeg⁑(v)=2∣E∣\sum_{v \in V} \deg(v) = 2|E|

This follows because each edge contributes 1 to the degree of each of its two endpoints. A corollary: every graph has an even number of odd-degree vertices (since the sum must be even).

DefinitionPaths and Cycles

A path in a graph is a sequence of vertices v0,v1,…,vkv_0, v_1, \ldots, v_k where each consecutive pair is connected by an edge. The length of the path is kk (the number of edges).

A path is simple if no vertex is repeated. A cycle is a path v0,v1,…,vkv_0, v_1, \ldots, v_k where v0=vkv_0 = v_k and all other vertices are distinct. The girth of a graph is the length of its shortest cycle (or ∞\infty if acyclic).

DefinitionConnectivity

A graph is connected if there exists a path between every pair of vertices. A connected component is a maximal connected subgraph.

The distance d(u,v)d(u,v) between vertices uu and vv is the length of the shortest path between them (or ∞\infty if no path exists). The diameter of a connected graph is max⁑u,vd(u,v)\max_{u,v} d(u,v).

DefinitionSpecial Graphs
  • Complete graph KnK_n: Graph with nn vertices where every pair is connected (∣E∣=(n2)|E| = \binom{n}{2})
  • Cycle graph CnC_n: Graph forming a single cycle of nn vertices
  • Path graph PnP_n: Graph forming a single path of nn vertices
  • Bipartite graph: Vertices can be partitioned into two sets such that all edges connect vertices from different sets
  • Complete bipartite graph Km,nK_{m,n}: Bipartite graph with parts of size mm and nn where all possible edges exist
Remark

Graph theory originated with Euler's 1736 solution to the Seven Bridges of KΓΆnigsberg problem, which asked whether one could walk through the city crossing each bridge exactly once. Euler proved this impossible by modeling bridges as edges and landmasses as vertices, showing the problem required a path visiting every edge exactly once (an Eulerian path), which exists only if the graph has at most two odd-degree vertices. This problem launched graph theory as a mathematical discipline.

These foundational concepts enable precise analysis of network structures and relationship patterns across diverse applications.