Function Repository Resource:

WolframModelGlocalBranchialGraph

Source Notebook

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

Contributed by: Jonathan Gorard

ResourceFunction["WolframModelGlocalBranchialGraph"][rules,init,n]

generates the graph of branch pair ancestry after n steps in the glocal multiway evolution of a Wolfram model system with the specified rules, starting from initial conditions init.

ResourceFunction["WolframModelGlocalBranchialGraph"][rulessel,init,n]

uses the function sel to select which of the events obtained at each step to include in the evolution.

Details and Options

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 ResourceFunction["WolframModelGlocalBranchialGraph"] are similar to those of the resource function MultiwaySystem.
Replacement rules for Wolfram model systems are specified as {{{a1,a2,},{b1,b2,},}{{u1,u2,},},}.
ResourceFunction["WolframModelGlocalBranchialGraph"] accepts both individual rules and lists of rules, and likewise for initial conditions. ResourceFunction["WolframModelGlocalBranchialGraph"][rules,init,n] is interpreted as ResourceFunction["WolframModelGlocalBranchialGraph"][rules,{init},n], etc.
The event selection function sel in ResourceFunction["WolframModelGlocalBranchialGraph"][rulessel,] 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
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 instantiated 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 hypergraph substitution systems, rest is given in the form {prefix,suffix}.
Options for ResourceFunction["WolframModelGlocalBranchialGraph"] include:
"DeduplicateTokens"Falsewhether to merge all instances of equivalent tokens that appear at each time step
"VertexRendering"Truewhether to use special rendering for state/token and event vertices
"StateRenderingFunction"Automatichow to label states/tokens that appear in the evolution causal graph/token event graph
"EventRenderingFunction"Automatichow to label events that appear in the evolution causal graph/token event graph
All of the standard options for Graph can also be applied to ResourceFunction["WolframModelGlocalBranchialGraph"].
Possible settings for "StateRenderingFunction" and "EventRenderingFunction" include:
Automaticmake a label from the name of the vertex
Inheriteduse the explicit vertex name as the label
Noneuse no label for the vertex
"string"use a shape from the VertexShapeFunction collection
funcapply the function func to the name of the vertex

Examples

Basic Examples (3) 

Generate glocal branchial graphs for two simple Wolfram model glocal multiway systems:

In[1]:=
ResourceFunction[
 "WolframModelGlocalBranchialGraph"][{{x, y}} -> {{x, y}, {y, z}}, {{1, 2}, {2, 3}}, 2, VertexSize -> 2]
Out[1]=
In[2]:=
ResourceFunction[
 "WolframModelGlocalBranchialGraph"][{{{1, 1, 2}} -> {{2, 2, 1}, {2, 3, 2}, {1, 2, 3}}, {{1, 2, 1}, {3, 4, 2}} -> {{4, 3, 2}}}, {{{1, 1, 1}, {2, 2, 2}}}, 2, VertexSize -> 2]
Out[2]=

Show just the structure of the graphs, without labels:

In[3]:=
ResourceFunction[
 "WolframModelGlocalBranchialGraph"][{{x, y}} -> {{x, y}, {y, z}}, {{1, 2}, {2, 3}}, 2, "VertexRendering" -> False]
Out[3]=
In[4]:=
ResourceFunction[
 "WolframModelGlocalBranchialGraph"][{{{1, 1, 2}} -> {{2, 2, 1}, {2, 3, 2}, {1, 2, 3}}, {{1, 2, 1}, {3, 4, 2}} -> {{4, 3, 2}}}, {{{1, 1, 1}, {2, 2, 2}}}, 2, "VertexRendering" -> False]
Out[4]=

Generate a glocal branchial graph for a more complicated Wolfram model evolution:

In[5]:=
ResourceFunction[
 "WolframModelGlocalBranchialGraph"][{{x, y}, {x, z}} -> {{x, z}, {x, w}, {y, w}, {z, w}}, {{0, 1}, {0, 2}, {0, 3}}, 2, VertexSize -> 8]
Out[5]=

Show just the structure of the graph, without labels:

In[6]:=
ResourceFunction[
 "WolframModelGlocalBranchialGraph"][{{x, y}, {x, z}} -> {{x, z}, {x, w}, {y, w}, {z, w}}, {{0, 1}, {0, 2}, {0, 3}}, 2, "VertexRendering" -> False]
Out[6]=

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

In[7]:=
ResourceFunction[
 "WolframModelGlocalBranchialGraph"][{{x, y}, {x, z}} -> {{x, z}, {x, w}, {y, w}, {z, w}}, {{0, 1}, {0, 2}, {0, 3}}, 2, "DeduplicateTokens" -> True, VertexSize -> 1]
