Skip to content

Chapter 24. Hypergraphs

A hypergraph is a generalization of a graph in which an edge may join any number of vertices. In an ordinary graph, each edge joins two vertices. In a hypergraph, an edge may contain one vertex, two vertices, three vertices, or more. Such an edge is called a hyperedge.

Hypergraphs are useful when relations involve groups rather than pairs. A committee contains several members. A database record may relate several fields. A chemical reaction may involve several compounds. A document may contain many terms. A transaction may contain many items. These are not naturally binary relations. They are relations among sets of objects.

24.1 Definition

A hypergraph is an ordered pair

H=(V,E), H = (V,E),

where VV is a set of vertices and EE is a set of hyperedges. Each hyperedge is a subset of VV:

eV. e \subseteq V.

Thus

EP(V), E \subseteq \mathcal{P}(V),

where P(V)\mathcal{P}(V) denotes the power set of VV.

Many authors exclude the empty set as a hyperedge. Under that convention,

e e \neq \varnothing

for every

eE. e \in E.

Unless stated otherwise, this chapter assumes that hyperedges are nonempty subsets of VV.

An ordinary undirected graph is a special case of a hypergraph in which every edge contains exactly two vertices. In this sense, a graph is a 22-uniform hypergraph.

24.2 First Example

Let

V={a,b,c,d,e}. V = \{a,b,c,d,e\}.

Define

E={{a,b,c},{b,d},{a,d,e},{c}}. E = \{ \{a,b,c\}, \{b,d\}, \{a,d,e\}, \{c\} \}.

Then

H=(V,E) H=(V,E)

is a hypergraph.

The hyperedge

{a,b,c} \{a,b,c\}

joins three vertices. The hyperedge

{b,d} \{b,d\}

joins two vertices. The hyperedge

{c} \{c\}

contains one vertex.

This example cannot be represented faithfully as an ordinary graph without adding extra conventions, because the relation among a,b,ca,b,c is one three-way relation, not merely three pairwise edges.

24.3 Hyperedges

A hyperedge is a subset of the vertex set.

If

e={v1,v2,,vk}, e = \{v_1,v_2,\ldots,v_k\},

then ee is incident with each of the vertices

v1,v2,,vk. v_1,v_2,\ldots,v_k.

The number of vertices in a hyperedge is its cardinality:

e. |e|.

A hyperedge of cardinality 11 is sometimes called a loop or singleton edge. A hyperedge of cardinality 22 behaves like an ordinary graph edge. A hyperedge of cardinality greater than 22 represents a genuine higher-order relation.

For example,

{u,v,w,x} \{u,v,w,x\}

is a hyperedge of size 44. It records one relation involving all four vertices.

24.4 Rank and Uniformity

The rank of a hypergraph is the maximum size of its hyperedges:

r(H)=maxeEe. r(H) = \max_{e \in E} |e|.

A hypergraph is kk-uniform if every hyperedge has exactly kk vertices:

e=k |e| = k

for every

eE. e \in E.

Thus an ordinary graph is a 22-uniform hypergraph. A 33-uniform hypergraph has only hyperedges of size 33.

For example, if

E={{a,b,c},{a,d,e},{b,c,e}}, E = \{ \{a,b,c\}, \{a,d,e\}, \{b,c,e\} \},

then HH is 33-uniform.

If

E={{a,b},{b,c,d},{a,d,e,f}}, E = \{ \{a,b\}, \{b,c,d\}, \{a,d,e,f\} \},

then HH has rank 44, but it is not uniform.

Uniform hypergraphs are important in extremal combinatorics because they fix the size of each relation.

24.5 Degree of a Vertex

The degree of a vertex in a hypergraph counts the number of hyperedges that contain it.

For a vertex vVv \in V, define

deg(v)={eE:ve}. \deg(v) = |\{e \in E : v \in e\}|.

For example, let

E={{a,b,c},{a,d},{a,c,e},{b,e}}. E = \{ \{a,b,c\}, \{a,d\}, \{a,c,e\}, \{b,e\} \}.

Then aa belongs to three hyperedges:

{a,b,c},{a,d},{a,c,e}. \{a,b,c\},\qquad \{a,d\},\qquad \{a,c,e\}.

Therefore

deg(a)=3. \deg(a)=3.

A hypergraph is dd-regular if every vertex has degree dd.

24.6 Incidence

Incidence is the basic relation between vertices and hyperedges.

A vertex vv is incident with a hyperedge ee if

ve. v \in e.

This relation may be represented by an incidence matrix.

Let

V={v1,,vn} V=\{v_1,\ldots,v_n\}

and

E={e1,,em}. E=\{e_1,\ldots,e_m\}.

The incidence matrix of HH is the n×mn \times m matrix BB defined by

