Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • 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
    • 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`
AdjacencyTensor
​
AdjacencyTensor
[hg]
gives the adjacency tensor of the hypergraph hg.
​
​
AdjacencyTensor
[vertices,edges]
gives the adjacency tensor of the hypergraph with the given vertices and edges.
​
Details and Options
▪
For a hypergraph with
𝑛
vertices and maximal hyperedge arity
𝑟
,
AdjacencyTensor
returns a
SparseArray
of rank
𝑟
with every dimension equal to
𝑛+1
.
▪
A hyperedge listing the vertices at positions
𝑖
1
,…,
𝑖
𝑘
of
VertexList
[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
"EdgeSymmetry"
.
▪
Hyperedge tags are ignored.
▪
In
AdjacencyTensor
[vertices,edges]
, tensor indices refer to positions in the list vertices, which may include vertices absent from edges.
▪
AdjacencyHypergraph
reconstructs a hypergraph from its adjacency tensor.
​
Examples  
(8)
Basic Examples  
(2)
Compute the adjacency tensor of a hypergraph:
In[1]:=
tensor=
AdjacencyTensor

Hypergraph
[{{1,2},{2,3},{1,2,3}}]
Out[1]=
SparseArray
Specified elements: 3
Dimensions: {4,4,4}

Each hyperedge yields one nonzero entry, padded with the extra index 4 up to the maximal arity 3:
In[2]:=
Most@ArrayRules[tensor]
Out[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
MatrixForm
:
In[1]:=
MatrixForm@
AdjacencyTensor

Hypergraph
[{{1,2},{2,3},{3,1}}]
Out[1]=
0
1
0
0
0
0
1
0
1
0
0
0
0
0
0
0
Scope  
(3)

Properties & Relations  
(2)

Possible Issues  
(1)

SeeAlso
AdjacencyHypergraph
 
▪
HypergraphIncidenceMatrix
 
▪
HypergraphTransitionMatrix
 
▪
Hypermatrix
 
▪
Hypergraph
RelatedGuides
▪
HypergraphFunctionality
""

© 2026 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com