Function Repository Resource:

AdjacencyHypergraph

Source Notebook

Compute the hypergraph with a specified adjacency tensor

Contributed by: Jonathan Gorard

ResourceFunction["AdjacencyHypergraph"][atens]

gives the (ordered or orderless) hypergraph with adjacency tensor atens.

Details and Options

An adjacency tensor is a generalization of the concept of an adjacency matrix from graphs to hypergraphs, in which hyperedges may be of arbitrary arity.
The arity of the hyperedges in the hypergraph is equal to the rank of the adjacency tensor.
The number of vertices will be equal to n, where the dimensions of the adjacency tensor are n×n××n.
ResourceFunction["AdjacencyHypergraph"] accepts adjacency tensors specified both as SparseArray objects, and as ordinary nested lists.
The number of hyperedges of the form {vi,vj,,vk} is specified by the entry aij…k of the adjacency tensor.
The number of self-loops for the vertex vi is given by the diagonal entry aii…i.
ResourceFunction["AdjacencyHypergraph"] has the following option:
"OrderedHyperedges"Automaticwhether to treat hyperedges as being ordered (directed)
The following settings for "OrderedHyperedges" can be used in ResourceFunction["AdjacencyHypergraph"]:
Automaticconstruct an orderless hypergraph if and only if the adjacency tensor is symmetric across all indices
Trueconstruct an ordered hypergraph
Falseconstruct an orderless hypergraph
When the adjacency tensor is of rank 2, the output of ResourceFunction["AdjacencyHypergraph"] is identical to that of AdjacencyGraph.

Examples

Basic Examples (3) 

Construct an ordered hypergraph automatically from an asymmetric adjacency tensor:

In[1]:=
ResourceFunction[
 "AdjacencyHypergraph"][{{{0, 0, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 0, 0}}, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {1, 0, 0, 0}}, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}}]
Out[1]=

Construct an orderless hypergraph automatically from a symmetric adjacency tensor:

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

Treat the hypergraph as being ordered instead:

In[3]:=
ResourceFunction[
 "AdjacencyHypergraph"][{{{0, 0, 0, 0}, {0, 0, 1, 0}, {0, 1, 0, 1}, {0, 0, 1, 0}}, {{0, 0, 1, 0}, {0, 0, 0, 0}, {1, 0, 0, 1}, {0, 0, 1, 0}}, {{0, 1, 0, 1}, {1, 0, 0, 1}, {0, 0, 0, 0}, {1, 1, 0, 0}}, {{0, 0, 1, 0}, {0, 0, 1, 0}, {1, 1, 0, 0}, {0, 0, 0, 0}}}, "OrderedHyperedges" -> True]
Out[3]=

Construct an ordered hypergraph of arity 5 automatically from an asymmetric adjacency tensor specified as a SparseArray:

