Wolfram Language
Paclet Repository
Community-contributed installable additions to the Wolfram Language
Primary Navigation
Categories
Cloud & Deployment
Core Language & Structure
Data Manipulation & Analysis
Engineering Data & Computation
External Interfaces & Connections
Financial Data & Computation
Geographic Data & Computation
Geometry
Graphs & Networks
Higher Mathematical Computation
Images
Knowledge Representation & Natural Language
Machine Learning
Notebook Documents & Presentation
Scientific and Medical Data & Computation
Social, Cultural & Linguistic Data
Strings & Text
Symbolic & Numeric Computation
System Operation & Setup
Time-Related Computation
User Interface Construction
Visualization & Graphics
Random Paclet
Alphabetical List
Using Paclets
Create a Paclet
Get Started
Download Definition Notebook
Learn More about
Wolfram Language
Hypergraph
Guides
Hypergraph Functionality
Tech Notes
Hypergraph Rewriting
Symbols
AdjacencyHypergraph
AdjacencyTensor
CanonicalHypergraph
CanonicalHypergraphRule
ConnectedHypergraphQ
CyclicEdge
EdgeListTagged
EdgeMultiplicity
EdgeSymmetry
EnumerateHypergraphRules
EnumerateHypergraphs
EnumerateOrderedHypergraphs
EnumerateWolframModelRules
HighlightRule
HyperedgeList
Hyperedge
Hyperedges
HyperedgesQ
Hypergraph3D
HypergraphArityReduce
HypergraphDraw
HypergraphEmbedding
HypergraphHadamardProduct
HypergraphIncidenceMatrix
HypergraphIncidence
HypergraphInsertionBracketDegree
HypergraphInsertionBracket
HypergraphInsertion
HypergraphLargeQ
Hypergraph
HypergraphQ
HypergraphRuleDraw
HypergraphRule
HypergraphRuleQ
HypergraphToGraph
HypergraphTransitionMatrix
HypergraphUnion
HypermatrixGraph
Hypermatrix
HypermatrixQ
IncidenceHypergraph
IsomorphicHypergraphQ
KoszulSign
LinkedHypergraph
OrderedHypergraphToGraph
RandomAllHypergraph
RandomConnectedHypergraph
RandomHypergraph
RandomHypergraphRule
SetHypergraphSummaryThresholds
SimpleHypergraph
SimpleHypergraphPlot3D
SimpleHypergraphPlot
SimpleHypergraphQ
ToLabeledEdges
ToLabeledPatternEdges
ToOrderedHypergraph
ToPatternRules
WolframInstitute`Hypergraph`
A
d
j
a
c
e
n
c
y
T
e
n
s
o
r
A
d
j
a
c
e
n
c
y
T
e
n
s
o
r
[
h
g
]
g
i
v
e
s
t
h
e
a
d
j
a
c
e
n
c
y
t
e
n
s
o
r
o
f
t
h
e
h
y
p
e
r
g
r
a
p
h
h
g
.
A
d
j
a
c
e
n
c
y
T
e
n
s
o
r
[
v
e
r
t
i
c
e
s
,
e
d
g
e
s
]
g
i
v
e
s
t
h
e
a
d
j
a
c
e
n
c
y
t
e
n
s
o
r
o
f
t
h
e
h
y
p
e
r
g
r
a
p
h
w
i
t
h
t
h
e
g
i
v
e
n
v
e
r
t
i
c
e
s
a
n
d
e
d
g
e
s
.
D
e
t
a
i
l
s
a
n
d
O
p
t
i
o
n
s
▪
For a hypergraph with
𝑛
vertices and maximal hyperedge arity
𝑟
,
A
d
j
a
c
e
n
c
y
T
e
n
s
o
r
returns a
S
p
a
r
s
e
A
r
r
a
y
of rank
𝑟
with every dimension equal to
𝑛
+
1
.
▪
A hyperedge listing the vertices at positions
𝑖
1
,
…
,
𝑖
𝑘
of
V
e
r
t
e
x
L
i
s
t
[
hg
] contributes 1 to the tensor entry at index
{
𝑖
1
,
…
,
𝑖
𝑘
,
𝑛
+
1
,
…
,
𝑛
+
1
}
: the extra index value
𝑛
+
1
pads hyperedges of arity less than
𝑟
.
▪
Entries count multiplicities: a hyperedge occurring
𝑚
times gives an entry
𝑚
.
▪
Vertices within each hyperedge are taken in the order written, so the tensor is not symmetrized, regardless of the hypergraph's
"
E
d
g
e
S
y
m
m
e
t
r
y
"
.
▪
Hyperedge tags are ignored.
▪
In
A
d
j
a
c
e
n
c
y
T
e
n
s
o
r
[
v
e
r
t
i
c
e
s
,
e
d
g
e
s
]
, tensor indices refer to positions in the list
vertices
, which may include vertices absent from
edges
.
▪
A
d
j
a
c
e
n
c
y
H
y
p
e
r
g
r
a
p
h
reconstructs a hypergraph from its adjacency tensor.
Examples
(
8
)
Basic Examples
(
2
)
Compute the adjacency tensor of a hypergraph:
I
n
[
1
]
:
=
t
e
n
s
o
r
=
A
d
j
a
c
e
n
c
y
T
e
n
s
o
r
H
y
p
e
r
g
r
a
p
h
[
{
{
1
,
2
}
,
{
2
,
3
}
,
{
1
,
2
,
3
}
}
]
O
u
t
[
1
]
=
S
p
a
r
s
e
A
r
r
a
y
S
p
e
c
i
f
i
e
d
e
l
e
m
e
n
t
s
:
3
D
i
m
e
n
s
i
o
n
s
:
{
4
,
4
,
4
}
Each hyperedge yields one nonzero entry, padded with the extra index 4 up to the maximal arity 3:
I
n
[
2
]
:
=
M
o
s
t
@
A
r
r
a
y
R
u
l
e
s
[
t
e
n
s
o
r
]
O
u
t
[
2
]
=
{
{
1
,
2
,
4
}
1
,
{
1
,
2
,
3
}
1
,
{
2
,
3
,
4
}
1
}
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
_
For a hypergraph with only binary hyperedges the adjacency tensor is a matrix, displayed here with
M
a
t
r
i
x
F
o
r
m
:
I
n
[
1
]
:
=
M
a
t
r
i
x
F
o
r
m
@
A
d
j
a
c
e
n
c
y
T
e
n
s
o
r
H
y
p
e
r
g
r
a
p
h
[
{
{
1
,
2
}
,
{
2
,
3
}
,
{
3
,
1
}
}
]
O
u
t
[
1
]
=
0
1
0
0
0
0
1
0
1
0
0
0
0
0
0
0
S
c
o
p
e
(
3
)
P
r
o
p
e
r
t
i
e
s
&
R
e
l
a
t
i
o
n
s
(
2
)
P
o
s
s
i
b
l
e
I
s
s
u
e
s
(
1
)
S
e
e
A
l
s
o
A
d
j
a
c
e
n
c
y
H
y
p
e
r
g
r
a
p
h
▪
H
y
p
e
r
g
r
a
p
h
I
n
c
i
d
e
n
c
e
M
a
t
r
i
x
▪
H
y
p
e
r
g
r
a
p
h
T
r
a
n
s
i
t
i
o
n
M
a
t
r
i
x
▪
H
y
p
e
r
m
a
t
r
i
x
▪
H
y
p
e
r
g
r
a
p
h
R
e
l
a
t
e
d
G
u
i
d
e
s
▪
H
y
p
e
r
g
r
a
p
h
F
u
n
c
t
i
o
n
a
l
i
t
y
"
"