In[]:=
MultiwayGrowthListHashSet[rule_,init_List,t_]:=Last/@NestList[Function[s, {Join[First[s],#],#}&[Module[{list,hashSet}, Normal[CreateDataStructure["HashSet"]["Union",Flatten[StringReplaceList[Last[s],rule]]]["Complement",First[s]]]]]],{{},init},t]
In[]:=
MultiwayGrowthListHashSet[{"A""AB","BB""A"},{"A"},6]
Out[]=
{{A},{AB},{ABB},{AA,ABBB},{ABBBB,ABA,AAB},{ABAB,ABBA,AABB,ABBBBB},{AABBB,ABBAB,ABBBA,ABBBBBB,AAA,ABABB}}
In[]:=
MultiwayGrowthListHashSet[{"A""AB","BB""A"},{"A"},10];//AbsoluteTiming
Out[]=
{0.000432,Null}
In[]:=
MultiwayGrowthListHashSet[{"A""AB","BB""A"},{"A"},15];//AbsoluteTiming
Out[]=
{0.002715,Null}
In[]:=
ResourceFunction["MultiwaySystem"][{"A""AB","BB""A"},{"A"},10];//AbsoluteTiming
Out[]=
{0.00274,Null}
In[]:=
ResourceFunction["MultiwaySystem"][{"A""AB","BB""A"},{"A"},15];//AbsoluteTiming
Out[]=
{0.022675,Null}
In[]:=
ListPlot[Catenate[MapIndexed[{First[#2],StringLength[#]}&,MultiwayGrowthListHashSet[{"A""AB","BB""A"},{"A"},10],{2}]]]
Out[]=
Note: should plot multiway system paths like this...
Note: should plot multiway system paths like this...
In[]:=
SizeMWGraph[rule_,init_String,t_]:=With[{g=ResourceFunction["MultiwaySystem"][rule,{init},t,"StatesGraph"]},Graph[g,VertexCoordinates((#{StringLength[#],-GraphDistance[g,init,#]})&/@VertexList[g])]]
In[]:=
SizeMWGraphStructure[rule_,init_String,t_]:=With[{g=ResourceFunction["MultiwaySystem"][rule,{init},t,"StatesGraphStructure"]},Graph[g,VertexCoordinates((#{StringLength[#],-GraphDistance[g,init,#]})&/@VertexList[g])]]
In[]:=
ResourceFunction["MultiwaySystem"][{"A""AB","BB""A"},{"A"},5,"StatesGraphStructure"]
Out[]=
In[]:=
SizeMWGraph[{"A""AB","BB""A"},"A",5]
Out[]=
In[]:=
SizeMWGraph[{"A""AB","BB""A"},"A",8]
Out[]=
NKS examples
NKS examples
In[]:=
SizeMWGraph[#,"B",8]&/@{{"B""BB","BB""B"},{"B""AA","AA""AB"},{"B""ABA","A"""},{"B""BB","BB""A"},{"B""ABA","AA""B","BB""A"},{"B""ABA","AA""B","BB""AB"},{"B""BAB","ABAB""B","BB""AA"},{"B""BA","BAA""ABB","BAB""B"}}
Out[]=
,
,
,
,
,
,
,
In[]:=
SizeMWGraphStructure[#,"B",8]&/@{{"B""BB","BB""B"},{"B""AA","AA""AB"},{"B""ABA","A"""},{"B""BB","BB""A"},{"B""ABA","AA""B","BB""A"},{"B""ABA","AA""B","BB""AB"},{"B""BAB","ABAB""B","BB""AA"},{"B""BA","BAA""ABB","BAB""B"}}
Out[]=
,
,
,
,
,
,
,
In[]:=
SizeMWGraphStructure[{"B""BA","BAA""ABB","BAB""B"},"B",15]
Out[]=
Search for short strings after long times
Search for short strings after long times
Other initial condition:
More colors