In[4]:=
ResourceFunction["AdjacencyHypergraph"][SparseArray[
 Automatic, {10, 10, 10, 10, 10}, 0, {
  1, {{0, 24, 96, 168, 240, 288, 336, 408, 432, 456, 480}, CompressedData["
1:eJwllNGh3DAIBG1AYLuLtJQSXgNp+ZWSneXn7haGPQkJ/fn59/cnruv6va+r
9B1ZJ/JUVJ6ok3Gy4lTmikItAiHMsEJOUoKDhI0UcSEWgBm3wrd+3UrdytxK
3vivKNQiEMIM40+SEhwkbIQ/hVgApqI9WdPZNdlTOdU5XbWiUYtACDOskJOU
4CBhI0VciAUg4v16vrff+fr9pr95+3tnVryoRSCEGVbISUpwkLCRIi7EAnD6
VrvuYOPBZuNWE7W5iBWFWgSC/vCpkJPuT5i0kSIudH84A0V7QjsJbS20s9Dm
gv6saNQiEMIM0x+SlOAgYSP6QyEWgFremafOMzXnqXlOPWfqmXNWDGoRCGGG
FXKSEhwkbKSIC7EAZBfJ5nXQwSWhP9wh9cciUYtACDOskJO+V5HbnzTiQiwA
1R+dcCQbTzaboUugzen+WzRqEQj6w6dCTro/adJGirjQ/eEO6U/nSe0ktbXU
zlKbS/qzYlCLQAgzTH9IUoKDhI3oD4VYALILDUMwCDp0zZ2ugCbE/UHQn1oE
wv0ph5ykBIe4/QXiQiwAEfrbYmHFYip1SPpzzZfFoBaBYP18PszRsyU4SNhI
ERd6/Zyx1lc0l/eHS0j/uaO8Pwjen1kEwu/POOSk723W9r+MuBALQPVBYxea
tNDohSYvNHzB/K54UYtACDPM/JKkBAcJGzG/FGIBOKG/1UkzCDp0vRu6ApoQ
rx/B+nsRCK+/HXKSEhwy/AXiQiwAtX49F9EsrFlMhx4R/Xn3ihe1CATr51Mh
J73+NmkjRVzo9fMG8WpzeEePKZeQ8+WO6nwtDmoRCGGGFXLS97bOnu8x4kIs
ANUHzbVOBn/dWL/PusH2R+A/i0DYfxxykhIc/D4fIy7EApAuDpsfDRyHSH84
Y/XHYlCLQAgzrJCTPvee7c8YcSEWgK3+67D1biulE1fD9G7rGuCPwP9dBML+
r0NOUoJDh79AXIgFYMd/GbInTg==
"]}, CompressedData["
1:eJxTTMoPSmJkYGB4ACQYR8GwBgCZcgRp
"]}]]
Out[4]=

Scope (7) 

AdjacencyHypergraph accepts both SparseArray and nested list specifications of adjacency tensors:

In[5]:=
ResourceFunction["AdjacencyHypergraph"][SparseArray[
 Automatic, {4, 4, 4}, 0, {
  1, {{0, 4, 8, 14, 18}, {{2, 3}, {3, 2}, {3, 4}, {4, 3}, {1, 3}, {3, 1}, {3, 4}, {4, 3}, {1, 2}, {2, 1}, {1, 4}, {4, 1}, {2, 4}, {4, 2}, {1, 3}, {3, 1}, {2, 3}, {3, 2}}}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}}]]
Out[5]=
In[6]:=
ResourceFunction[
 "AdjacencyHypergraph"][{{{0, 0, 0, 0}, {0, 0, 1, 0}, {0, 1, 0, 1}, {0, 0, 1, 0}}, {{0, 0, 1, 0}, {0, 0, 0, 0}, {1, 0, 0, 1}, {0, 0, 1, 0}}, {{0, 1, 0, 1}, {1, 0, 0, 1}, {0, 0, 0, 0}, {1, 1, 0, 0}}, {{0, 0, 1, 0}, {0, 0, 1, 0}, {1, 1, 0, 0}, {0, 0, 0, 0}}}]
Out[6]=

AdjacencyHypergraph supports multihypergraphs, with adjacency tensor entries representing hyperedge multiplicities:

In[7]:=
ResourceFunction[
 "AdjacencyHypergraph"][{{{0, 0, 0, 0}, {0, 0, 3, 2}, {0, 3, 0, 1}, {0, 2, 1, 0}}, {{0, 0, 3, 2}, {0, 0, 0, 0}, {3, 0, 0, 0}, {2, 0, 0, 0}}, {{0, 3, 0, 1}, {3, 0, 0, 0}, {0, 0, 0, 0}, {1, 0, 0, 0}}, {{0, 2, 1, 0}, {2, 0, 0, 0}, {1, 0, 0, 0}, {0, 0, 0, 0}}}]
Out[7]=

When the rank of the adjacency tensor is equal to 2, the output of AdjacencyHypergraph is identical to the output of AdjacencyGraph:

In[8]:=
hypergraph = ResourceFunction[
  "AdjacencyHypergraph"][{{0, 1, 1, 0}, {1, 0, 1, 1}, {1, 1, 0, 1}, {0, 1, 1, 0}}]
Out[8]=
In[9]:=
graph = List @@@ EdgeList[AdjacencyGraph[{{0, 1, 1, 0}, {1, 0, 1, 1}, {1, 1, 0, 1}, {0, 1, 1, 0}}]]
Out[9]=
In[10]:=
hypergraph == graph
Out[10]=

When the adjacency tensor is symmetric across all indices, the hypergraph is automatically orderless:

In[11]:=
hypergraph1 = ResourceFunction[
  "AdjacencyHypergraph"][{{{0, 0, 0, 0, 0, 0}, {0, 0, 1, 0, 0, 0}, {0,
      1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 1, 0}}, {{0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {1, 0, 0, 1, 0, 0}, {0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0}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 0, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0}, {0, 0, 1, 0, 0, 1}, {0, 0, 0, 0, 0, 0}, {1, 0, 0, 1, 0, 0}}, {{0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 0}, {1, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 0, 0}}},
   "OrderedHyperedges" -> False]
Out[12]=
In[13]:=
hypergraph1 == hypergraph2
Out[13]=

When the adjacency tensor is asymmetric across any pair of indices, the hypergraph is automatically ordered:

In[14]:=
hypergraph1 = ResourceFunction[
  "AdjacencyHypergraph"][{{{0, 0, 0, 0, 0, 0}, {0, 0, 1, 0, 0, 0}, {0,
      0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}}, {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0,
      0}}, {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}}, {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 0, 0}}, {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {1, 0, 0, 0, 0, 0}}, {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}}}]
