Function Repository Resource:

KirchhoffHypergraph

Source Notebook

Compute the hypergraph with a specified Kirchhoff tensor (Laplacian)

Contributed by: Jonathan Gorard

ResourceFunction["KirchhoffHypergraph"][ktens]

gives the (ordered or orderless) hypergraph with Kirchhoff tensor ktens.

Details and Options

A Kirchhoff tensor (hypergraph Laplacian) is a generalization of the concept of a Kirchhoff matrix (graph Laplacian) 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 Kirchhoff tensor.
The number of vertices will be equal to n, where the dimensions of the adjacency tensor are n×n××n.
ResourceFunction["KirchhoffHypergraph"] accepts Kirchhoff tensors specified both as SparseArray objects, and as ordinary nested lists.
The degree of the vertex vi is given by the diagonal entry aii…i of the Kirchhoff tensor.
The number of hyperedges of the form {vi,vj,,vk} is specified by the off-diagonal entry -aij…k of the Kirchhoff tensor.
ResourceFunction["KirchhoffHypergraph"] has the following option:
"OrderedHyperedges"Automaticwhether to treat hyperedges as being ordered (directed)
The following settings for "OrderedHyperedges" can be used in ResourceFunction["KirchhoffHypergraph"]:
Automaticconstruct an orderless hypergraph if and only if the Kirchhoff tensor is symmetric across all indices
Trueconstruct an ordered hypergraph
Falseconstruct an orderless hypergraph

When the Kirchhoff tensor is of rank 2, the output of ResourceFunction["KirchhoffHypergraph"] is identical to that of KirchhoffGraph.

Examples

Basic Examples (3) 

Construct an ordered hypergraph automatically from an asymmetric Kirchhoff tensor:

In[1]:=
ResourceFunction[
 "KirchhoffHypergraph"][{{{4, 0, 0, 0}, {0, 0, -1, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}, {{0, 0, 0, 0}, {0, 4, 0, 0}, {0, 0, 0, -1}, {0,
     0, 0, 0}}, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 6, 0}, {-1, 0, 0, 0}}, {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 4}}}]
Out[1]=

Construct an orderless hypergraph automatically from a symmetric Kirchhoff tensor:

In[2]:=
ResourceFunction[
 "KirchhoffHypergraph"][{{{4, 0, 0, 0}, {0, 0, -1, 0}, {0, -1, 0, -1}, {0, 0, -1, 0}}, {{0, 0, -1, 0}, {0, 4, 0, 0}, {-1, 0, 0, -1}, {0, 0, -1, 0}}, {{0, -1, 0, -1}, {-1, 0, 0, -1}, {0, 0, 6,
     0}, {-1, -1, 0, 0}}, {{0, 0, -1, 0}, {0, 0, -1, 0}, {-1, -1, 0, 0}, {0, 0, 0, 4}}}]
Out[2]=

Treat the hypergraph as being ordered instead:

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

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

