Skip to content

Chapter 54. Sparse and Dense Graphs

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

G=(V,E) G=(V,E)

be a simple undirected graph with

V=n |V|=n

vertices and

E=m |E|=m

edges.

Since every edge joins two distinct vertices, the maximum possible number of edges is

(n2)=n(n1)2. \binom{n}{2} = \frac{n(n-1)}{2}.

This maximum occurs precisely for the complete graph

Kn. K_n.

Thus every simple graph satisfies

0mn(n1)2. 0\le m\le \frac{n(n-1)}{2}.

The quantity mm 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

m=O(n). m=O(n).

This means the number of edges grows at most linearly with the number of vertices.

Typical sparse graphs include:

GraphNumber of edges
Treen1n-1
Pathn1n-1
Cyclenn
Bounded-degree graphO(n)O(n)
Planar graphO(n)O(n)

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

m=Θ(n2). m=\Theta(n^2).

This means the graph contains a constant fraction of all possible edges.

Examples include:

GraphNumber of edges
Complete graph KnK_nn(n1)2\frac{n(n-1)}{2}
Complete bipartite graph Kn,nK_{n,n}n2n^2
Random graph G(n,p)G(n,p) with constant ppApproximately pn2/2pn^2/2

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 22 to the degree sum,

vVdeg(v)=2m. \sum_{v\in V}\deg(v)=2m.

Therefore the average degree is

1nvVdeg(v)=2mn. \frac{1}{n}\sum_{v\in V}\deg(v) = \frac{2m}{n}.

This quantity is often denoted by

dˉ. \bar d.

A graph family is sparse precisely when the average degree remains bounded:

dˉ=O(1). \bar d=O(1).

Dense graphs have average degree growing linearly with nn.

For example:

GraphAverage degree
TreeApproximately 22
Cycle22
dd-regular graphdd
Complete graph KnK_nn1n-1

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

δ(G) \delta(G)

denote the minimum degree, and let

Δ(G) \Delta(G)

denote the maximum degree.

If Δ(G)\Delta(G) is bounded independently of nn, then the graph is sparse because

mnΔ(G)2. m\le \frac{n\Delta(G)}{2}.

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

n1, n-1,

yet it contains only

n1 n-1

edges and is therefore sparse.

54.6 Trees as Minimal Connected Graphs

Trees are the sparsest connected graphs.

A connected graph with nn vertices must contain at least

n1 n-1

edges. Trees achieve this minimum exactly.

Thus:

PropertyMeaning
Connected graphAt least n1n-1 edges
TreeExactly n1n-1 edges
Sparse connected graphClose 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

Kn K_n

contains every possible edge:

m=n(n1)2. m=\frac{n(n-1)}{2}.

Every vertex has degree

n1. n-1.

Complete graphs maximize many graph parameters:

ParameterValue in KnK_n
Connectivityn1n-1
Edge connectivityn1n-1
Diameter11
Chromatic numbernn
Clique numbernn

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

n3 n\ge3

satisfies

m3n6. m\le 3n-6.

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:

PropertyConsequence
Linear number of edgesEfficient storage
Small separatorsRecursive decomposition
Bounded average degreeLocal structure
Geometric constraintsSpecialized 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

G(n,p), G(n,p),

each possible edge appears independently with probability pp.

The expected number of edges is

E[m]=p(n2). \mathbb E[m] = p\binom{n}{2}.

If

p=cn, p=\frac{c}{n},

for constant cc, then

E[m]=Θ(n), \mathbb E[m]=\Theta(n),

so the graph is sparse.

If pp is a fixed positive constant, then

E[m]=Θ(n2), \mathbb E[m]=\Theta(n^2),

so the graph is dense.

Thus changing pp 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 nn vertices is an

n×n n\times n

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 typeGraph type
Sparse matrixSparse graph
Dense matrixDense 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

Θ(n2) \Theta(n^2)

space if represented by an adjacency matrix.

A sparse graph can often be stored using adjacency lists with only

Θ(n+m) \Theta(n+m)

space.

Traversal

Breadth-first search and depth-first search run in

O(n+m) O(n+m)

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:

ConstraintMaximum possible edges
No triangleTurán’s theorem
No cycle of given lengthExtremal cycle theory
No complete bipartite subgraphZarankiewicz 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 kk-degenerate if every subgraph contains a vertex of degree at most kk.

Degeneracy measures a refined form of sparsity.

Examples:

Graph familyDegeneracy
Forests11
Outerplanar graphs22
Planar graphsAt most 55

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:

GraphArboricity
Forest11
Planar graphAt most 33
Complete graph KnK_nApproximately n/2n/2

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 typeStructural behavior
TreeFragile
GridGeometric
ExpanderHighly connected
Random sparse graphProbabilistic 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:

m(n2). \frac{m}{\binom{n}{2}}.

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.

ClassSparsity source
TreesMinimal connectivity
Planar graphsGeometric constraints
Bounded-degree graphsLocal degree bounds
Minor-closed familiesStructural restrictions
Geometric intersection graphsSpatial 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:

ConceptMeaning
CliqueCompletely connected subgraph
Dense subgraphRegion with high edge concentration
CommunityStrong internal connectivity
Core decompositionHierarchical 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.

ConceptMeaning
Sparse graphUsually m=O(n)m=O(n)
Dense graphUsually m=Θ(n2)m=\Theta(n^2)
Average degree2m/n2m/n
Sparse matrixAdjacency matrix with mostly zero entries
Dense matrixAdjacency matrix with many nonzero entries
DegeneracyLocal sparsity measure
ArboricityForest 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.