Out[14]=
In[15]:=
hypergraph2 = ResourceFunction[
  "AdjacencyHypergraph"][{{{0, 0, 0, 0, 0, 0}, {0, 0, 1, 0, 0, 0}, {0,
      0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}}, {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0,
      0}}, {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}}, {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 0, 0}}, {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {1, 0, 0, 0, 0, 0}}, {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}}},
   "OrderedHyperedges" -> True]
Out[15]=
In[16]:=
hypergraph1 == hypergraph2
Out[16]=

Diagonal entries of the adjacency tensor specify self-loops in the hypergraph:

In[17]:=
ResourceFunction[
 "AdjacencyHypergraph"][{{{1, 0, 0, 0, 0}, {0, 0, 1, 0, 1}, {0, 1, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 1, 0, 0, 0}}, {{0, 0, 1, 0, 1}, {0, 1,
     0, 0, 0}, {1, 0, 0, 1, 0}, {0, 0, 1, 0, 0}, {1, 0, 0, 0, 0}}, {{0, 1, 0, 0, 0}, {1, 0, 0, 1, 0}, {0, 0, 0, 0, 0}, {0, 1, 0,
     0, 1}, {0, 0, 0, 1, 0}}, {{0, 0, 0, 0, 0}, {0, 0, 1, 0, 0}, {0, 1, 0, 0, 1}, {0, 0, 0, 0, 0}, {0, 0, 1, 0, 0}}, {{0, 1, 0, 0, 0}, {1, 0, 0, 0, 0}, {0, 0, 0, 1, 0}, {0, 0, 1, 0, 0}, {0, 0, 0, 0, 0}}}]
Out[17]=

Adjacency tensors can be of arbitrary rank:

