PartialHypergraph - Maple Help

Hypergraphs

 PartialHypergraph
 Construct the hypergraph induced by a subset of the hyperedges of another hypergraph

 Calling Sequence PartialHypergraph(H,f)

Parameters

 H - f -

Description

 • The command PartialHypergraph(H,f) returns the hypergraph L whose vertex set is that of H and whose hyperedges are the hyperedges e of H for which f(e) is true.

Assumptions

 • The procedure f  maps every subset of the vertex set of H to a boolean value.

Terminology

 • 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.

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 the subhypergraph of H induced by {1,2,3,4}.

 > $S≔\mathrm{SubHypergraph}\left(H,\left\{1,2,3,4\right\}\right)$
 ${S}{≔}{\mathrm{< a hypergraph on 4 vertices with 3 hyperedges >}}$ (3)

Print its vertices and edges.

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

Draw a graphical representation of this hypergraph.

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

Create the partial hypergraph of H with hyperedges of even size.

 > $P≔\mathrm{PartialHypergraph}\left(H,s↦\mathrm{irem}\left(\mathrm{numelems}\left(s\right),2\right)=0\right)$
 ${P}{≔}{\mathrm{< a hypergraph on 7 vertices with 1 hyperedges >}}$ (5)

Print its vertices and edges.

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

Draw a graphical representation of this hypergraph.

 > $\mathrm{Draw}\left(P\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[PartialHypergraph] command was introduced in Maple 2024.