Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Find a canonical version of a directed hypergraph
ResourceFunction["CanonicalHypergraph"][graph] finds a canonical version of a hypergraph. |
1. | Tuples are sorted by length with longest tuples occuring first |
2. | Tuples of the same length are considered a rule part |
3. | A rule part with 3 tuples of length 2 has signature 32 |
4. | Rule parts are ordered so that new alphabet terms are introduced with maximal frugality |
Canonicalize a very simple hypergraph:
In[1]:= |
|
Out[1]= |
|
A more complex case:
In[2]:= |
|
Out[2]= |
|
Hyperedges are sorted by reverse length:
In[3]:= |
|
Out[3]= |
|
Hypergraphs with many edges and extreme symmetry will take awhile:
In[4]:= |
|
Out[4]= |
|
This work is licensed under a Creative Commons Attribution 4.0 International License