A key assertion of the Wolfram Physics Project (WPP) is its capability to replicate General Relativity. Therefore, understanding the emergence of well-behaved geometries from hypergraph rewriting is essential. This project explored various methods for crafting such models, using them to achieve the triangulation of a torus and outlining potential avenues for future exploration.
We will be using the package SetReplace to evaluate Wolfram Models. Note that this comes with a default updating order.
In[]:=
PacletInstall["SetReplace"]
Out[]=
PacletObject
Name: SetReplace
Version: 0.3.196


Some known rules that generate well-defined geometries

“Cone” model

This rule uses a self edges as a marker that moves forward and slowly knits a conical structure
In[]:=
coneModel=ResourceFunction["WolframModel"][{{{1,1,2},{1,3,4}}->{{4,4,3},{2,5,3},{2,5,3}}},{{1,1,1},{1,1,1}},<|"MaxEvents"->50|>];​​RulePlot@coneModel
Out[]=
In[]:=
Row@coneModel["EventsStatesPlotsList"]
Out[]=
In[]:=
GraphPlot3D@ResourceFunction["HypergraphToGraph"][coneModel["FinalState"]]
Out[]=

“Flap” model

A similar rule can produce a hypergraph that looks like a flat flap
In[]:=
flapModel=ResourceFunction["WolframModel"][{{{1,2,3},{1,3,4}}->{{1,2,4},{2,5,3},{2,4,3}}},{{1,1,1},{1,1,1}},<|"MaxEvents"->25|>];​​RulePlot@flapModel
Out[]=
In[]:=
Row@flapModel["EventsStatesPlotsList"]
Out[]=
In[]:=
GraphPlot3D@ResourceFunction["HypergraphToGraph"][flapModel["FinalState"]]
Out[]=

“Tube” model

This model is peculiar because it creates a spherical
1
S
topology starting only from self-edges
In[]:=
tubeModel=ResourceFunction["WolframModel"][{{{1,1,2},{3,4,2}}->{{4,4,2},{1,5,2},{1,5,3}}},{{1,1,1},{1,1,1}},<|"MaxEvents"->80|>];​​RulePlot@%
Out[]=
In[]:=
Row@tubeModel["EventsStatesPlotsList"]
Out[]=
In[]:=
GraphPlot3D@ResourceFunction["HypergraphToGraph"][tubeModel["FinalState"]]
Out[]=

Initial conditions

