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
where is a set of vertices and is a set of hyperedges. Each hyperedge is a subset of :
Thus
where denotes the power set of .
Many authors exclude the empty set as a hyperedge. Under that convention,
for every
Unless stated otherwise, this chapter assumes that hyperedges are nonempty subsets of .
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 -uniform hypergraph.
24.2 First Example
Let
Define
Then
is a hypergraph.
The hyperedge
joins three vertices. The hyperedge
joins two vertices. The hyperedge
contains one vertex.
This example cannot be represented faithfully as an ordinary graph without adding extra conventions, because the relation among is one three-way relation, not merely three pairwise edges.
24.3 Hyperedges
A hyperedge is a subset of the vertex set.
If
then is incident with each of the vertices
The number of vertices in a hyperedge is its cardinality:
A hyperedge of cardinality is sometimes called a loop or singleton edge. A hyperedge of cardinality behaves like an ordinary graph edge. A hyperedge of cardinality greater than represents a genuine higher-order relation.
For example,
is a hyperedge of size . 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:
A hypergraph is -uniform if every hyperedge has exactly vertices:
for every
Thus an ordinary graph is a -uniform hypergraph. A -uniform hypergraph has only hyperedges of size .
For example, if
then is -uniform.
If
then has rank , 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 , define
For example, let
Then belongs to three hyperedges:
Therefore
A hypergraph is -regular if every vertex has degree .
24.6 Incidence
Incidence is the basic relation between vertices and hyperedges.
A vertex is incident with a hyperedge if
This relation may be represented by an incidence matrix.
Let
and
The incidence matrix of is the matrix defined by
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
and
where
Using the vertex order , the incidence matrix is
The first column has three ’s because contains . The second column has two ’s because contains . The third column has two ’s because contains .
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:
and
A vertex is connected to a hyperedge-node when
Thus each incidence relation becomes an ordinary graph edge.
For example, if
then the incidence graph contains edges
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 -section, also called the primal graph.
The -section graph has the same vertex set . Two distinct vertices and are adjacent if they occur together in some hyperedge:
Thus each hyperedge becomes a clique in the -section graph.
For example, the hyperedge
creates ordinary graph edges
The -section is useful when pairwise co-occurrence is enough. It loses information, however. The single hyperedge and the three hyperedges have the same -section, but they describe different hypergraphs.
24.10 Dual Hypergraph
The dual of a hypergraph interchanges the roles of vertices and hyperedges.
Let
The dual hypergraph
has one vertex for each hyperedge of . For each original vertex , the dual has a hyperedge consisting of all original hyperedges that contain .
More concretely, if
then the vertices of are
For each
define
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 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
The number 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 is monochromatic. That is, every hyperedge with at least two vertices must contain at least two colors.
A hypergraph is -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 , 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
is a matching if
for all distinct
A vertex cover is a set of vertices that meets every hyperedge.
Thus
is a vertex cover if
for every
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
where each consecutive pair of vertices lies in the corresponding hyperedge:
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
where
is the tail set and
is the head set.
This can model rules with multiple inputs and multiple outputs. For example,
may mean that and together imply, produce, or enable and .
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.
| Application | Vertices | Hyperedges |
|---|---|---|
| Databases | attributes or records | multi-attribute relations |
| Transactions | items | baskets of items |
| Collaboration networks | people | teams or papers |
| Chemistry | atoms or compounds | reactions or molecular groups |
| Machine learning | data points | higher-order similarity groups |
| Information retrieval | terms or documents | documents or term sets |
| Circuit design | components | nets connecting several pins |
| Logic | propositions | clauses |
| Scheduling | tasks | shared resource constraints |
| Biology | genes or proteins | pathways 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.
| Structure | Edge type | Relation represented |
|---|---|---|
| Graph | pair of vertices | binary relation |
| Directed graph | ordered pair of vertices | directed binary relation |
| Hypergraph | subset of vertices | higher-order relation |
| Directed hypergraph | pair of vertex subsets | directed 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
means one ternary relation. The clique on 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 -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
where is a set of vertices and is a collection of nonempty subsets of . The elements of are hyperedges.
Hypergraphs generalize graphs by allowing edges to contain any number of vertices. A graph is a -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.