# Wolfram Function Repository

Instant-use add-on functions for the Wolfram Language

Function Repository Resource:

Generate a graph of branch pair ancestry for a string substitution "glocal" (hybrid of global and local) multiway system

Contributed by:
Jonathan Gorard

ResourceFunction["StringGlocalBranchialGraph"][ generates the graph of branch pair ancestry after | |

ResourceFunction["StringGlocalBranchialGraph"][ uses the function |

Glocal multiway systems combine the global events (and the corresponding causal structure) of ordinary multiway systems, with the individual token philosophy of local multiway systems. A single event vertex in the evolution causal graph (or token event graph) for a glocal multiway system will, in general, have many incoming and outgoing evolution edges, corresponding to the fact that several tokens must be assembled together in order to reconstruct a single global input or output state for the event.

The branchial graph for a glocal multiway system shows the branch pair (i.e. critical pair) ancestry for a glocal evolution causal graph/token event graph. Unlike the branchial graph for an ordinary (global) multiway system, which only contains information regarding the evolution ancestry of states, glocal branchial graphs contain information about both the causal ancestry of events and the evolution ancestry of states/tokens.

Argument and option patterns for StringGlocalMultiwaySystem are similar to those of the resource function MultiwaySystem.

Replacement rules for a string substitution system are specified as {"*lhs*_{1}"→"*rhs*_{1}","*lhs*_{2}"→"*rhs*_{2}",…}.

ResourceFunction["StringGlocalBranchialGraph"] accepts both individual rules and lists of rules, and likewise for initial conditions. ResourceFunction["StringGlocalBranchialGraph"][*rules*,"*string*",*n*] is interpreted as ResourceFunction["StringGlocalBranchialGraph"][*rules*,{"*string*"},*n*], etc.

The event selection function *sel* in ResourceFunction["StringGlocalBranchialGraph"][*rules*→*sel*,…] can have the following special forms:

"Sequential" | applies the first possible replacement (sequential substitution system) |

"Random" | applies a random replacement |

{"Random",n} | applies n randomly chosen replacements |

"MaxScan" | applies the maximal set of spatially separated replacements |

Duplicated tokens are displayed separately at each time step by default, although this can be overridden by setting "DeduplicateTokens"→True.

Events are represented in the form {*rule*,*input*,*rest*}, where *rule* is the rule used in the updating event, *input* is the part of the state to which the rule is applied and *rest* is the remainder of the state. For substitution systems, *rest* is given in the form {*prefix*,*suffix*}.

Options for ResourceFunction["StringGlocalBranchialGraph"] include:

"DeduplicateTokens" | False | whether to merge all instances of equivalent tokens that appear at each time step |

"VertexRendering" | True | whether to use special rendering for state/token and event vertices |

"StateRenderingFunction" | Automatic | how to label states/tokens that appear in the evolution causal graph/token event graph |

"EventRenderingFunction" | Automatic | how to label events that appear in the evolution causal graph/token event graph |

All of the standard options for the Graph function can also be applied to ResourceFunction["StringGlocalBranchialGraph"].

Possible settings for "StateRenderingFunction" and "EventRenderingFunction" include:

Automatic | make a label from the name of the vertex |

Inherited | use the explicit vertex name as the label |

None | use no label for the vertex |

"string" | use a shape from the VertexShapeFunction collection |

func | apply the function func to the name of the vertex |

Generate glocal branchial graphs for two simple string substitution evolutions:

In[1]:= |

Out[1]= |

In[2]:= |

Out[2]= |

Show just the structure of the graphs, without labels:

In[3]:= |

Out[3]= |

In[4]:= |

Out[4]= |

Generate a glocal branchial graph for a more complicated string substitution evolution:

In[5]:= |

Out[5]= |

Show just the structure of the graph, without labels:

In[6]:= |

Out[6]= |

Merge all instances of equivalent tokens that appear at each time step:

In[7]:= |

Out[7]= |

Run the system for more steps:

In[8]:= |

Out[8]= |

Show just the structure of the graphs, without labels:

In[9]:= |

Out[9]= |

In[10]:= |

Out[10]= |

Specify an event selection function that picks only up to two events at each step:

In[11]:= |

Out[11]= |

StringGlocalBranchialGraph accepts both individual rules and lists of rules:

In[12]:= |

Out[12]= |

In[13]:= |

Out[13]= |

Likewise for initial conditions:

In[14]:= |

Out[14]= |

Apply only the first possible event at each step:

In[15]:= |

Out[15]= |

Apply the first and last possible events at each step:

In[16]:= |

Out[16]= |

Use a greedy-style algorithm to apply the maximal set of non-conflicting events at each step:

In[17]:= |

Out[17]= |

Compare this to the full branchial graph for the unrestricted glocal multiway evolution:

In[18]:= |

Out[18]= |

By default, equivalent tokens remain unmerged at each time step:

In[19]:= |

Out[19]= |

Merging of equivalent tokens at each time step can be enforced using the option "DeduplicateTokens":

In[20]:= |

Out[20]= |

By default, state/token vertices and event vertices use special rendering (inherited from the MultiwaySystem resource function):

In[21]:= |

Out[21]= |

This rendering can be disabled using the option "VertexRendering":

In[22]:= |

Out[22]= |

By default, states/tokens are labeled by their contents:

In[23]:= |

Out[23]= |

Use no labeling for states/tokens:

In[24]:= |

Out[24]= |

Use raw state/token names as vertex labels:

In[25]:= |

Out[25]= |

Use a named shape as each state/token label:

In[26]:= |

Out[26]= |

By default, both states/tokens and events are labeled by their contents:

In[27]:= |

Out[27]= |

Use no labeling for states/tokens:

In[28]:= |

Out[28]= |

Also use no labeling for events:

In[29]:= |

Out[29]= |

Disabling vertex rendering yields an equivalent result:

In[30]:= |

Out[30]= |

Use raw event expressions as their labels:

In[31]:= |

Out[31]= |

Generate an example glocal branchial graph based on page 209 of *A New Kind of Science*:

In[32]:= |

Out[32]= |

Force a spring embedding (as opposed to the default spring electrical embedding):

In[33]:= |

Out[33]= |

- The Wolfram Physics Project
- Stephen Wolfram's A New Kind of Science | Online
- Multiway System–Wolfram MathWorld

- 1.0.0 – 26 October 2021

This work is licensed under a Creative Commons Attribution 4.0 International License