In mathematics, a hypergraph is a generalization of a graph in which an edge can join any number of vertices. In contrast, in an ordinary graph, an edge connects exactly two vertices. Formally, a directed hypergraph is a pair ( X , E ) {\displaystyle (X,E)} , where X {\displaystyle X} is a set of elements called nodes, vertices, points, or elements and E {\displaystyle E} is a set of pairs of subsets of X {\displaystyle X} . Each of these pairs ( D , C ) ∈ E {\displaystyle (D,C)\in E} is called an edge or hyperedge; the vertex subset D {\displaystyle D} is known as its tail or domain, and C {\displaystyle C} as its head or codomain. The order of a hypergraph ( X , E ) {\displaystyle (X,E)} is the number of vertices in X {\displaystyle X} . The size of the hypergraph is the number of edges in E {\displaystyle E} . The order of an edge e = ( D , C ) {\displaystyle e=(D,C)} in a directed hypergraph is | e | = ( | D | , | C | ) {\displaystyle |e|=(|D|,|C|)} : that is, the number of vertices in its tail followed by the number of vertices in its head. The definition above generalizes from a directed graph to a directed hypergraph by defining the head or tail of each edge as a set of vertices ( C ⊆ X {\displaystyle C\subseteq X} or D ⊆ X {\displaystyle D\subseteq X} ) rather than as a single vertex. A graph is then the special case where each of these sets contains only one element. Hence any standard graph theoretic concept that is independent of the edge orders | e | {\displaystyle |e|} will generalize to hypergraph theory. Given a set
X {\displaystyle {X}}
with its power set
P ( X ) {\displaystyle {{\mathcal {P}}\left(X\right)}} , furthermore a set
E {\displaystyle {E}}
with
E ⊆ P ( X ) {\displaystyle {E\subseteq {\mathcal {P}}\left(X\right)}} , the pair
( X , E ) {\displaystyle {\left(X,E\right)}}
shall be called an undirected hypergraph. Hypergraphs can be viewed as incidence structures. In particular, there is a bipartite "incidence graph" or "Levi graph" corresponding to every hypergraph, and conversely, every bipartite graph can be regarded as the incidence graph of a hypergraph when it is 2-colored and it is indicated which color class corresponds to hypergraph vertices and which to hypergraph edges. Hypergraphs have many other names. In computational geometry, an undirected hypergraph may sometimes be called a range space and then the hyperedges are called ranges. In cooperative game theory, hypergraphs are called simple games (voting games); this notion is applied to solve problems in social choice theory. In some literature edges are referred to as hyperlinks or connectors. The collection of hypergraphs is a category with hypergraph homomorphisms as morphisms.
Applications Undirected hypergraphs are useful in modelling such things as satisfiability problems, databases, machine learning, and Steiner tree problems. They have been extensively used in machine learning tasks as the data model and classifier regularization. The applications include recommender system (communities as hyperedges), image retrieval (correlations as hyperedges), and bioinformatics (biochemical interactions as hyperedges). Representative hypergraph learning techniques include hypergraph spectral clustering that extends the spectral graph theory with hypergraph Laplacian, and hypergraph semi-supervised learning that introduces extra hypergraph structural cost to restrict the learning results. For large scale hypergraphs, a distributed framework built using Apache Spark is also available. It can be desirable to study hypergraphs where all hyperedges have the same cardinality; a k-uniform hypergraph is a hypergraph such that all its hyperedges have size k. (In other words, one such hypergraph is a collection of sets, each such set a hyperedge connecting k nodes.) So a 2-uniform hypergraph is a graph, a 3-uniform hypergraph is a collection of unordered triples, and so on. Directed hypergraphs can be used to model things including telephony applications, detecting money laundering, operations research, and transportation planning. They can also be used to model Horn-satisfiability.
Generalizations of concepts from graphs Many theorems and concepts involving graphs also hold for hypergraphs, in particular:
Matching in hypergraphs; Vertex cover in hypergraphs (also known as: transversal); Line graph of a hypergraph; Hypergraph grammar - created by augmenting a class of hypergraphs with a set of replacement rules; Ramsey's theorem; Erdős–Ko–Rado theorem; Kruskal–Katona theorem on uniform hypergraphs; Hall-type theorems for hypergraphs. In directed hypergraphs: transitive closure, and shortest path problems.
Hypergraph drawing
Although hypergraphs are more difficult to draw on paper than graphs, several researchers have studied methods for the visualization of hypergraphs. In one possible visual representation for hypergraphs, similar to the standard graph drawing style in which curves in the plane are used to depict graph edges, a hypergraph's vertices are depicted as points, disks, or boxes, and its hyperedges are depicted as trees that have the vertices as their leaves. If the vertices are represented as points, the hyperedges may also be shown as smooth curves that connect sets of points, or as simple closed curves that enclose sets of points.
In another style of hypergraph visualization, the subdivision model of hypergraph drawing, the plane is subdivided into regions, each of which represents a single vertex of the hypergraph. The hyperedges of the hypergraph are represented by contiguous subsets of these regions, which may be indicated by coloring, by drawing outlines around them, or both. An order-n Venn diagram, for instance, may be viewed as a subdivision drawing of a hypergraph with n hyperedges (the curves defining the diagram) and 2n − 1 vertices (represented by the regions into which these curves subdivide the plane). In contrast with the polynomial-time recognition of planar graphs, it is NP-complete to determine whether a hypergraph has a planar subdivision drawing, but the existence of a drawing of this type may be tested efficiently when the adjacency pattern of the regions is constrained to be a path, cycle, or tree. An alternative representation of the hypergraph called PAOH is shown in the figure on top of this article. Edges are vertical lines connecting vertices. Vertices are aligned on the left. The legend on the right shows the names of the edges. It has been designed for dynamic hypergraphs but can be used for simple hypergraphs as well.
Hypergraph coloring Classic hypergraph coloring is assigning one of the colors from set { 1 , 2 , 3 , . . . , λ } {\displaystyle \{1,2,3,...,\lambda \}} to every vertex of a hypergraph in such a way that each hyperedge contains at least two vertices of distinct colors. In other words, there must be no monochromatic hyperedge with cardinality at least 2. In this sense it is a direct generalization of graph coloring. The minimum number of used distinct colors over all colorings is called the chromatic number of a hypergraph. Hypergraphs for which there exists a coloring using up to k colors are referred to as k-colorable. The 2-colorable hypergraphs are exactly the bipartite ones. There are many generalizations of classic hypergraph coloring. One of them is the so-called mixed hypergraph coloring, when monochromatic edges are allowed. Some mixed hypergraphs are uncolorable for any number of colors. A general criterion for uncolorability is unknown. When a mixed hypergraph is colorable, then the minimum and maximum number of used colors are called the lower and upper chromatic numbers respectively.
Properties of hypergraphs A hypergraph can have various properties, such as:
Empty - has no edges. Non-simple (or multiple) - has loops (hyperedges with a single vertex) or repeated edges, which means there can be two or more edges containing the same set of vertices. Simple - has no loops and no repeated edges.
d {\displaystyle d} -regular - every vertex has degree d {\displaystyle d} , i.e., contained in exactly d {\displaystyle d} hyperedges. 2-colorable - its vertices can be partitioned into two classes U and V in such a way that each hyperedge with cardinality at least 2 contains at least one vertex from both classes. An alternative term is Property B. Two stronger properties are bipartite and balanced.
k {\displaystyle k} -uniform - each hyperedge contains precisely k {\displaystyle k} vertices.
k {\displaystyle k} -partite - the vertices are partitioned into k {\displaystyle k} parts, and each hyperedge contains precisely one vertex of each type. Every k {\displaystyle k} -partite hypergraph (for k ≥ 2 {\displaystyle k\geq 2} ) is both k {\displaystyle k} -uniform and bipartite (and 2-colorable). Reduced: no hyperedge is a strict subset of another hyperedge; equivalently, every hyperedge is maximal for inclusion. The reduction of a hypergraph is the reduced hypergraph obtained by removing every hyperedge which is included in another hyperedge. Downward-closed - every subset of an undirected hypergraph's edges is a hyperedge too. A downward-closed hypergraph is usually called an abstract simplicial complex. It is generally not reduced, unless all hyperedges have cardinality 1. An abstract simplicial complex with the augmentation property is called a matroid. Laminar: for any two hyperedges, either they are disjoint, or one is included in the other. In other words, the set of hyperedges forms a laminar set family. Connected: for all S ⊆ X {\displaystyle S\subseteq X} with ∅ ≠ S ≠ X {\displaystyle \emptyset \neq S\neq X} there is e ∈ E {\displaystyle e\in E} that meets both S {\displaystyle S} and X ∖ S {\displaystyle X\setminus S} . A hypergraph that is not connected is called disconnected.
Related hypergraphs Because hypergraph links can have any cardinality, there are several notions of the concept of a subgraph, called subhypergraphs, partial hypergraphs and section hypergraphs. Let H = ( X , E ) {\displaystyle H=(X,E)} be the hypergraph consisting of vertices
X = { x i ∣ i ∈ I v } , {\displaystyle X=\lbrace x_{i}\mid i\in I_{v}\rbrace ,}
and having edge set
E = { e i ∣ i ∈ I e , e i ⊆ X , e i ≠ ∅ } , {\displaystyle E=\lbrace e_{i}\mid i\in I_{e},e_{i}\subseteq X,e_{i}\neq \emptyset \rbrace ,}
where I v {\displaystyle I_{v}} and I e {\displaystyle I_{e}} are the index sets of the vertices and edges respectively. A subhypergraph is a hypergraph with some vertices removed. Formally, the subhypergraph H A {\displaystyle H_{A}} induced by A ⊆ X {\displaystyle A\subseteq X} is defined as
H A = ( A , { e ∩ A ∣ e ∈ E , e ∩ A ≠ ∅ } ) . {\displaystyle H_{A}=\left(A,\lbrace e\cap A\mid e\in E,e\cap A\neq \emptyset \rbrace \right).}
An alternative term is the restriction of H to A. A connected component of H {\displaystyle H} is a maximal connected subhypergraph of H {\displaystyle H} , that is, a subhypergraph H A {\displaystyle H_{A}} of H {\displaystyle H} induced by A {\displaystyle A} such that H A {\displaystyle H_{A}} is connected and no subhypergraph H A ′ {\displaystyle H_{A'}} with A ⊊ A ′ {\displaystyle A\subsetneq A'} is connected. An extension of a subhypergraph is a hypergraph where each hyperedge of H {\displaystyle H} which is partially contained in the subhypergraph H A {\displaystyle H_{A}} is fully contained in the extension E x ( H A ) {\displaystyle Ex(H_{A})} . Formally
E x ( H A ) = ( A ∪ A ′ , E ′ ) {\displaystyle Ex(H_{A})=(A\cup A',E')} with A ′ = ⋃ e ∈ E e ∖ A {\displaystyle A'=\bigcup _{e\in E}e\setminus A} and E ′ = { e ∈ E ∣ e ⊆ ( A ∪ A ′ ) } {\displaystyle E'=\lbrace e\in E\mid e\subseteq (A\cup A')\rbrace } . The partial hypergraph is a hypergraph with some edges removed. Given a subset J ⊂ I e {\displaystyle J\subset I_{e}} of the edge index set, the partial hypergraph generated by J {\displaystyle J} is the hypergraph
( X , { e i ∣ i ∈ J } ) . {\displaystyle \left(X,\lbrace e_{i}\mid i\in J\rbrace \right).}
Given a subset A ⊆ X {\displaystyle A\subseteq X} , the section hypergraph is the partial hypergraph
H × A = ( A , { e i ∣ i ∈ I e , e i ⊆ A } ) . {\displaystyle H\times A=\left(A,\lbrace e_{i}\mid i\in I_{e},e_{i}\subseteq A\rbrace \right).}
The dual H ∗ {\displaystyle H^{*}} of H {\displaystyle H} is a hypergraph whose vertices and edges are interchanged, so that the vertices are given by { e i } {\displaystyle \lbrace e_{i}\rbrace } and whose edges are given by { X m } {\displaystyle \lbrace X_{m}\rbrace } where
X m = { e i ∣ x m ∈ e i } . {\displaystyle X_{m}=\lbrace e_{i}\mid x_{m}\in e_{i}\rbrace .}
When a notion of equality is properly defined, as done below, the operation of taking the dual of a hypergraph is an involution, i.e.,
( H ∗ ) ∗ = H . {\displaystyle \left(H^{*}\right)^{*}=H.}
A connected graph G with the same vertex set as a connected hypergraph H is a host graph for H if every hyperedge of H induces a connected subgraph in G. For a disconnected hypergraph H, G is a host graph if there is a bijection between the connected components of G and of H, such that each connected component G' of G is a host of the corresponding H'. The 2-section (or clique graph, representing graph, primal graph, Gaifman graph) of a hypergraph is the graph with the same vertices of the hypergraph, and edges between all pairs of vertices contained in the same hyperedge.
Incidence matrix Let V = { v 1 , v 2 , … , v n } {\displaystyle V=\{v_{1},v_{2},~\ldots ,~v_{n}\}} and E = { e 1 , e 2 , … e m } {\displaystyle E=\{e_{1},e_{2},~\ldots ~e_{m}\}} . Every hypergraph has an n × m {\displaystyle n\times m} incidence matrix. For an undirected hypergraph, I = ( b i j ) {\displaystyle I=(b_{ij})} where
b i j = { 1 i f v i ∈ e j 0 o t h e r w i s e . {\displaystyle b_{ij}=\left\{{\begin{matrix}1&\mathrm {if} ~v_{i}\in e_{j}\\0&\mathrm {otherwise} .\end{matrix}}\right.}
The transpose I t {\displaystyle I^{t}} of the incidence matrix defines a hypergraph H ∗ = ( V ∗ , E ∗ ) {\displaystyle H^{*}=(V^{*},\ E^{*})} called the dual of H {\displaystyle H} , where V ∗ {\displaystyle V^{*}} is an m-element set and E ∗ {\displaystyle E^{*}} is an n-element set of subsets of V ∗ {\displaystyle V^{*}} . For v j ∗ ∈ V ∗ {\displaystyle v_{j}^{*}\in V^{*}} and e i ∗ ∈ E ∗ , v j ∗ ∈ e i ∗ {\displaystyle e_{i}^{*}\in E^{*},~v_{j}^{*}\in e_{i}^{*}} if and only if b i j = 1 {\displaystyle b_{ij}=1} . For a directed hypergraph, the heads and tails of each hyperedge e j {\displaystyle e_{j}} are denoted by H ( e j ) {\displaystyle H(e_{j})} and T ( e j ) {\displaystyle T(e_{j})} respectively. I = ( b i j ) {\displaystyle I=(b_{ij})} where
b i j = { − 1 i f v i ∈ T ( e j ) 1 i f v i ∈ H ( e j ) 0 o t h e r w i s e . {\displaystyle b_{ij}=\left\{{\begin{matrix}-1&\mathrm {if} ~v_{i}\in T(e_{j})\\1&\mathrm {if} ~v_{i}\in H(e_{j})\\0&\mathrm {otherwise} .\end{matrix}}\right.}
Incidence graph A hypergraph H may be represented by a bipartite graph BG as follows: the sets X and E are the parts of BG, and (x1, e1) are connected with an edge if and only if vertex x1 is contained in edge e1 in H. Conversely, any bipartite graph with fixed parts and no unconnected nodes in the second part represents some hypergraph in the manner described above. This bipartite graph is also called incidence graph.
Adjacency matrix A parallel for the adjacency matrix of a hypergraph can be drawn from the adjacency matrix of a graph. In the case of a graph, the adjacency matrix is a square matrix which indicates whether pairs of vertices are adjacent. Likewise, we can define the adjacency matrix A = ( a i j ) {\displaystyle A=(a_{ij})} for a hypergraph in general where the hyperedges e k ≤ m {\displaystyle e_{k\leq m}} have real weights w e k ∈ R {\displaystyle w_{e_{k}}\in \mathbb {R} } with
a i j = { w e k i f ( v i , v j ) ∈ E 0 o t h e r w i s e . {\displaystyle a_{ij}=\left\{{\begin{matrix}w_{e_{k}}&\mathrm {if} ~(v_{i},v_{j})\in E\\0&\mathrm {otherwise} .\end{matrix}}\right.}
Cycles In contrast with ordinary undirected graphs for which there is a single natural notion of cycles and acyclic graphs. For hypergraphs, there are multiple natural non-equivalent definitions of cycles which collapse to the ordinary notion of cycle when the graph case is considered.
Berge cycles A first notion of cycle was introduced by Claude Berge. A Berge cycle in a hypergraph is an alternating sequence of distinct vertices and edges ( v 1 , e 1 , … , v n , e n ) {\displaystyle (v_{1},e_{1},\dots ,v_{n},e_{n})} , where n ≥ 2 {\displaystyle n\geq 2} and v i , v i + 1 {\displaystyle v_{i},v_{i+1}} are both in e i {\displaystyle e_{i}} for each i ∈ [ n ] {\displaystyle i\in [n]} (with indices taken modulo n {\displaystyle n} ). Under this definition a hypergraph is acyclic if and only if its incidence graph (the bipartite graph defined above) is acyclic. Thus Berge-cyclicity can obviously be tested in linear time by an exploration of the incidence graph.
Tight cycles This definition is particularly used for k {\displaystyle k} -uniform hypergraphs, where all hyperedges are of size k {\displaystyle k} . A tight cycle of length n {\displaystyle n} in a hypergraph H {\displaystyle H} is a sequence of distinct vertices v 1 , … , v n {\displaystyle v_{1},\dots ,v_{n}} such that every consecutive k {\displaystyle k} -tuple { v i , … , v i + k − 1 } {\displaystyle \{v_{i},\dots ,v_{i+k-1}\}} (indices modulo n {\displaystyle n} ) forms a hyperedge in H {\displaystyle H} . This notion was introduced by Katona and Kierstead and has since garnered considerable attention, particularly in the study of Hamiltonicity in extremal combinatorics. Rödl, Szemerédi, and Ruciński showed that every n {\displaystyle n} -vertex k {\displaystyle k} -uniform hypergraph H {\displaystyle H} in which every ( k − 1 ) {\displaystyle (k-1)} -subset of vertices is contained in at least n / 2 + o ( n ) {\displaystyle n/2+o(n)} hyperedges contains a Hamilton cycle. This corresponds to an approximate hypergraph-extension of the celebrated Dirac's theorem about Hamilton cycles in graphs. The maximum number of hyperedges in a (tightly) acyclic k {\displaystyle k} -uniform hypergraph remains unknown. For k = 2 {\displaystyle k=2} , it is well known that this number is n − 1 {\displaystyle n-1} . For k ≥ 3 {\displaystyle k\geq 3} , the best known bounds, due to Janzer and Letzter, show that this maximum number is between Ω ( n k − 1 log n / log log n ) {\displaystyle \Omega (n^{k-1}\log n/\log \log n)} and O ( n k − 1 ( log n ) 5 ) {\displaystyle O(n^{k-1}(\log n)^{5})} . The bounds are optimal up to a poly-logarithmic factor. An l {\displaystyle l} -cycle generalizes the notion of a tight cycle. It consists in a sequence of vertices v 1 , … , v n {\displaystyle v_{1},\dots ,v_{n}} and hyperedges e 1 , … , e t {\displaystyle e_{1},\dots ,e_{t}} where each e i {\displaystyle e_{i}} consists of k {\displaystyle k} consecutive vertices in the sequence and | e i ∩ e i + 1 | = l {\displaystyle |e_{i}\cap e_{i+1}|=l} for every 1 ≤ i ≤ t {\displaystyle 1\leq i\leq t} . Since every edge of the l {\displaystyle l} -cycle contains exactly k − l {\displaystyle k-l} vertices which are not contained in the previous edge, n {\displaystyle n} must be divisible by k − l {\displaystyle k-l} . Note that l = k − 1 {\displaystyle l=k-1} recovers the definition of a tight cycle.
α-acyclicity The definition of Berge-acyclicity might seem to be very restrictive: for instance, if a hypergraph has some pair v ≠ v ′ {\displaystyle v\neq v'} of vertices and some pair f ≠ f ′ {\displaystyle f\neq f'} of hyperedges such that v , v ′ ∈ f {\displaystyle v,v'\in f} and v , v ′ ∈ f ′ {\displaystyle v,v'\in f'} , then it is Berge-cyclic. We can define a weaker notion of hypergraph acyclicity, later termed α-acyclicity. This notion of acyclicity is equivalent to the hypergraph being conformal (every clique of the primal graph is covered by some hyperedge) and its primal graph being chordal; it is also equivalent to reducibility to the empty graph through the GYO algorithm (also known as Graham's algorithm), a confluent iterative process which removes hyperedges using a generalized definition of ears. In the domain of database theory, it is known that a database schema enjoys certain desirable properties if its underlying hypergraph is α-acyclic. Besides, α-acyclicity is also related to the expressiveness of the guarded fragment of first-order logic. We can test in linear time if a hypergraph is α-acyclic. Note that α-acyclicity has the counter-intuitive property that adding hyperedges to an α-cyclic hypergraph may make it α-acyclic (for instance, adding a hyperedge containing all vertices of the hypergraph will always make it α-acyclic). Motivated in part by this perceived shortcoming, Ronald Fagin defined the stronger notions of β-acyclicity and γ-acyclicity. We can state β-acyclicity as the requirement that all subhypergraphs of the hypergraph are α-acyclic, which is equivalent to an ear
