# 4.11 Graph Properties Conserved by Rules

Many rules (at least when they exhibit complex behavior) seem to lead to statistically similar behavior, independent of their initial conditions. But there could still be disjoint families of states that can be reached from different initial conditions, perhaps characterized by different graph or hypergraph invariants.

As one example, we can ask whether there are rules that preserve the planarity of graphs. All rules with signature 12 22 inevitably do this. A rule like

{{x, y}} -> {{x, y}, {y, z}, {z, x}}
RulePlot[ResourceFunction[ "WolframModel"][{{x, y}} -> {{x, y}, {y, z}, {z, x}}]]

might not at first appear to:

RuleOnGraphDirected[rule_, graph_] := Graph[Rule @@@ ResourceFunction["WolframModel"][rule, List @@@ EdgeList[graph], 1, "FinalState"], VertexStyle -> ResourceFunction["WolframPhysicsProjectStyleData"]["SpatialGraph", "VertexStyle"], EdgeStyle -> ResourceFunction["WolframPhysicsProjectStyleData"]["SpatialGraph", "EdgeLineStyle"]] Graph[#, ImageSize -> 150] & /@ NestList[RuleOnGraphDirected[{{x, y}} -> {{x, y}, {y, z}, {z, x}}, #] &, Graph[{1 \[DirectedEdge] 2, 1 \[DirectedEdge] 3, 2 \[DirectedEdge] 3, 1 \[DirectedEdge] 4, 3 \[DirectedEdge] 4, 3 \[DirectedEdge] 5, 4 \[DirectedEdge] 5, 5 \[DirectedEdge] 2}], 3]

But a different graph layout shows that actually all these graphs are planar :

RuleOnGraphDirected[rule_, graph_] := Graph[Rule @@@ ResourceFunction["WolframModel"][rule, List @@@ EdgeList[graph], 1, "FinalState"], VertexStyle -> ResourceFunction["WolframPhysicsProjectStyleData"]["SpatialGraph", "VertexStyle"], EdgeStyle -> ResourceFunction["WolframPhysicsProjectStyleData"]["SpatialGraph", "EdgeLineStyle"]] Graph[#, ImageSize -> 150] & /@ PlanarGraph /@ NestList[RuleOnGraphDirected[{{x, y}} -> {{x, y}, {y, z}, {z, x}}, #] &, Graph[{1 \[DirectedEdge] 2, 1 \[DirectedEdge] 3, 2 \[DirectedEdge] 3, 1 \[DirectedEdge] 4, 3 \[DirectedEdge] 4, 3 \[DirectedEdge] 5, 4 \[DirectedEdge] 5, 5 \[DirectedEdge] 2}], 3]

Among larger rules, many still preserve planarity. But for example, {{x,y},{x,z}}{{x,z},{x,w},{y,w},{z,w}} does not, since it transforms the planar graph to the nonplanar one: In general, a graph is planar so long as it does not contain as a subgraph either of 

{CompleteGraph[{3, 3}, Sequence[ VertexStyle -> ResourceFunction["WolframPhysicsProjectStyleData"][ "SpatialGraph", "VertexStyle"], EdgeStyle -> ResourceFunction["WolframPhysicsProjectStyleData"][ "SpatialGraph", "EdgeLineStyle"]]], CompleteGraph[{5}, Sequence[ VertexStyle -> ResourceFunction["WolframPhysicsProjectStyleData"][ "SpatialGraph", "VertexStyle"], EdgeStyle -> ResourceFunction["WolframPhysicsProjectStyleData"][ "SpatialGraph", "EdgeLineStyle"]]]}

so a rule preserves planarity if (and only if) it never generates either of these subgraphs.

Planarity is one of a class of properties of graphs that are preserved under deletion of vertices and edges, and contraction of edges. Another such property is whether a graph can be drawn without crossings on a 2D surface of any specific genus g . It turns out  that for any such property it is known that there are in principle only a finite number of subgraphs that can “obstruct” the propertyso if a rule never generates any of these, it must preserve the property.