In[]:=
With[{gg=Graph[ResourceFunction["WolframModel"][{{x,y,z},{x,u,v}}{{y,x,w},{w,u,s},{v,z,u}},Automatic,20,"LayeredCausalGraph"]]},HighlightGraph[gg,{Style[Subgraph[gg,VertexOutComponent[gg,#,10]],Red,Thick]},ImageSize300]]&/@{13,16}
Out[]=
In[]:=
Table[Framed[Graph[CausalConnectionGraph[ResourceFunction["WolframModel"][{{x,y,z},{x,u,v}}{{y,x,w},{w,u,s},{v,z,u}},Automatic,#,"LayeredCausalGraph"]&,t0,t1],ImageSize{120,30},VertexSize.2],FrameStyleLightGray],{t0,6},{t1,t0,6}]
Out[]=
In[]:=
Table[Framed[Graph[CausalConnectionGraph[ResourceFunction["WolframModel"][{{x,y,z},{x,u,v}}{{y,x,w},{w,u,s},{v,z,u}},Automatic,#,"LayeredCausalGraph"]&,t0,t1],ImageSize{120,30},VertexSize.2],FrameStyleLightGray],{t0,6,8},{t1,t0,10}]
Out[]=
In[]:=
Table[Framed[Graph[CausalConnectionGraph[ResourceFunction["WolframModel"][{{x,y,z},{x,u,v}}{{y,x,w},{w,u,s},{v,z,u}},Automatic,#,"LayeredCausalGraph"]&,t0,6],ImageSize{120,30},VertexSize.2],FrameStyleLightGray],{t0,2,6}]
Out[]=
In[]:=
ggg=ResourceFunction["WolframModel"][{{x,y,z},{x,u,v}}{{y,x,w},{w,u,s},{v,z,u}},Automatic,20,"LayeredCausalGraph"]
Out[]=
In[]:=
VertexOutDegree[ggg]
Out[]=
{3,3,3,3,3,3,3,3,1,3,3,1,1,2,2,1,1,2,2,1,1,3,0,3,1,2,2,1,2,1,0}
Basic DeadEnds Code
Basic DeadEnds Code
In[]:=
FindDeadEnds[fun_,t_Integer]:=Intersection[Flatten[Position[VertexOutDegree[fun[t+1]],0]],Flatten[Position[VertexOutDegree[fun[t]],0]]]
In[]:=
FindDeadEnds[ResourceFunction["WolframModel"][{{x,y,z},{x,u,v}}{{y,x,w},{w,u,s},{v,z,u}},Automatic,#,"LayeredCausalGraph"]&,20]
Out[]=
{23,31}
In[]:=
rules=Import["https://www.wolframcloud.com/obj/wolframphysics/Data/RuleEnumerations/22-32c.wxf"];
In[]:=
ResourceFunction["ParallelMapMonitored"][Function[ru,TimeConstrained[FindDeadEnds[ResourceFunction["WolframModel"][ru,Automatic,#,"LayeredCausalGraph"]&,10],5]],Take[rules,10]]
Out[]=
{{},{},{},{1},{1},{1},{1},{1},{1},{1}}
In[]:=
ResourceFunction["ParallelMapMonitored"][Function[ru,TimeConstrained[FindDeadEnds[ResourceFunction["WolframModel"][ru,Automatic,#,"LayeredCausalGraph"]&,10],5]],rules]
Out[]=
In[]:=
Counts[Length/@%]
Out[]=
02871,11760,255,33,413
In[]:=
FindDeadEndsX[fun_,t_Integer]:=Module[{u},{Intersection[Flatten[Position[VertexOutDegree[u=fun[t+1]],0]],Flatten[Position[VertexOutDegree[fun[t]],0]]],VertexCount[u]}]
In[]:=
ResourceFunction["ParallelMapMonitored"][Function[ru,TimeConstrained[FindDeadEndsX[ResourceFunction["WolframModel"][ru,Automatic,#,"LayeredCausalGraph"]&,10],5]],rules]
Out[]=
In[]:=
Cases[%,{{_},x_}x]
Out[]=
In[]:=
Cases[%250,{{_,_},x_}x]
Out[]=
{4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,8,4,4,6,4,4,4,4,4,4,4,4,6,4,4,8,38,28,7,5,4,4,4,4,4,4,40,31,8,5,31,40,5,30,8,37,6}
In[]:=
Cases[%250,{{_,_,_},x_}x]