In[]:=
Graph[NestGraphTagged[n{2n,n+1},{0},10,{Red,Blue}],GraphLayout"CircularEmbedding"]
Out[]=
In[]:=
Graph[NestGraphTagged[n{2n,n+1},{0},11,{Red,Blue}],GraphLayout"CircularEmbedding"]
Out[]=
Fibonacci
Fibonacci
In[]:=
Graph[NestGraphTagged[nIf[n<2,{1},{n-1,n-2}],{10},11,{Red,Blue}],VertexLabelsAutomatic]
Out[]=
In[]:=
MIMWGraph[{{f[n_]/;n>2}:>{f[n-1],f[n-2]}},{f[7]},4,UniqueTokens->True,Overlaps->True,VertexLabeling->True]
Out[]=
[ The following is probably wrong ... ]
[ The following is probably wrong ... ]
In[]:=
NestGraphStepUnique[fun_,{nodessofar_,edgesofar_,newnodes_}]:={Join[nodessofar,newnodes],Union[Flatten[Union[edgesofar,Function[n,MapIndexed[DirectedEdge[n,#1,First[#2]]&,fun[n]]]/@newnodes]]],Join[Flatten[fun/@newnodes],nodessofar]}
In[]:=
NestGraphTaggedUnique[fun_,init_List,t_Integer]:=Graph[Nest[NestGraphStepUnique[fun,#]&,{{},{},init},t][[2]]]
In[]:=
NestGraphTaggedUnique[fun_,init_List,t_Integer,styles_]:=With[{g=NestGraphTaggedUnique[fun,init,t]},Graph[Style[#[[1]],#[[2]]]&/@Transpose[{EdgeList[g],styles[[EdgeTags[g]]]}]]]
In[]:=
Graph[NestGraphTaggedUnique[nIf[n<2,{1},{n-1,n-2}],{5},4,{Red,Blue}],VertexLabelsAutomatic]
Out[]=
Graph[NestGraphTaggedUnique[nIf[n<2,{1},{n-1,n-2}],{5},4,{Red,Blue}],VertexLabelsAutomatic]
In[]:=
Graph[NestGraphTaggedUnique[nIf[n<2,{1},{n-1,n-2}],{6},11,{Red,Blue}],VertexLabelsAutomatic]
Out[]=
[V12.x bug in NestGraph: ]
Other terminating recursions
Other terminating recursions
I.e. this is a 5D hypercube....
As soon as a tentacle reaches k 2^n it makes a grid....
Floor[n/2] is equivalent to n/2 until you run out of powers of 2....
Commuting operations
Commuting operations