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`
ToPatternRules
​
ToPatternRules
[rule]
gives the pattern rule equivalent to the
HypergraphRule
rule, in the
{lhs}
Module
[{new},{rhs}]
form used by SetReplace-style hypergraph rewriting.
​
​
ToPatternRules
[lhs,rhs]
gives the same pattern rule directly from a list of input hyperedges lhs and a list of output hyperedges rhs.
​
​
ToPatternRules
[rules]
maps
ToPatternRules
over a list of
HypergraphRule
objects.
​
Details and Options
▪
Every vertex occurring in lhs or rhs is replaced by an ordinary pattern variable named
v.i
, numbered in order of first appearance across lhs then rhs.
▪
A vertex that appears only in rhs (one created by the rule) becomes a local variable of the resulting
Module
, so a fresh vertex is generated on every application of the rule, matching how a
WolframModel
-style rule creates new atoms.
▪
The rule's left-hand side is a plain list pattern that matches at the level of a list of hyperedges; apply it to a hyperedge list with
Replace
or
ResourceFunction["MultiReplace"]
to perform the rewrite.
​
Examples  
(4)
Basic Examples  
(2)
Convert a rule that attaches a new edge to a matched pair of vertices into a pattern rule:
In[1]:=
ToPatternRules

HypergraphRule

Hypergraph
[{{1,2}}],
Hypergraph
[{{1,2},{2,3}}]
Out[1]=
{{v.1_,v.2_}}Module[{v.3},{{v.1,v.2},{v.2,v.3}}]
_________________________________________________________________________________________________________________
Applying the pattern rule to a hyperedge list performs the same rewrite
HypergraphRule
would, generating a fresh vertex name for the new one:
In[1]:=
Replace{{10,20}},
ToPatternRules

HypergraphRule

Hypergraph
[{{1,2}}],
Hypergraph
[{{1,2},{2,3}}]
Out[1]=
{10,20},20,v.3$53803
Scope  
(2)

SeeAlso
HypergraphRule
 
▪
ToLabeledEdges
 
▪
ToLabeledPatternEdges
RelatedGuides
▪
HypergraphFunctionality
""

© 2026 Wolfram. All rights reserved.

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