AreEqual - Maple Help

Hypergraphs

 AreEqual
 Check whether two hypergraphs are equal or not

 Calling Sequence AreEqual(H1,H2)

Parameters

 H1 - H2 -

Description

 • The command AreEqual(H1,H2) checks whether the hypergraphs H1 and H2 are equal or not.

Terminology

 • Equal hypergraphs : Two hypergraphs H1 :=(X1, Y1) and H2 :=(X2, Y2) are said equal whenever X1 = X2 and Y1 = Y2 both hold.

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)$

Create another hypergraph from its edges.

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

Print its vertices and edges.

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

Draw a graphical representation of this hypergraph.

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

Check whether H and L are equal.

 > $\mathrm{AreEqual}\left(H,L\right)$
 ${\mathrm{false}}$ (5)

Check whether H and L are isomorphic.

 > $\mathrm{AreIsomorphic}\left(H,L\right)$
 ${\mathrm{true}}$ (6)

Compute the transversal T hypergraph of H and the transversal TT of T.

 > $T≔\mathrm{Transversal}\left(H\right);$$\mathrm{TT}≔\mathrm{Transversal}\left(T\right)$
 ${T}{≔}{\mathrm{< a hypergraph on 7 vertices with 3 hyperedges >}}$
 ${\mathrm{TT}}{≔}{\mathrm{< a hypergraph on 7 vertices with 3 hyperedges >}}$ (7)
 > $\mathrm{Vertices}\left(\mathrm{TT}\right);$$\mathrm{Hyperedges}\left(\mathrm{TT}\right)$
 $\left[{1}{,}{2}{,}{3}{,}{4}{,}{5}{,}{6}{,}{7}\right]$
 $\left[\left\{{4}\right\}{,}\left\{{2}{,}{3}\right\}{,}\left\{{3}{,}{5}{,}{6}\right\}\right]$ (8)

Compute the hypergraph induced by the minimal hyperedges of H.

 > $M≔\mathrm{Min}\left(H\right)$
 ${M}{≔}{\mathrm{< a hypergraph on 7 vertices with 3 hyperedges >}}$ (9)

Print the vertices and edges of M.

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

Check that TT and M are equal as hypergraphs.

 > $\mathrm{AreEqual}\left(\mathrm{TT},M\right)$
 ${\mathrm{true}}$ (11)

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[AreEqual] command was introduced in Maple 2024.