Graphs differ greatly in how many edges they contain.
Some graphs contain only enough edges to maintain limited connectivity. Others contain edges between almost every pair of vertices. This distinction leads to the concepts of sparse and dense graphs.
Sparsity and density influence nearly every aspect of graph theory: connectivity, expansion, algorithms, random graphs, matrix representations, storage complexity, and asymptotic behavior.
The number of edges is one of the most basic measurements of graph structure.
54.1 Number of Edges
Let
be a simple undirected graph with
vertices and
edges.
Since every edge joins two distinct vertices, the maximum possible number of edges is
This maximum occurs precisely for the complete graph
Thus every simple graph satisfies
The quantity is the first indicator of sparsity or density.
54.2 Sparse Graphs
Informally, a sparse graph has relatively few edges compared with the number of vertices.
In asymptotic graph theory, a family of graphs is usually called sparse when
This means the number of edges grows at most linearly with the number of vertices.
Typical sparse graphs include:
| Graph | Number of edges |
|---|---|
| Tree | |
| Path | |
| Cycle | |
| Bounded-degree graph | |
| Planar graph |
Sparse graphs often have local structure, geometric constraints, or bounded degree.
Many real-world networks are sparse. Even very large social, communication, or biological networks usually contain far fewer than all possible edges.
54.3 Dense Graphs
A graph is dense when the number of edges is close to quadratic in the number of vertices.
A family of graphs is often called dense when
This means the graph contains a constant fraction of all possible edges.
Examples include:
| Graph | Number of edges |
|---|---|
| Complete graph | |
| Complete bipartite graph | |
| Random graph with constant | Approximately |
Dense graphs tend to have strong global connectivity and many short paths.
In a dense graph, local neighborhoods overlap heavily. Distances are usually small, and separators are often large.
54.4 Average Degree
The average degree provides another way to measure sparsity.
Since every edge contributes to the degree sum,
Therefore the average degree is
This quantity is often denoted by
A graph family is sparse precisely when the average degree remains bounded:
Dense graphs have average degree growing linearly with .
For example:
| Graph | Average degree |
|---|---|
| Tree | Approximately |
| Cycle | |
| -regular graph | |
| Complete graph |
Thus sparsity can be viewed either through edge count or through average degree.
54.5 Minimum and Maximum Degree
The degree sequence also reflects sparsity and density.
Let
denote the minimum degree, and let
denote the maximum degree.
If is bounded independently of , then the graph is sparse because
Conversely, dense graphs typically have large average and maximum degree.
However, sparsity is global, not local. A graph may contain a few high-degree vertices and still be sparse overall.
For example, a star graph has one vertex of degree
yet it contains only
edges and is therefore sparse.
54.6 Trees as Minimal Connected Graphs
Trees are the sparsest connected graphs.
A connected graph with vertices must contain at least
edges. Trees achieve this minimum exactly.
Thus:
| Property | Meaning |
|---|---|
| Connected graph | At least edges |
| Tree | Exactly edges |
| Sparse connected graph | Close to tree structure |
This explains why trees are fragile. Every edge is essential.
Adding more edges creates cycles and redundancy.
54.7 Complete Graphs as Maximally Dense Graphs
Complete graphs are the densest possible simple graphs.
The complete graph
contains every possible edge:
Every vertex has degree
Complete graphs maximize many graph parameters:
| Parameter | Value in |
|---|---|
| Connectivity | |
| Edge connectivity | |
| Diameter | |
| Chromatic number | |
| Clique number |
Complete graphs therefore serve as the extreme dense case.
54.8 Planar Graphs Are Sparse
Planar graphs provide one of the most important sparse graph families.
Euler’s formula implies that every simple planar graph with
satisfies
Thus planar graphs have only linearly many edges.
In particular, planar graphs are sparse even when they contain many cycles and complicated structure.
This sparsity has major algorithmic consequences:
| Property | Consequence |
|---|---|
| Linear number of edges | Efficient storage |
| Small separators | Recursive decomposition |
| Bounded average degree | Local structure |
| Geometric constraints | Specialized algorithms |
Planarity therefore combines geometric structure with sparsity.
54.9 Random Graphs
Random graphs exhibit both sparse and dense regimes.
In the Erdős-Rényi model
each possible edge appears independently with probability .
The expected number of edges is
If
for constant , then
so the graph is sparse.
If is a fixed positive constant, then
so the graph is dense.
Thus changing changes the structural regime of the graph.
54.10 Sparse Matrices and Graphs
Graphs and matrices are closely related.
The adjacency matrix of a graph with vertices is an
matrix.
For sparse graphs, most entries are zero. The matrix is sparse.
For dense graphs, many entries are nonzero.
Sparse matrices are important because they allow specialized algorithms and storage methods.
| Matrix type | Graph type |
|---|---|
| Sparse matrix | Sparse graph |
| Dense matrix | Dense graph |
Many numerical methods depend critically on matrix sparsity.
Sparse linear systems appear in scientific computing, optimization, machine learning, and graph algorithms.
54.11 Algorithmic Differences
Sparse and dense graphs behave differently algorithmically.
Storage
A dense graph requires
space if represented by an adjacency matrix.
A sparse graph can often be stored using adjacency lists with only
space.
Traversal
Breadth-first search and depth-first search run in
time.
Thus they are nearly linear for sparse graphs but quadratic for dense graphs.
Matrix Algorithms
Dense graphs favor matrix-based methods because the matrices are already full.
Sparse graphs favor combinatorial methods because most entries are zero.
Shortest Paths
For sparse graphs, Dijkstra’s algorithm with heaps is efficient.
For dense graphs, matrix-based approaches such as Floyd-Warshall may become competitive.
Thus graph density strongly affects algorithm design.
54.12 Extremal Graph Theory
Extremal graph theory studies how many edges a graph can have while avoiding certain subgraphs.
Typical questions include:
| Constraint | Maximum possible edges |
|---|---|
| No triangle | Turán’s theorem |
| No cycle of given length | Extremal cycle theory |
| No complete bipartite subgraph | Zarankiewicz problem |
These problems lie between sparse and dense structure.
For example, a graph may be dense overall but forbidden from containing certain local configurations.
Extremal graph theory studies the tension between edge density and structural constraints.
54.13 Degeneracy
A graph is -degenerate if every subgraph contains a vertex of degree at most .
Degeneracy measures a refined form of sparsity.
Examples:
| Graph family | Degeneracy |
|---|---|
| Forests | |
| Outerplanar graphs | |
| Planar graphs | At most |
Bounded degeneracy implies sparsity, but it is stronger than average sparsity because it controls all subgraphs.
Degeneracy is important in graph algorithms because it allows efficient vertex orderings.
54.14 Arboricity
Arboricity measures how close a graph is to being a union of forests.
The arboricity of a graph is the minimum number of forests needed to cover all edges.
Sparse graphs usually have small arboricity.
For example:
| Graph | Arboricity |
|---|---|
| Forest | |
| Planar graph | At most |
| Complete graph | Approximately |
Arboricity appears in sparse graph algorithms and decomposition methods.
54.15 Expansion and Sparsity
Sparse graphs can behave very differently.
A tree is sparse and poorly connected.
An expander is sparse but highly connected.
Thus sparsity alone says little about global structure.
The crucial question is how the edges are arranged.
| Sparse graph type | Structural behavior |
|---|---|
| Tree | Fragile |
| Grid | Geometric |
| Expander | Highly connected |
| Random sparse graph | Probabilistic connectivity |
This diversity is one reason sparse graph theory is rich and difficult.
54.16 Dense Graph Limits
Dense graph sequences often exhibit statistical regularity.
For dense graphs, edge density becomes meaningful:
One studies limiting distributions of subgraphs, graphons, quasirandomness, and regularity lemmas.
Dense graph theory therefore tends toward probabilistic and analytic methods.
Sparse graph theory often requires combinatorial and geometric methods instead.
54.17 Sparse Graph Classes
Many important graph classes are sparse.
| Class | Sparsity source |
|---|---|
| Trees | Minimal connectivity |
| Planar graphs | Geometric constraints |
| Bounded-degree graphs | Local degree bounds |
| Minor-closed families | Structural restrictions |
| Geometric intersection graphs | Spatial constraints |
Sparse graph classes often admit specialized algorithms that are impossible in arbitrary dense graphs.
This is one reason sparse graph theory is central in modern algorithms.
54.18 Dense Subgraphs
Even sparse graphs may contain dense local regions.
For example, a social network may be globally sparse but contain tightly connected communities.
This leads to concepts such as:
| Concept | Meaning |
|---|---|
| Clique | Completely connected subgraph |
| Dense subgraph | Region with high edge concentration |
| Community | Strong internal connectivity |
| Core decomposition | Hierarchical dense regions |
Local density is often more important in applications than global density.
54.19 Common Mistakes
A common mistake is to identify sparsity with disconnectedness. Sparse graphs may still be highly connected.
Another mistake is to assume that dense graphs are always difficult to separate. Some dense graphs contain clear bottlenecks.
A third mistake is to confuse bounded degree with bounded density. One high-degree vertex does not make a graph dense.
A fourth mistake is to assume that sparse graphs are algorithmically trivial. Sparse graphs may still have complex global structure.
54.20 Summary
Sparse and dense graphs represent two broad structural regimes.
| Concept | Meaning |
|---|---|
| Sparse graph | Usually |
| Dense graph | Usually |
| Average degree | |
| Sparse matrix | Adjacency matrix with mostly zero entries |
| Dense matrix | Adjacency matrix with many nonzero entries |
| Degeneracy | Local sparsity measure |
| Arboricity | Forest decomposition measure |
Sparsity and density influence connectivity, algorithms, matrix structure, random walks, expansion, and asymptotic graph behavior. They form one of the most basic distinctions in graph theory.