The data structure for g is a list of the form {{x,y,z},{a,b,c}} for each node. Here {x,y,z} are the coordinates of the node, and {a,b,c} are the nodes that have edges coming from this one. The network is drawn on the surface of a sphere of radius 1.
TrivalentFractal[g_,n_]:=With{numpoints=100},​​ Ifn==0,​​ Graphics3DAbsolutePointSize[1.2],AbsoluteThickness[.25],MapIndexedFunction{y,z},Point[y〚1〛],Functionx,Ifx>First[z],Withgap=
1
Ceiling[numpoints
#.#
]
&[y〚1〛-g〚x,1〛],TableLine
#
#.#
&/@{iy〚1〛+(1-i)g〚x,1〛,(i-gap)y〚1〛+(1-i+gap)g〚x,1〛},{i,gap,1,gap},{}/@y2,g,AspectRatio->Automatic,Boxed->False,ViewPoint->{-1,0,0}​​ ,TrivalentFractal​​ Flatten​​ MapIndexed​​ MapIndexedFunction{x,y},
#
#.#
&
2
3
#1+
1
3
gx,1,​​ Functionz,​​ Ifz==First[y],​​ 3(x-1)+Position[g〚x,2〛,First[#2]]1,1,​​ 3*(First[#2]-1)+z​​ /@{1,2,3}​​ ,#12&​​ ,g​​ ,1​​ ,n-1
This is the initial state of the fractal network.
TrivalentFractalInitialState={N[{0,0,1}],{2,3,4}},N
3
2
,0,
-1
2
,{1,3,4},N-
3
4
,
3
4
,
-1
2
,{1,2,4},N-
3
4
,-
3
4
,
-1
2
,{1,2,3};
This code displays a specified state of the network.
Show[TrivalentFractal[TrivalentFractalInitialState,4],AspectRatio->Automatic,Boxed->False,ViewPoint->{-1,0,0}];
Show[TrivalentFractal[TrivalentFractalInitialState,2],AspectRatio->Automatic,Boxed->False,ViewPoint->{-1,0,0}];
Table[TrivalentFractal[TrivalentFractalInitialState,i],{i,0,3}];
Show[GraphicsRow[%]];