Wolfram Research

Function Repository Resource:

EnumerateHypergraphs

Source Notebook

Enumerate possible ordered hypergraphs with a given signature

Contributed by: Stephen Wolfram and Max Piskunov

ResourceFunction["EnumerateHypergraphs"][sig]

generates a list of all canonical hypergraphs with the specified signature sig.

ResourceFunction["EnumerateHypergraphs"][sig,s]

allows only up to s distinct elements.

ResourceFunction["EnumerateHypergraphs"][sig,type]

generates all possible hypergraphs with the specified type of connectivity.

Details and Options

The input lhs should be of the form {{n1L,k1L},{n2L,k2L},}.
The connectivity types can be:
All require both left- and right- hand sides to be connected individually and to one another
Automatic require left-hand side to be connected and to be connected to the right-hand side
None do not constrain based on connectivity
The option "Monitored" (default False) can be used to monitor computation.
ResourceFunction["EnumerateHypergraphs"] by default uses parallel computation.

Examples

Basic Examples

Enumerate ordered hypergraphs with pairs of binary relations:

In[1]:=
ResourceFunction["EnumerateHypergraphs"][{{2, 2}}]
Out[1]=

Scope

Enumerate all ordered hypergraphs with pairs of ternary relations:

In[2]:=
ResourceFunction["EnumerateHypergraphs"][{{2, 3}}]
Out[2]=

An equivalent specification:

In[3]:=
ResourceFunction["EnumerateHypergraphs"][{{2, 3}}, Automatic]
Out[3]=

Ordered hypergraphs with no constraints on connectivity:

In[4]:=
ResourceFunction["EnumerateHypergraphs"][{{2, 3}}, None]
Out[4]=

Constrain to at most two distinct elements:

In[5]:=
ResourceFunction["EnumerateHypergraphs"][{{2, 3}}, 2]
Out[5]=

Use with a more complicated signature:

In[6]:=
ResourceFunction["EnumerateHypergraphs"][{{2, 3}, {2, 2}}, 3] // AbsoluteTiming
Out[6]=

Resource History

Related Resources

License Information