Initial conditions are a key aspect of hypergraph rewriting systems that can sometimes be more important than the rules themselves. It is known that computational systems can exhibit wildly different behaviors due to different initial conditions, examples of this can be found in differential equations and in cellular automata (an example can be found in Stephen Wolfram’s Code 10 post).
For example, the cone model shown above has an initial condition consisting of one edge with two ternary self-edges:
In[]:=
ResourceFunction["WolframModelPlot"][{{1,1,1},{1,1,1}}]
Out[]=
But what happens if more self-edges are added? Here is an attempt using an increasing number of self-edges as initial conditions
In[]:=
conesInitialConditions=Table[{1,1,1},{#}]&/@Range[2,32];​​Row[ResourceFunction["WolframModelPlot"]/@conesInitialConditions]
Out[]=
In[]:=
coneModels=ResourceFunction["WolframModel"][{{{1,1,2},{1,3,4}}->{{4,4,3},{2,5,3},{2,5,3}}},#,<|"MaxEvents"->200|>]&/@conesInitialConditions;​​conesFinalStates=#1["FinalState"]&/@coneModels;​​Row[ResourceFunction["WolframModelPlot"]/@conesFinalStates]
Curiously, the addition of one self-edge to the starting condition does not seem to change anything, but the two hypergraphs are in fact not isomorphic (even when discounting the extra self-edge).
The other results vary, although the rule seems to be behaving similarly in all of them, by extending different tendrils. A more interesting observation is how the different initial conditions can give rise to more complicated topologies.
This presents a challenge when performing ruliological searches, as one has to not only look for the correct rule, but also for the correct starting conditions. An interesting question emerges: can rules replace initial conditions?

Can you seed initial conditions?

A naive attempt was made to seed initial conditions using a unary edge.
While this did not change anything in the final result, it does showcase how different arity rules could be used to seed more complicated initial conditions. The use of more complex rules in combination with different-arity self-terminating ones could allow the definition of complex initial conditions or even different evolution phases for the hypergraph.
It is also evident that while it might be noteworthy on a conceptual level that all initial conditions can be shifted to rules, this does not affect anything at the practical level, as ruliological searches can already proceed in different directions. Thus the initial expectations that this could improve the search were badly informed.

Geometric engineering

We come now to the question, how can rules like the ones displayed above be found? Are there heuristics, or systematic approaches to finding these? We will focus mostly on obtaining 2-dimensional surfaces, and will use ternary rules as simplicial complexes are enough to approximate the desired geometries.
One common strategy is evident in the cone and flap model rules: the use of a marker. This can consist of a specific set of edges that the rule recognises and potentially replicates while also adding new edges, allowing it to slowly knit together the desired geometry. This has some extremely simple examples:
Another simple rule with a result similar to the flap model would slowly add panels to a flat disk
One can also use multiple markers of the same type at once to drive the growth. However this often results in fractal-like growth.
Different initial conditions lead to similar results in this case
These models look hyperbolic, and they hint at how to get hyperbolic 3-geometries using 3-simplexes by the use of similar quaternary rules.

Growing a torus

Now let us focus on a specific goal and attempt to grow a torus. What we mean by this, is a hypergraph whose global topology approximates that of a torus. We already know how to make models grow indefinitely with a marker, a similar approach can be taken by subdividing the present edges instead of adding new ones at the end of the growth. This method allows the use of initial conditions that are circular.
Now, if the objective is to achieve a triangulation of the surface of a torus, we need to make the sides of the ternary edges match. This is relatively simple:
This rule intentionally uses triangles to create parallelograms it can use as building blocks
And now we can turn this three-dimensional by stitching together three parallelograms in a triangular fashion. Our new building block will be
This can be used to make cylindrical tubes
And finally using circular initial conditions this can be used to make a torus!
We can also use a different number of faces for the prism-like tubes.
Here is an example with 4 faces
​
And here an example with 7:
One drawback of this approach is that a lot of information about the desired structure should be seeded in the rules and initial conditions. A possible solution is to grow the torus in two stages, first with one set of rules that grows the minor radius, then with a set of rules similar to the current one which would increase its major radius. In theory, this updating order already exists in the multiway updating structure of a model that has both set of rules and very simple initial conditions. This consideration suggests a more thorough explanation of the updating order of these models (beyond the standard SetReplace one) and more broadly the whole multiway structure of their evolutions: can rules have convergent (independent of updating order) nontrivial results, or are most such states the result of selecting a specific multiway path? Is it possible to identify such paths?
​

Modifying known rules

Interesting results can also be obtained by the modification of known rules. This has been explored little, but shows promising results. Here are some examples playing around with the tube rule shown above.
We can give the rule two or more seeds to grow from, and connect these using edges or sets of edges inert to the rule.
The new edges can also interact with rules in non-trivial ways
This model has a different rule while leading to a very similar result.
Despite the similarity, two results do not seem to be isomorphic
Nor do the resulting graphs obtained by simplifying the hypergraph structure

Acknowledgements

I want to express my gratitude to my mentors: Utkarsh Bajaj, who ensured the project stayed on track, and Dugan Hammock, who supplied valuable examples and visuals. Additionally, I thank Xerxes Arsiwalla for inviting me to the school and providing the initial project idea for the project.

Appendix A: Mapping rules to lower arities

While exploring different avenues for this project, it was noted that many known rules that generate well-defined geometries use higher-arity relations. One way this can be justified is that n-ary rulesets will naturally produce n-gon faces, for example when seeking a triangulation, like above, it would be natural to use ternary relations. However, it is interesting to know if such configurations can be produced with lower-arity rulesets, and in particular with binary ones. If any Wolfram Model could be reduced to a binary one, then at least in principle the study of binary graphs would be sufficient. As the following experiment shows, there is an issue this expectation: the mapping ternary  binary is not bijective, as different sets of binary edges could be mapped to a ternary one. In other words, higher arity rules have additional constraints built into the model that would be hard to replicate with binary rules alone (that is, without any additional information).
Define the rule to map ternary edges to binary ones
Map rule and initial conditions
Comparing this with the ternary cone model evolution, the differences becomes evident, the most obvious one being that the binary ruleset naturally terminates, while the ternary one does not.
It is worth noting that while binary evolution alone cannot be equivalent to ternary evolution, the equivalence can be forced through the introduction of constraints. For example, the evolutions above diverge because during replacement binary rules can match sets of binary edges that derive not from a single ternary edge, but from different ones. However by imposing a different updating order, which is the same as choosing a different path in the multiway evolution of the model, it is possible to obtain an equivalent evolution. In this sense multiway binary models are larger than higher-arity ones.

CITE THIS NOTEBOOK

Exploring ruliological engineering of well-defined geometries via hypergraph rewriting​
by Jacopo Uggeri​
Wolfram Community, STAFF PICKS, January 16, 2025 (Edited: March 7, 2025)
​https://community.wolfram.com/groups/-/m/t/3358036