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`
HypergraphIncidenceMatrix
​
HypergraphIncidenceMatrix
[hg]
gives the incidence matrix of the hypergraph hg.
​
​
HypergraphIncidenceMatrix
[vertices,edges]
gives the incidence matrix of the hypergraph with the given vertices and edges.
​
Details and Options
▪
The result is a
SparseArray
matrix with one row per vertex, in the order of
VertexList
[hg], and one column per hyperedge, in the order of
EdgeList
[hg].
▪
The entry for a vertex and a hyperedge is
∑
𝑝
𝑝-1
2
, summed over the positions
𝑝
at which the vertex occurs in the hyperedge: bit
𝑝-1
of the entry records occupancy of position
𝑝
.
▪
This positional binary encoding makes the matrix a faithful representation of ordered hyperedges: an entry 1 means the vertex is first in the hyperedge, 2 means second, 4 means third, and a vertex occurring at several positions has several bits set.
▪
An entry 0 means the vertex and the hyperedge are not incident;
Sign
[matrix]
gives the ordinary 0-1 incidence matrix.
▪
IncidenceHypergraph
reconstructs the hypergraph exactly from its incidence matrix.
▪
For a hypergraph with no vertices the result is
{{}}
.
​
Examples  
(6)
Basic Examples  
(2)
Compute the incidence matrix of a hypergraph, displayed with
MatrixForm
:
In[1]:=
MatrixForm@
HypergraphIncidenceMatrix

Hypergraph
[{{1,2},{2,3},{1,2,3}}]
Out[1]=
1
0
1
2
1
2
0
2
4
_________________________________________________________________________________________________________________
The entries encode the position of each vertex within each hyperedge, so the two orderings of a binary hyperedge get different columns:
In[1]:=
MatrixForm@
HypergraphIncidenceMatrix

Hypergraph
[{{1,2},{2,1}}]
Out[1]=

1
2
2
1

Scope  
(2)

Properties & Relations  
(2)

SeeAlso
IncidenceHypergraph
 
▪
AdjacencyTensor
 
▪
HypergraphTransitionMatrix
 
▪
Hypergraph
RelatedGuides
▪
HypergraphFunctionality
""

© 2026 Wolfram. All rights reserved.

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