In[4]:=
ResourceFunction["KirchhoffHypergraph"][SparseArray[
 Automatic, {10, 10, 10, 10, 10}, 0, {
  1, {{0, 25, 98, 171, 244, 293, 342, 415, 440, 465, 490}, CompressedData["
1:eJwllNGVHDEIBFeAYGazcEoO4RJw3heFuxp97L6GAg0I6c/Pv78/8fl8fs/n
U/o/WpF1I29F5Y26GTcrbmWuKNQiEMIMy2QnIWSQcCJZHEgKwAzWketIHbmP
vEfAYY8VhVoEQphh9sBJCBkknIg9CCQFYMrakzWdXZM9lVOd01UrGrUIhDDD
MtlJCBkknEgWB5ICEPF+e75vv/Pt9zv9nbe/78yKF7UIhDDDMtlJCBkknEgW
B5ICULtoHbXtBMUHBcdRM1WgmmdRqEUg6BG/MtnpHoVJJ5LFge4RZyFrT6ia
UHmh6kIFBj1a0ahFIIQZpkc4CSGDhBPRIwJJAajPu/PUfabmPjXPredOPXPv
ikEtAiHMsEx2EkIGCSeSxYGkALzF0rDSAB14MCz0iFliwBCJWgRCmGGZ7PR8
RW6P0ogDSQGoHumkIyk+KThDwxAcz4pGLQJBj/iVyU73KE06kSwOdI+YJW06
T6qaVHmp6lIFJj1aMahFIIQZpkc4CSGDhBPRIwJJAXjzanGhddj0SLdDB697
eMo9QtCjWgTCPSqb7CSEDHH8B+JAUgAitHXxccUHVeqw9AG6axaDWgSCGvh9
uFPPhpBBwolkcaBr4KyztbQzTeZNYiA5B+aVNwnBmzSLQPhNGpvs9Axn7TmU
EQeSAlC90DUM3bzQVQzdxNBlDO7zihe1CIQww9xnnISQQcKJuM8EkgJwYrS0
tergYmgA9JZoHHRjXAOCGnoRCNfQNtlJCBky/AfiQFIAqgY9IdF8XPNBHXpY
9AFqnsWLWgSCGviVyU7X0CadSBYHugbeJV5zDlFDVQwk58y86pwtLmoRCGGG
ZbLTM1x3z/kacSApAGXXkotzZA9NsN9tTbT3QLDHLALhPcYmOwkhg9/ta8SB
pACsfLV0A2mCDqU5UPrEeatPFoNaBEKYYZns9Az0bJ/GiANJASi7llzah4NX
A/Wuq52aCO+BYI93EQjv8dpkJyFk6PAfiANJAdjxH7mDKDQ=
"]}, CompressedData["

1:eJxTTMoPymNkYGB4BSRYgPR/GgMeOtgx1MFoGBEGo2FEGHAMgzAaDn4YTauE
AT3qnuFiBwAwzXvY
"]}]]
Out[4]=

Scope (6) 

KirchhoffHypergraph accepts both SparseArray and nested list specifications of Kirchhoff tensors:

In[5]:=
ResourceFunction["KirchhoffHypergraph"][SparseArray[
 Automatic, {4, 4, 4}, 0, {
  1, {{0, 5, 10, 17, 22}, {{1, 1}, {2, 3}, {3, 2}, {3, 4}, {4, 3}, {2,
     2}, {1, 3}, {3, 1}, {3, 4}, {4, 3}, {3, 3}, {1, 2}, {2, 1}, {1, 4}, {4, 1}, {2, 4}, {4, 2}, {4, 4}, {1, 3}, {3, 1}, {2, 3}, {3, 2}}}, {4, -1, -1, -1, -1, 4, -1, -1, -1, -1, 6, -1, -1, -1, -1, -1, -1, 4, -1, -1, -1, -1}}]]
Out[5]=
In[6]:=
ResourceFunction[
 "KirchhoffHypergraph"][{{{4, 0, 0, 0}, {0, 0, -1, 0}, {0, -1, 0, -1}, {0, 0, -1, 0}}, {{0, 0, -1, 0}, {0, 4, 0, 0}, {-1, 0, 0, -1}, {0, 0, -1, 0}}, {{0, -1, 0, -1}, {-1, 0, 0, -1}, {0, 0, 6,
     0}, {-1, -1, 0, 0}}, {{0, 0, -1, 0}, {0, 0, -1, 0}, {-1, -1, 0, 0}, {0, 0, 0, 4}}}]
Out[6]=

KirchhoffHypergraph supports multihypergraphs, with off-diagonal Kirchhoff tensor entries representing hyperedge multiplicities:

In[7]:=
ResourceFunction[
 "KirchhoffHypergraph"][{{{12, 0, 0, 0}, {0, 0, -3, -2}, {0, -3, 0, -1}, {0, -2, -1, 0}}, {{0, 0, -3, -2}, {0, 10, 0, 0}, {-3, 0, 0, 0}, {-2, 0, 0, 0}}, {{0, -3, 0, -1}, {-3, 0, 0, 0}, {0, 0, 8, 0}, {-1, 0, 0, 0}}, {{0, -2, -1, 0}, {-2, 0, 0, 0}, {-1, 0, 0, 0}, {0, 0, 0, 6}}}]
Out[7]=

When the rank of the Kirchhoff tensor is equal to 2, the output of KirchhoffHypergraph is identical to the output of KirchhoffGraph:

In[8]:=
hypergraph = ResourceFunction[
  "KirchhoffHypergraph"][{{2, -1, -1, 0}, {-1, 3, -1, -1}, {-1, -1, 3, -1}, {0, -1, -1, 2}}]
Out[8]=
In[9]:=
graph = List @@@ EdgeList[KirchhoffGraph[{{2, -1, -1, 0}, {-1, 3, -1, -1}, {-1, -1, 3, -1}, {0, -1, -1, 2}}]]
Out[9]=
In[10]:=
hypergraph == graph
Out[10]=

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

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

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

In[14]:=
hypergraph1 = ResourceFunction[
  "KirchhoffHypergraph"][{{{4, 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, 4, 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, 6, 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, 6, 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, 6, 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, 4}}}]
Out[14]=
In[15]:=
hypergraph2 = ResourceFunction[
  "KirchhoffHypergraph"][{{{4, 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, 4, 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, 6, 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, 6, 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, 6, 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, 4}}}, "OrderedHyperedges" -> True]
Out[15]=
In[16]:=
hypergraph1 == hypergraph2
Out[16]=

Kirchhoff tensors can be of arbitrary rank:

In[17]:=
ResourceFunction["KirchhoffHypergraph"][SparseArray[
 Automatic, {12, 12, 12, 12, 12, 12}, 0, {
  1, {{0, 241, 602, 963, 1444, 1805, 2046, 2167, 2288, 2409, 2650, 2771, 2892}, CompressedData["
1:eJw1msuB5DCSQ5s/ZUpZTqw/exoTxoH1/7bxHkJ1yE5VkSCAiOYnqP/57//9
57/z379///v79+/Uv4Ofufa56uM6c51d386157p2PV5nz13P9VF/3WfVt3Ot
ua9Vj9dZ81S/+qgep9rUR/21WtTjtdesL6c+CqWe6lshzOpVj9V6vVjApB9d
0mYLYctgNEcHhGg4ALsdQd6ShXy4QmnLTi2qKEGvwrObueMIVOgvj7MbX/Vi
YUGcgU+46ogWIiUOwjGadElv67k9pn/AVKC8GqadADNE9FUhmBu+sAw3vXY4
CCeGkI2r+q/Oat0Bpn3k6I0DFE6HAaBYYcQkR9hiFiRijFFUBDwiCTWhb2Sl
umb94vOtj+9n7s9V3z7fGvt71eP3cxVM/fWqr/P67Pr2+Vbn767H72fPT/Wr
j+rxqTb1UX+tFvX4LTr15VMfhVJP9a0QZvWqx2q9Xyxg0o8uaXMJYctgNEcH
hGg4AHs5grwlC/lwhdIlO7WoogS9Cj9XM3ccgQr95fG5Gl/1YmFBnIFPuOqI
FiIlDsIxmnRJb+u5PaZ/wFSgvBqmnQAzRPRVIZgbvrAMN712OAgnhpCNq/qv
zmrdAaZ95OiNAxROhwGgWGHEJEfYYhYkYoxRVAQ8Igk1oW9kpbqnP4OcHmTf
ILEHWTrIykHyDfJ8kJaDZB9k+CCjB0k6yP1BSg/+AwxSf5D5gwQf/BcYZP8g
3QeZPkjt4aT1YgGTfnRJmy2ELYPRHB0QouHgpOUI8pYs5MPVSUt2alFFCXoV
nt3MHUcgJq3mcXbjq14sLIgzTlpy1REtREocdNJSky7pbT23x/QPmAqUx6QV
J5y0JKKvCsHc8HXSkpteOxyEE0MnLV3V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8O0E2CGSAoQ
p80NX1iGW2r1u41LDH35QVf1X50WIKRI+8hJAeJEVIcBoFiRAsTpsMUsSMSY
1Op3hymSfPlB+kZWqtWaH+ZLA/cwvVlDMrkscZFcj/Y+TI1et5hc3gb5+qjV
H18f9VLE2pe3QSYXFRkvfah8HMtXUHhMrmABk34ml22OELYMRnN0wMfXR61J
+fro38tbskmuRzYSe7WowuRKo+c08yTXk8FeHs9p/CTX0xbEmT9fH/17HdHC
JNfTHKNJl/Q2L3n+df+Apap2Mkw78XeeVp2q2mlzw/fPlzz/Xq8dLlW10+rj
qv6rM8n1NLPI0RsHSHI9zTZWGDHJJbme9jDGGEVF7NXSVBP6Rlaq9Vd+GJsM
+5lcVMNIPu6E9i/JRW7+TC4ujkhSimS8zANHSmc/k4sbJWpoZPBj8kKVl3n4
P8JtFPU3KPw6ucQyuexHl7QxuX62DEZzdMAk109EwV/ekj3Oa49sJPZqUUWS
y0bPaeaOI1CSSx7PaXzVi5Xk+jWfcNURLdzOa09zjCZd0tsk16/7B0wFykty
/RozRPRVIUmuXysNN712uL2agOrjqv6rMzPm08wiR28cIDPm02xjhRGTXGbM
pz2MMUZREXu1NNWEvpGV6l7/D1LkLUI=
"]}, CompressedData["
1:eJzt2bERgEAIBEAMTDQwsQH7MbIEC9D+I7ULgdlNvoAbbmB+O+/jGiJinyOm
732AshYzDJCWjgbIa9XRAPALdxJAXv4MobbRDLcn4/5k3J99C2rT0/3JuL8X
M87YFw==
"]}]]
Out[17]=

Options (3) 

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

In[18]:=
ResourceFunction[
 "KirchhoffHypergraph"][{{2, -1, -1, 0}, {-1, 3, -1, -1}, {-1, -1, 3, -1}, {0, -1, -1, 2}}]
Out[18]=

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

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

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

In[20]:=
ResourceFunction[
 "KirchhoffHypergraph"][{{2, -1, -1, 0}, {0, 3, -1, -1}, {0, 0, 3, -1}, {0, 0, 0, 2}}]
Out[20]=

Publisher

Jonathan Gorard

Version History

  • 1.0.0 – 17 March 2021

Related Resources

License Information