Hypergraphs

 Augment the hyperedge set of an hypergraph

Parameters

 H - L -

Description

 • The command AddHyperedges(H,L) returns the hypergraph K whose vertex set is the union of the vertex set of H and all sets in L, and whose hyperedges consist of the hyperedges of H and the sets of L.
 • Therefore, if E denotes the hyperedge set of H, then H is the partial hypergraph of K induced by E.

Terminology

 • Hypergraph : mathematically, a hypergraph is a pair (X, Y) where X  is a finite set and Y is a set of non-empty subsets of X.
 • Vertices : the members of X are called the vertices of the hypergraph (X, Y).
 • Hyperedges : the members of Y are called the hyperedges (or simply edges) of  the hypergraph (X, Y).
 • Partial hypergraph : If H :=(X, Y) is a hypergraph and Z is a subset of Y, then (X, Z) is called the partial hypergraph of H induced by Z.
 • Subhypergraph :  If H :=(X, Y) is a hypergraph,  S is a subset of X and Z is the subset of Y consisting of the hyperedges of X contained in S, then (S, Z) is called the subhypergraph of H induced by S.

Examples

 > $\mathrm{with}\left(\mathrm{Hypergraphs}\right):$

Create a hypergraph from its vertices and edges.

 > $H≔\mathrm{Hypergraph}\left(\left[1,2,3,4,5,6,7\right],\left[\left\{1,2,3\right\},\left\{2,3\right\},\left\{4\right\},\left\{3,5,6\right\}\right]\right)$
 ${H}{≔}{\mathrm{< a hypergraph on 7 vertices with 4 hyperedges >}}$ (1)

Print its vertices and edges.

 > $\mathrm{Vertices}\left(H\right);$$\mathrm{Hyperedges}\left(H\right)$
 $\left[{1}{,}{2}{,}{3}{,}{4}{,}{5}{,}{6}{,}{7}\right]$
 $\left[\left\{{4}\right\}{,}\left\{{2}{,}{3}\right\}{,}\left\{{1}{,}{2}{,}{3}\right\}{,}\left\{{3}{,}{5}{,}{6}\right\}\right]$ (2)

Draw a graphical representation of this hypergraph.

 > $\mathrm{Draw}\left(H\right)$

Construct a new hypergraph from Hby adding a new vertex, namely 8.

 > $K≔\mathrm{AddVertices}\left(H,\left[8\right]\right)$
 ${K}{≔}{\mathrm{< a hypergraph on 8 vertices with 4 hyperedges >}}$ (3)

Print the vertices and edges of K.

 > $\mathrm{Vertices}\left(K\right);$$\mathrm{Hyperedges}\left(K\right)$
 $\left[{1}{,}{2}{,}{3}{,}{4}{,}{5}{,}{6}{,}{7}{,}{8}\right]$
 $\left[\left\{{4}\right\}{,}\left\{{2}{,}{3}\right\}{,}\left\{{1}{,}{2}{,}{3}\right\}{,}\left\{{3}{,}{5}{,}{6}\right\}\right]$ (4)

Draw a graphical representation of K.

 > $\mathrm{Draw}\left(K\right)$

Check whether {1,2,8} is a hyperedge of H.

 > $\mathrm{IsEdge}\left(H,\left\{1,2,8\right\}\right)$
 ${\mathrm{false}}$ (5)

Construct a new hypergraph from Hby adding {1,2,4} as an hyperedge.

 > $L≔\mathrm{AddHyperedges}\left(K,\left[\left\{1,2,8\right\}\right]\right)$
 ${L}{≔}{\mathrm{< a hypergraph on 8 vertices with 5 hyperedges >}}$ (6)

Print the vertices and edges of L.

 > $\mathrm{Vertices}\left(L\right);$$\mathrm{Hyperedges}\left(L\right)$
 $\left[{1}{,}{2}{,}{3}{,}{4}{,}{5}{,}{6}{,}{7}{,}{8}\right]$
 $\left[\left\{{4}\right\}{,}\left\{{2}{,}{3}\right\}{,}\left\{{1}{,}{2}{,}{3}\right\}{,}\left\{{3}{,}{5}{,}{6}\right\}{,}\left\{{1}{,}{2}{,}{8}\right\}\right]$ (7)

Draw a graphical representation of L.

 > $\mathrm{Draw}\left(L\right)$

References

 Claude Berge. Hypergraphes. Combinatoires des ensembles finis. 1987,  Paris, Gauthier-Villars, translated to English.
 Claude Berge. Hypergraphs. Combinatorics of Finite Sets.  1989, Amsterdam, North-Holland Mathematical Library, Elsevier, translated from French.
 Charles Leiserson, Liyun Li, Marc Moreno Maza and Yuzhen Xie " Parallel computation of the minimal elements of a poset." Proceedings of the 4th International Workshop on Parallel Symbolic Computation (PASCO) 2010: 53-62, ACM.

Compatibility

 • The Hypergraphs[AddHyperedges] command was introduced in Maple 2024.