In[]:=
lineGraph[g_]:=With[{edges=DeleteDuplicates@Catenate[(v|->DirectedEdge@@@Tuples[{Catenate[EdgeList[g,DirectedEdge[_,v,___]]&/@VertexInComponent[g,v,{1}]],Catenate[EdgeList[g,DirectedEdge[v,__]]&/@VertexOutComponent[g,v,{1}]]}])/@VertexList[g]]},Graph[EdgeList[g],edges,VertexStyleAnnotationValue[g,EdgeStyle],VertexLabelsAnnotationValue[g,EdgeLabels]]]
In[]:=
With[{g=ResourceFunction["NestGraphTagged"][v|->{2v+1,Map[If[EvenQ[#],#/2,#+1]&,v]},{{1,0}},4,"StateLabeling"->True,EdgeLabels"Index",EdgeLabelStyleDirective[Bold,13]]},{g,lineGraph[g]}]
Out[]=
,
In[]:=
With[{g=ResourceFunction["NestGraphTagged"][v|->{2v,v+1},{1},4,"StateLabeling"->True,EdgeLabels"Index",EdgeLabelStyleDirective[Bold,13]]},{g,lineGraph[g]}]
Out[]=
,
With[{g=ResourceFunction["NestGraphTagged"][v|->{2v+1,Map[If[EvenQ[#],#/2,#+1]&,v]},{{1,0}},4,"StateLabeling"->True,EdgeLabels"Index",EdgeLabelStyleDirective[Bold,13]]},{g,lineGraph[g]}]
[New version of Nik’s code]
[New version of Nik’s code]
In[]:=
lineGraph[g_,opts:OptionsPattern[Graph]]:=With[{edges=DeleteDuplicates@Catenate[(v|->DirectedEdge@@@Tuples[{Catenate[EdgeList[g,DirectedEdge[_,v,___]]&/@VertexInComponent[g,v,{1}]],Catenate[EdgeList[g,DirectedEdge[v,__]]&/@VertexOutComponent[g,v,{1}]]}])/@VertexList[g]]},Graph[EdgeList[g],edges,VertexStyleAnnotationValue[g,EdgeStyle],VertexLabelsAnnotationValue[g,EdgeLabels],VertexLabelStyleAnnotationValue[g,EdgeLabelStyle],opts]]
In[]:=
g=ResourceFunction["NestGraphTagged"][v|->{2v+1,Map[If[EvenQ[#],#/2,#+1]&,v]},{{1,0}},2,EdgeLabels"Index",EdgeLabelStyleDirective[Bold,13],VertexLabels->Automatic]GraphicsRow[{lineGraph[%,PlotLabel->"Correct"],LineGraph[%,PlotLabel"Incorrect"]}]
Out[]=
ResourceFunction["NestGraphTagged"][v|->{2v+1,Map[If[EvenQ[#],#/2,#+1]&,v]},{{1,0}},2]
Apply[{a,b}|->{If[EvenQ[a],{a/2,b},{a,b+1}],If[Divisible[b,3],{a,b/3},{3a,b}]}]
v|->{a.v,b.v}
This consumes both elements...
Case 1: the different elements of v are operated on separately
Case 2: what’s done to one element depends on the value of the other (( this could operate on a single element at a time, but with context dependence ))
Case 3: one picks up some subset of the elements [ cf token-event graph ]
{a_,b_}:>If[a>b,{a-(2(a-b)),b},{a,b-2(b-a)}]
Rule of value transformation, rule of causal dependence
In[]:=
TokenEventGraph[{{n_}:>{n+1},{n_}:>{2n}},{1},4]
Out[]=
In an ordinary TEG, there are no states, only tokens.....
The update rule can either for “floating tokens”, or for tokens collected into a particular state
The update rule can either for “floating tokens”, or for tokens collected into a particular state
In the hypergraph case, the question of whether the tokens have to be in a particular state is the question of whether tokens on different branches of history can interact....
This is standard causal graph vs. multiway causal graph
[Standard TEG always looks at all histories...]
This is standard causal graph vs. multiway causal graph
[Standard TEG always looks at all histories...]
Numerical case: if we have a fixed number of tokens per state ... [ where do the event happen in the universe? ] [ even in a string, the coordinates are not as fixed ]
Numerical case: if we have a fixed number of tokens per state ... [ where do the event happen in the universe? ] [ even in a string, the coordinates are not as fixed ]
{a,b,c,d}
TokenEventGraph[{{n_,m_}:>{n+m},{n_,m_}:>{2Min[n,m]}},{1,1},5]
In[]:=
TokenEventGraph[{{n_,m_}:>{n+m}},{1,2},4]
Out[]=
What is needed is list list rule, in which we have a way to trace causality...
What is needed is list list rule, in which we have a way to trace causality...
Causality is usually traced by the identity of atoms .... but all 1s are the same.... [ here we have values ]
Instead, we must trace causality by list position......
Here, there’s action in position 1 that’s separate from position 2....
Multiplication and addition:
E.g. digits in base ...