Out[7]=

Run the system for more steps:

In[8]:=
ResourceFunction[
 "WolframModelGlocalBranchialGraph"][{{x, y}, {x, z}} -> {{x, z}, {x, w}, {y, w}, {z, w}}, {{0, 1}, {0, 2}, {0, 3}}, 3, "DeduplicateTokens" -> True, VertexSize -> 2]
Out[8]=

Show just the structure of the graphs, without labels:

In[9]:=
ResourceFunction[
 "WolframModelGlocalBranchialGraph"][{{x, y}, {x, z}} -> {{x, z}, {x, w}, {y, w}, {z, w}}, {{0, 1}, {0, 2}, {0, 3}}, 2, "DeduplicateTokens" -> True, "VertexRendering" -> False]
Out[9]=
In[10]:=
ResourceFunction[
 "WolframModelGlocalBranchialGraph"][{{x, y}, {x, z}} -> {{x, z}, {x, w}, {y, w}, {z, w}}, {{0, 1}, {0, 2}, {0, 3}}, 3, "DeduplicateTokens" -> True, "VertexRendering" -> False]
Out[10]=

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

In[11]:=
ResourceFunction[
 "WolframModelGlocalBranchialGraph"][({{x, y}, {x, z}} -> {{x, z}, {x,
       w}, {y, w}, {z, w}}) -> (Take[#, UpTo[2]] &), {{0, 0}, {0, 0}}, 3, VertexSize -> 2]
Out[11]=

Scope (5) 

Rules and Initial Conditions (2) 

WolframModelGlocalBranchialGraph accepts both individual rules and lists of rules:

In[12]:=
ResourceFunction[
 "WolframModelGlocalBranchialGraph"][{{1, 1, 2}} -> {{2, 2, 1}, {2, 3,
     2}, {1, 2, 3}}, {{1, 1, 1}}, 3, VertexSize -> 2]
Out[12]=
In[13]:=
ResourceFunction[
 "WolframModelGlocalBranchialGraph"][{{{1, 1, 2}} -> {{2, 2, 1}, {2, 3, 2}, {1, 2, 3}}, {{1, 2, 1}, {3, 4, 2}} -> {{4, 3, 2}}}, {{1, 1, 1}}, 3, VertexSize -> 2]
Out[13]=

Likewise for initial conditions:

In[14]:=
ResourceFunction[
 "WolframModelGlocalBranchialGraph"][{{1, 1, 2}} -> {{2, 2, 1}, {2, 3,
     2}, {1, 2, 3}}, {{{1, 1, 1}}, {{1, 1, 1}, {2, 2, 2}}}, 2, VertexSize -> 2]
Out[14]=

Event Selection Function (3) 

Apply only the first possible event at each step:

In[15]:=
ResourceFunction[
 "WolframModelGlocalBranchialGraph"][({{x, y}, {x, z}} -> {{x, z}, {x,
       w}, {y, w}, {z, w}}) -> "Sequential", {{0, 0}, {0, 0}}, 3, VertexSize -> 1]
Out[15]=

Apply the first and last possible events at each step:

In[16]:=
ResourceFunction[
 "WolframModelGlocalBranchialGraph"][({{x, y}, {x, z}} -> {{x, z}, {x,
       w}, {y, w}, {z, w}}) -> ({First[#], Last[#]} &), {{0, 0}, {0, 0}}, 3, VertexSize -> 1]
Out[16]=

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

In[17]:=
ResourceFunction[
 "WolframModelGlocalBranchialGraph"][{{x, y}, {x, z}} -> {{x, z}, {x, w}, {y, w}, {z, w}}, {{0, 0}, {0, 0}}, 2, VertexSize -> 4]
Out[17]=

Options (15) 

DeduplicateTokens (2) 

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

In[18]:=
ResourceFunction[
 "WolframModelGlocalBranchialGraph"][{{1, 1, 2}} -> {{2, 2, 1}, {2, 3,
     2}, {1, 2, 3}}, {{1, 1, 1}}, 3, VertexSize -> 2]
Out[18]=

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

In[19]:=
ResourceFunction[
 "WolframModelGlocalBranchialGraph"][{{1, 1, 2}} -> {{2, 2, 1}, {2, 3,
     2}, {1, 2, 3}}, {{1, 1, 1}}, 3, "DeduplicateTokens" -> True, VertexSize -> 2]
Out[19]=

VertexRendering (2) 

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

In[20]:=
ResourceFunction[
 "WolframModelGlocalBranchialGraph"][{{x, y}} -> {{x, y}, {y, z}}, {{1, 2}}, 3, VertexSize -> 2]
Out[20]=

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

In[21]:=
ResourceFunction[
 "WolframModelGlocalBranchialGraph"][{{x, y}} -> {{x, y}, {y, z}}, {{1, 2}}, 3, "VertexRendering" -> False]
Out[21]=

StateRenderingFunction (4) 

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

In[22]:=
ResourceFunction[
 "WolframModelGlocalBranchialGraph"][{{x, y}, {x, z}} -> {{x, z}, {x, w}, {y, w}, {z, w}}, {{0, 0}, {0, 0}}, 2, VertexSize -> 3]
Out[22]=

Use no labeling for states/tokens:

In[23]:=
ResourceFunction[
 "WolframModelGlocalBranchialGraph"][{{x, y}, {x, z}} -> {{x, z}, {x, w}, {y, w}, {z, w}}, {{0, 0}, {0, 0}}, 2, "StateRenderingFunction" -> None, VertexSize -> 3]
Out[23]=

Use raw state/token names as vertex labels:

In[24]:=
ResourceFunction[
 "WolframModelGlocalBranchialGraph"][{{x, y}, {x, z}} -> {{x, z}, {x, w}, {y, w}, {z, w}}, {{0, 0}, {0, 0}}, 2, "StateRenderingFunction" -> Inherited, VertexSize -> 3]
Out[24]=

Use a named shape as each state/token label:

In[25]:=
ResourceFunction[
 "WolframModelGlocalBranchialGraph"][{{x, y}, {x, z}} -> {{x, z}, {x, w}, {y, w}, {z, w}}, {{0, 0}, {0, 0}}, 2, "StateRenderingFunction" -> "Square", VertexSize -> 3]
Out[25]=

EventRenderingFunction (5) 

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

In[26]:=
ResourceFunction[
 "WolframModelGlocalBranchialGraph"][{{1, 1, 2}} -> {{2, 2, 1}, {2, 3,
     2}, {1, 2, 3}}, {{1, 1, 1}}, 3, VertexSize -> 2]
Out[26]=

Use no labeling for states/tokens:

In[27]:=
ResourceFunction[
 "WolframModelGlocalBranchialGraph"][{{1, 1, 2}} -> {{2, 2, 1}, {2, 3,
     2}, {1, 2, 3}}, {{1, 1, 1}}, 3, "StateRenderingFunction" -> None,
  VertexSize -> 2]
Out[27]=

Also use no labeling for events:

In[28]:=
ResourceFunction[
 "WolframModelGlocalBranchialGraph"][{{1, 1, 2}} -> {{2, 2, 1}, {2, 3,
     2}, {1, 2, 3}}, {{1, 1, 1}}, 3, "StateRenderingFunction" -> None,
  "EventRenderingFunction" -> None]
Out[28]=

Disabling vertex rendering yields an equivalent result:

In[29]:=
ResourceFunction[
 "WolframModelGlocalBranchialGraph"][{{1, 1, 2}} -> {{2, 2, 1}, {2, 3,
     2}, {1, 2, 3}}, {{1, 1, 1}}, 3, "VertexRendering" -> False]
Out[29]=

Use raw event expressions as their labels:

In[30]:=
ResourceFunction[
 "WolframModelGlocalBranchialGraph"][{{1, 1, 2}} -> {{2, 2, 1}, {2, 3,
     2}, {1, 2, 3}}, {{1, 1, 1}}, 3, "StateRenderingFunction" -> None,
  "EventRenderingFunction" -> Inherited]
Out[30]=

GraphLayout (2) 

Generate an example glocal multiway evolution:

In[31]:=
ResourceFunction[
 "WolframModelGlocalBranchialGraph"][{{x, y}, {x, z}} -> {{x, z}, {x, w}, {y, w}, {z, w}}, {{0, 0}, {0, 0}}, 2, VertexSize -> 4]
Out[31]=

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

In[32]:=
ResourceFunction[
 "WolframModelGlocalBranchialGraph"][{{x, y}, {x, z}} -> {{x, z}, {x, w}, {y, w}, {z, w}}, {{0, 0}, {0, 0}}, 2, GraphLayout -> "SpringEmbedding", VertexSize -> 8]
Out[32]=

Publisher

Jonathan Gorard

Version History

  • 1.0.0 – 22 November 2021

Source Metadata

Related Resources

License Information