In[18]:=
ResourceFunction["AdjacencyHypergraph"][SparseArray[
 Automatic, {12, 12, 12, 12, 12, 12}, 0, {
  1, {{0, 240, 600, 960, 1440, 1800, 2040, 2160, 2280, 2400, 2640, 2760, 2880}, CompressedData["
1:eJw1mtuh48qOQ7tesi3tJCaTieGGcBOY/P+Ga4H68bF7V4EAyFMPSv/z3//7
z3/nv3///vf59+/Uf+fa56qP68x1dn07157r2vXzOnvu+l0f9dd9Vn0715r7
WvXzOmuemlcfNePUmPqov9aI+nntNevLqY9CqV/1rRBmzaqfNXq9WMBkHlMy
ZgvhyGA0RwNCNByA3UaQt2QhH65Q2rJTiypK0Kvw7GZuHIEK/eVxduOrXiws
iDPwCVcd0UKkxEE4RpMu6W39bo+ZHzAVKK/CtBNghoi+KgRzwxeW4abXhoNw
cgjZuKr/6qzRnWDGR47eGKBwOg0AxQozJjnSFrMgEWPMoiLgEUmoCX0zK9U1
6x8+3/r4fub+XPXt863Y36t+fj9XwdRfr/o6r8+ub59vTf7u+vn97PmpefVR
Mz41pj7qrzWifn6LTn351Eeh1K/6VgizZtXPGr1fLGAyjykZcwnhyGA0RwNC
NByAvYwgb8lCPlyhdMlOLaooQa/Cz9XMjSNQob88Plfjq14sLIgz8AlXHdFC
pMRBOEaTLult/W6PmR8wFSivwrQTYIaIvioEc8MXluGm14aDcHII2biq/+qs
0Z1gxkeO3higcDoNAMUKMyY50hazIBFjzKIi4B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qvQZaMLyEHrx3JqLZQ2g58pj9cVj7MWz68WzbNqvBc5N9KTPcLwP03nfdojt
M9h0p89wvLXSed/2ce0z2HTnvb5gAZN5TMmYI4Qjg9EcDWifQQ7AHiOkz3Ca
fLhC6cgufYYTQa/C5zRz4wj08F5feDyn8VUvln1+0eATrunz75YSB+EYTenz
79N9Bn8wP2DpM5yEaSfADJH0GU6bG76wDLd043cblxz6ZoOu6r867TNIkfGR
kz7DiahOA0CxIn2G02mLWZCIMenG705TJPlmg/TNrFRr3eBlBwbcLGp2iawr
m1jU1a2zNwuiz1KsKx/1+Eao/R3fCPWJh90tH/VYV/RcfKJDb+PYoCL6bV0F
C5jMs64cc4RwZDCaowFv3wi16+QboX8vb8mmrm7ZSOzVogrrKoPu08xTV3eC
vTzu0/ipq7stiDN/vhH69zqihamruzlGky7pbd7b/Ov5AUvf7CRMO/F37lad
vtlpc8P3z/c2/16vDZe+2Wn1cVX/1Zm6uptZ5OiNAVJXd7ONFWZMcqmruz2M
MWZREXu1NNWEvpmVauqKwnusK1pdlBzPeng/BypU5GNd8UCI0qQDxvs50KMv
9lhXPCmiQUbd8n4O/1PQU7tdzXjKRHON6E/XlVjWlfOYkjHW1ePIYDRHA6au
HhEFf3lL9ria3bKR2KtFFakrB92nmRtHoNSVPO7T+KoXK3X1NJ9w1REt3K5m
d3OMJl3S29TV0/MDpgLlpa6exgwRfVVI6upppeGm14bbqwmoPq7qvzqzTt7N
LHL0xgBZJ+9mGyvMmOSyTt7tYYwxi4rYq6WpJvTNrFT3+n/u8iuw "]}, CompressedData["
1:eJxTTMoPSmJkYGBw4GZgYBwFo2AUjIJRMApGwSgYBaNgFBANAFNBDTM=
"]}]]
Out[18]=

Options (3) 

By default ("OrderedHyperedges"Automatic), all hyperedges are treated as orderless (i.e. undirected) if the adjacency tensor is symmetric across all indices:

In[19]:=
ResourceFunction[
 "AdjacencyHypergraph"][{{0, 1, 1, 0}, {1, 0, 1, 1}, {1, 1, 0, 1}, {0,
    1, 1, 0}}]
Out[19]=

Use "OrderedHyperedges"True to treat hyperedges as ordered (i.e. directed):

In[20]:=
ResourceFunction[
 "AdjacencyHypergraph"][{{0, 1, 1, 0}, {1, 0, 1, 1}, {1, 1, 0, 1}, {0,
    1, 1, 0}}, "OrderedHyperedges" -> True]
Out[20]=

Conversely, all hyperedges are treated as ordered (i.e. directed) if the adjacency tensor is asymmetric across any pair of indices:

In[21]:=
ResourceFunction[
 "AdjacencyHypergraph"][{{0, 1, 1, 0}, {0, 0, 1, 1}, {0, 0, 0, 1}, {0,
    0, 0, 0}}]
Out[21]=

Publisher

Jonathan Gorard

Version History

  • 1.0.0 – 17 March 2021

Related Resources

License Information