Bij={1,if viej,0,otherwise. B_{ij} = \begin{cases} 1, & \text{if } v_i \in e_j, \\ 0, & \text{otherwise}. \end{cases}

Rows correspond to vertices. Columns correspond to hyperedges.

For ordinary graphs, each column of the incidence matrix usually has two nonzero entries. For hypergraphs, a column may have any positive number of nonzero entries.

24.7 Example of an Incidence Matrix

Let

V={a,b,c,d} V = \{a,b,c,d\}

and

E={e1,e2,e3}, E = \{e_1,e_2,e_3\},

where

e1={a,b,c},e2={b,d},e3={a,d}. e_1=\{a,b,c\}, \qquad e_2=\{b,d\}, \qquad e_3=\{a,d\}.

Using the vertex order a,b,c,da,b,c,d, the incidence matrix is

B=[101110100011]. B = \begin{bmatrix} 1 & 0 & 1 \\ 1 & 1 & 0 \\ 1 & 0 & 0 \\ 0 & 1 & 1 \end{bmatrix}.

The first column has three 11’s because e1e_1 contains a,b,ca,b,c. The second column has two 11’s because e2e_2 contains b,db,d. The third column has two 11’s because e3e_3 contains a,da,d.

The row sum gives the degree of the corresponding vertex. The column sum gives the size of the corresponding hyperedge.

24.8 Hypergraphs and Bipartite Incidence Graphs

Every hypergraph has an associated bipartite graph called its incidence graph.

The incidence graph has two kinds of vertices:

V V

and

E. E.

A vertex vVv \in V is connected to a hyperedge-node eEe \in E when

ve. v \in e.

Thus each incidence relation becomes an ordinary graph edge.

For example, if

e={a,b,c}, e=\{a,b,c\},

then the incidence graph contains edges

ae,be,ce. a-e,\qquad b-e,\qquad c-e.

The incidence graph converts a hypergraph into an ordinary bipartite graph while preserving which vertices belong to which hyperedges.

This representation is useful for algorithms, visualization, and matrix methods. It also makes clear that a hypergraph is fundamentally a vertex-edge incidence structure.

24.9 The 2-Section Graph

Another way to associate an ordinary graph to a hypergraph is the 22-section, also called the primal graph.

The 22-section graph has the same vertex set VV. Two distinct vertices uu and vv are adjacent if they occur together in some hyperedge:

eEsuch thatu,ve. \exists e \in E \quad \text{such that} \quad u,v \in e.

Thus each hyperedge becomes a clique in the 22-section graph.

For example, the hyperedge

{a,b,c} \{a,b,c\}

creates ordinary graph edges

{a,b},{a,c},{b,c}. \{a,b\},\qquad \{a,c\},\qquad \{b,c\}.

The 22-section is useful when pairwise co-occurrence is enough. It loses information, however. The single hyperedge {a,b,c}\{a,b,c\} and the three hyperedges {a,b},{a,c},{b,c}\{a,b\}, \{a,c\}, \{b,c\} have the same 22-section, but they describe different hypergraphs.

24.10 Dual Hypergraph

The dual of a hypergraph interchanges the roles of vertices and hyperedges.

Let

H=(V,E). H=(V,E).

The dual hypergraph

H H^*

has one vertex for each hyperedge of HH. For each original vertex vVv \in V, the dual has a hyperedge consisting of all original hyperedges that contain vv.

More concretely, if

E={e1,,em}, E = \{e_1,\ldots,e_m\},

then the vertices of HH^* are

e1,,em. e_1,\ldots,e_m.

For each

vV, v \in V,

define

ev={eiE:vei}. e_v^* = \{e_i \in E : v \in e_i\}.

The collection of these sets forms the hyperedges of the dual.

Duality is useful because many statements about vertices have corresponding statements about hyperedges. In matrix terms, taking the dual corresponds to transposing the incidence matrix.

24.11 Simple Hypergraphs and Repeated Hyperedges

A hypergraph is simple if it has no repeated hyperedges and usually no hyperedge contained in another, depending on convention.

The most common minimal condition for simplicity is that no hyperedge is repeated. Some authors also call a hypergraph reduced if no hyperedge is a strict subset of another hyperedge.

If repeated hyperedges are allowed, the edge collection EE should be treated as a multiset. This is useful when the same group relation occurs more than once.

For example, in transaction data, the same item set may appear in many transactions. One may either keep repeated hyperedges or store one hyperedge with a multiplicity.

The choice depends on whether repeated occurrence carries information.

24.12 Weighted Hypergraphs

A weighted hypergraph assigns weights to hyperedges, vertices, or both.

For hyperedge weights, one writes

w:ER. w:E\to \mathbb{R}.

The number w(e)w(e) may represent cost, capacity, frequency, strength, probability, or importance.

For example, if a hyperedge represents a transaction, its weight may be the number of times that exact transaction appears. If a hyperedge represents a collaboration team, its weight may measure the strength or duration of collaboration.

Weighted hypergraphs are important in clustering, machine learning, information retrieval, and network analysis.

24.13 Hypergraph Coloring

A coloring of a hypergraph assigns colors to vertices.

One common coloring problem asks for a coloring such that no hyperedge of size at least 22 is monochromatic. That is, every hyperedge with at least two vertices must contain at least two colors.

A hypergraph is 22-colorable if its vertices can be split into two color classes so that no nontrivial hyperedge lies entirely in one class. This property is also known as Property B.

Hypergraph coloring generalizes graph coloring, but it behaves differently. In graph coloring, every edge has size 22, so an edge is properly colored exactly when its two endpoints receive different colors. In a hypergraph, a hyperedge with many vertices only needs to avoid being entirely one color under this weak coloring rule.

Other stronger coloring conventions are also used.

24.14 Matchings and Covers

A matching in a hypergraph is a set of pairwise disjoint hyperedges.

Thus

ME M \subseteq E

is a matching if

ef= e \cap f = \varnothing

for all distinct

e,fM. e,f \in M.

A vertex cover is a set of vertices that meets every hyperedge.

Thus

CV C \subseteq V

is a vertex cover if

Ce C \cap e \neq \varnothing

for every

eE. e \in E.

These definitions generalize ordinary graph matching and vertex cover. They are central in combinatorics and optimization.

In hypergraphs, matching and covering problems are often harder than their graph counterparts because each hyperedge may involve many vertices.

24.15 Hypergraph Cycles

Cycles in hypergraphs are subtler than cycles in ordinary graphs.

In a graph, there is one standard notion of a cycle. In a hypergraph, several definitions are useful. One common definition is the Berge cycle.

A Berge cycle is an alternating sequence of distinct vertices and distinct hyperedges

v1,e1,v2,e2,,vk,ek,v1, v_1,e_1,v_2,e_2,\ldots,v_k,e_k,v_1,

where each consecutive pair of vertices lies in the corresponding hyperedge:

vi,vi+1ei, v_i, v_{i+1} \in e_i,

with indices taken cyclically.

Other notions, such as tight cycles, are used especially for uniform hypergraphs. The correct definition depends on the theorem or application.

24.16 Directed Hypergraphs

A directed hypergraph generalizes a directed graph by allowing an arc to have a set of tails and a set of heads.

A directed hyperedge may be written as

(T,H), (T,H),

where

TV T \subseteq V

is the tail set and

HV H \subseteq V

is the head set.

This can model rules with multiple inputs and multiple outputs. For example,

{a,b}{c,d} \{a,b\} \to \{c,d\}

may mean that aa and bb together imply, produce, or enable cc and dd.

Directed hypergraphs appear in logic, databases, reaction networks, workflow systems, and program analysis. The standard definition generalizes directed graph arcs by replacing the single tail and single head with sets of vertices.

24.17 Applications

Hypergraphs appear when relations are higher-order rather than pairwise.

ApplicationVerticesHyperedges
Databasesattributes or recordsmulti-attribute relations
Transactionsitemsbaskets of items
Collaboration networkspeopleteams or papers
Chemistryatoms or compoundsreactions or molecular groups
Machine learningdata pointshigher-order similarity groups
Information retrievalterms or documentsdocuments or term sets
Circuit designcomponentsnets connecting several pins
Logicpropositionsclauses
Schedulingtasksshared resource constraints
Biologygenes or proteinspathways or complexes

In each case, replacing a hyperedge by all pairwise edges may lose meaning. A group relation is not always the same as a collection of pairwise relations.

24.18 Hypergraphs Versus Graphs

A graph records binary relations. A hypergraph records set-valued relations.

StructureEdge typeRelation represented
Graphpair of verticesbinary relation
Directed graphordered pair of verticesdirected binary relation
Hypergraphsubset of verticeshigher-order relation
Directed hypergraphpair of vertex subsetsdirected higher-order relation

The choice depends on the model. If every relation is naturally between two objects, a graph is appropriate. If one relation may involve many objects at once, a hypergraph is often more faithful.

24.19 Common Mistakes

A common mistake is to replace every hyperedge by a clique without considering information loss. The hyperedge

{a,b,c} \{a,b,c\}

means one ternary relation. The clique on a,b,ca,b,c means three binary relations. These are different structures.

Another mistake is to assume that every graph theorem extends directly to hypergraphs. Many graph concepts have several non-equivalent hypergraph analogues.

A third mistake is to ignore uniformity. Results for kk-uniform hypergraphs may fail when hyperedges have varying sizes.

A fourth mistake is to confuse degree with hyperedge size. The degree of a vertex counts how many hyperedges contain it. The size of a hyperedge counts how many vertices it contains.

24.20 Summary

A hypergraph is a pair

H=(V,E), H=(V,E),

where VV is a set of vertices and EE is a collection of nonempty subsets of VV. The elements of EE are hyperedges.

Hypergraphs generalize graphs by allowing edges to contain any number of vertices. A graph is a 22-uniform hypergraph. The main quantities are hyperedge size, rank, vertex degree, incidence, uniformity, and duality.

Hypergraphs are the natural language for higher-order relations. They appear in combinatorics, databases, optimization, circuit design, chemistry, machine learning, logic, and network science.