FusionAtlasPaths={"~/projects/fusionatlas/package/"};
$Path=$Path~Join~FusionAtlasPaths;
<<FusionAtlas`

L=5;

LaTeX output

Off[Unset::norep]

Clear[tree]
tree[g1_,g2_]:=tree[g1,g2]={{g1,g2},Null,Null}//.{{h1_BigraphWithDuals,h2_BigraphWithDuals},Null,Null}:>With[{extensions=((*FindBigraphPairExtensionsUpToDepth[Sqrt[L]+(10.^(-3))][h1,h2,1,"Weeds"->Weeds[{g1,g2}]]=.;*)FindBigraphPairExtensionsUpToDepth[Sqrt[L]+(10.^(-3))][h1,h2,1,"Weeds"->Weeds[{g1,g2}]])},{{h1,h2},Cases[extensions[[1]],p_/;DimensionOfGenerator[p]<Sqrt[L]],{#,Null,Null}&/@Cases[extensions[[2]],p_/;DimensionOfGenerator[p]<Sqrt[L]]}]

tikzTree[{g1_,g2_}]:=
"\\begin{tikzpicture}\n"<>"[
level 1/.style={level distance=46mm, sibling distance=40mm,nodes={draw, fill=white, rectangle, rounded corners}},
level 2/.style={level distance=52mm, sibling distance=20mm},
level 3/.style={level distance=58mm, sibling distance=25mm},
level 4/.style={level distance=64mm},
grow=right]"<>"\\node[draw, fill=white, rectangle, rounded corners] "<>tikzNode[g1,g2,tree[g1,g2]]<>";\n"<>"\\end{tikzpicture}\n"

tikzNode[g1_BigraphWithDuals,g2_BigraphWithDuals,{{h1_BigraphWithDuals,h2_BigraphWithDuals},vines_,leaves_}]:=
If[MemberQ[Weeds[{g1,g2}],{h1,h2}],"[fill=red!30]",""]<>"{$\\begin{array}{c}\\bigraph{"<>GraphToString[h1]<>"}\\\\\\bigraph{"<>GraphToString[h2]<>"}\\end{array}$"<>(*StringJoin@@("\\ref{"<>GraphToString[#[[1]]]<>"}"&/@vines)<>*)"}" <>"\n"<>StringJoin@@("child {node "<>tikzNode[g1,g2,#]<>"}"&/@leaves)

tikzTree[{g1_,g2_}]:=
"\\begin{tikzpicture}\n"<>
"\\tikzset{grow=right,level distance=130pt}\n"<>
"\\tikzset{every tree node/.style={draw,fill=white,rectangle,rounded corners,inner sep=2pt}}\n"<>
"\\Tree"<>
tikzNode[g1,g2,tree[g1,g2]]<>
"\n"<>
"\\end{tikzpicture}\n"

tikzNode[g1_BigraphWithDuals,g2_BigraphWithDuals,{{h1_BigraphWithDuals,h2_BigraphWithDuals},vines_,leaves_}]:=
"\n"<>StringJoin@@(Table["\t",{GraphDepth[h1]-GraphDepth[g1]}])<>"[.\\node"<>
If[MemberQ[Weeds[{g1,g2}],{h1,h2}],"[fill=red!30]",""]<>
"{$\\!\\!\\begin{array}{c}\\bigraph{"<>GraphToString[h1]<>"}\\\\\\bigraph{"<>GraphToString[h2]<>"}\\end{array}\\!\\!$};"<>StringJoin@@(tikzNode[g1,g2,#]&/@leaves)<> "]"

GraphToString[{G1_BigraphWithDuals,G2_BigraphWithDuals}]:="\\left(\\bigraph{"<>GraphToString[G1]<>"}, \\bigraph{"<>GraphToString[G2]<>"}\\right)"

typesetVinesAndWeeds[tag_,{g1_,g2_}]:=Module[{weeds=Weeds[{g1,g2}],vines=Vines[{g1,g2}]},
"\\begin{align*}\n"<>
If[Length[vines]>0,"\\cV_{"<>tag<>"} & = \\Big\\{ "<>GraphToString[vines[[1]]]<>
StringJoin@@(", \\displaybreak[1]\\\\\n & \\qquad" <>GraphToString[#]&/@Rest[vines])<>" \\Big\\}"<>
If[Length[weeds]>0,"\\displaybreak[1]\\\\\n \\intertext{and}\n",""],""]<>
If[Length[weeds]>0,
"\\cW_{"<>tag<>"} & = \\Big\\{ "<>GraphToString[weeds[[1]]]<>
StringJoin@@(", \\displaybreak[1]\\\\\n & \\qquad" <>GraphToString[#]&/@Rest[weeds])<>" \\Big\\}\n",""]<>
"\\end{align*}\n"
]

Initial cases

A3=BigraphWithDuals[GradedBigraph[{{1}},{{1}}],DualData[{1},{1}]];

A4=BigraphWithDuals[GradedBigraph[{{1}},{{1}},{{1}}],DualData[{1},{1}]];

Clear[Weeds,Vines,IgnoredWeeds,KilledWeeds]

Weeds[]={{A3,A3},{A4,A4}};

Weeds[{_,_}]:={}
Vines[{_,_}]:={}

Vines[]={};

Clear[ExtendOneStep]

IgnoredWeeds[]={};

IgnoreWeed[{g1_,g2_}]:=(AppendTo[IgnoredWeeds[],{g1,g2}];Weeds[]=DeleteCases[Weeds[],{g1,g2}];)

KilledWeeds[]={};
KillWeed[{g1_,g2_},reason_String]:=(AppendTo[IgnoredWeeds[],{{g1,g2},reason}];Weeds[]=DeleteCases[Weeds[],{g1,g2}];)

Clear[ExtendOneStep]

ExtendOneStep[{g1_,g2_}]/;MemberQ[Weeds[],{g1,g2}]∧(Weeds[{g1,g2}]==Vines[{g1,g2}]=={}):=ExtendOneStep[{g1,g2}]=Module[{odometer},
odometer=Cases[#,{BigraphWithDuals[g_,_],_}/;DimensionOfGenerator[g]<Sqrt[L]]&/@FindBigraphPairExtensionsUpToDepth[Sqrt[L]+(10.^(-3))][g1,g2,1,"Weeds"->{}];
Vines[{g1,g2}]=odometer[[1]];
Vines[]=Vines[]~Join~Vines[{g1,g2}];
Weeds[{g1,g2}]=odometer[[2]];
Weeds[]=DeleteCases[Weeds[],{g1,g2}]~Join~Weeds[{g1,g2}];
Weeds[{g1,g2}]
]

Clear[RunOdometer]
RunOdometer[{g1_,g2_}]:=RunOdometer[{g1,g2}]=Module[{},
Vines[{g1,g2}]=Complement[Cases[FindBigraphPairExtensionsUpToDepth[Sqrt[L]+(10.^(-3))][g1,g2,∞,"Weeds"->Weeds[{g1,g2}]][[1]],{BigraphWithDuals[g_,_],_}/;DimensionOfGenerator[g]<Sqrt[L]],Weeds[{g1,g2}]];
Vines[]=Vines[]~Join~Vines[{g1,g2}];
Weeds[]=DeleteCases[Weeds[],{g1,g2}]~Join~Weeds[{g1,g2}];
Vines[{g1,g2}]
]

{{A4,A4},(Subscript[Γ, e1]),(Subscript[Γ, e2])}=ExtendOneStep[{A3,A3}]

{{A5,A5},(Subscript[Γ, o1,a]),(Subscript[Γ, o1,b]),(Subscript[Γ, o1,c]),(Subscript[Γ, o2,a]),(Subscript[Γ, o2,b]),(Subscript[Γ, o2,c])}=ExtendOneStep[{A4,A4}]

IgnoreWeed[{A4,A4}];IgnoreWeed[{A5,A5}];

KillWeed[(Subscript[Γ, o1,b]),"Rotational eigenspaces don't match up."];
KillWeed[(Subscript[Γ, o2,b]),"Rotational eigenspaces don't match up."];

DisplayBigraph/@Weeds[]

Triple points

Depth + 2

{DisplayBigraph[#],OddTriplePointObstruction[#],EvenTriplePointObstruction[#]}&/@ExtendOneStep[(Subscript[Γ, o1,a])]

StringJoin@@("    & "<>#<>", \\displaybreak[1]\\notag\\\\\n"&/@GraphToString/@Reverse[SortBy[ExtendOneStep[(Subscript[Γ, o1,a])],TriplePointObstruction]])

Vines[(Subscript[Γ, o1,a])]

{DisplayBigraph[#],OddTriplePointObstruction[#],EvenTriplePointObstruction[#]}&/@ExtendOneStep[(Subscript[Γ, o1,c])]

Sort[{True,False}]

StringJoin@@("    & "<>#<>", \\displaybreak[1]\\notag\\\\\n"&/@GraphToString/@Reverse[SortBy[ExtendOneStep[(Subscript[Γ, o1,c])],TriplePointObstruction]])

Vines[(Subscript[Γ, o1,c])]

{DisplayBigraph[#],OddTriplePointObstruction[#],EvenTriplePointObstruction[#]}&/@ExtendOneStep[(Subscript[Γ, e1])]

Length[DeleteCases[ExtendOneStep[#],g_/;TriplePointObstruction[g]]]&/@{(Subscript[Γ, o1,a]),(Subscript[Γ, o1,c]),(Subscript[Γ, e1])}

StringJoin@@("    & "<>#<>", \\displaybreak[1]\\notag\\\\\n"&/@GraphToString/@Reverse[SortBy[ExtendOneStep[(Subscript[Γ, e1])],TriplePointObstruction]])

Vines[(Subscript[Γ, e1])]

KillWeed[#,"Fails triple point obstruction (even)"]&/@Cases[Weeds[],s_/;!EvenTriplePointObstruction[s]];

KillWeed[#,"Fails triple point obstruction (odd)"]&/@Cases[Weeds[],s_/;!OddTriplePointObstruction[s]];

DisplayBigraph/@Weeds[]

magicNumbers=Table[DimensionOfLowWeightSpace[#[[1,1]]][k],{k,DepthOfBranchPoint[#[[1,1]]]+1,GraphDepth[#[[1,1]]]}]&;

magicNumbers/@Weeds[]

Table[seeds[1,k]=Cases[Weeds[],g_/;MatchQ[magicNumbers[g],{1,k,___}]],{k,-1,2}];

seeds[2]=Cases[Weeds[],g_/;MatchQ[magicNumbers[g],{2,___}]];

DisplayBigraph/@seeds[1,2]

StringJoin@@("    & "<>#<>", \\displaybreak[1]\\\\\n"&/@GraphToString/@seeds[1,2])

DisplayBigraph/@seeds[1,1]

StringJoin@@("    & "<>#<>", \\displaybreak[1]\\\\\n"&/@GraphToString/@seeds[1,1])

DisplayBigraph/@seeds[1,0]

StringJoin@@("    & "<>#<>", \\displaybreak[1]\\\\\n"&/@GraphToString/@seeds[1,0])

StringJoin@@("    & "<>#<>", \\displaybreak[1]\\\\\n"&/@GraphToString/@seeds[1,-1])

Magic numbers 12

{g1,g2}=seeds[1,2][[1]];

FindBigraphPairExtensionsUpToDepth[Sqrt[L]+(10.^(-3))][g1,g2,∞,"Weeds"->Weeds[{g1,g2}]][[1]]

Weeds[{g1,g2}]

DisplayBigraph/@RunOdometer[seeds[1,2][[1]]]

typesetVinesAndWeeds["e12,a",seeds[1,2][[1]]]

tikzTree[seeds[1,2][[1]]]

(DisplayBigraph/@RunOdometer[#])&/@seeds[1,2]

Flatten[(GraphToString/@RunOdometer[#])&/@seeds[1,2]]

Magic numbers 11

DisplayBigraph/@seeds[1,1]

(DisplayBigraph/@RunOdometer[#])&/@seeds[1,1]

typesetVinesAndWeeds["XXX",#]&/@seeds[1,1]

tikzTree/@seeds[1,1]

Magic numbers 10

DisplayBigraph/@({o10}=seeds[1,0])

GraphToString[o10]

Weeds[o10]={{BigraphWithDuals[GradedBigraph[{{1}},{{1}},{{1}},{{1},{1}},{{1,0},{1,0}},{{1,0}},{{1},{1}}],DualData[{1},{1},{1,2},{1}]],BigraphWithDuals[GradedBigraph[{{1}},{{1}},{{1}},{{1},{1}},{{1,0},{0,1}},{{1,0},{1,0},{0,1}},{{0,1,0},{0,0,1}}],DualData[{1},{1},{1,2},{3,2,1}]]},{BigraphWithDuals[GradedBigraph[{{1}},{{1}},{{1}},{{1},{1}},{{1,0},{1,0}},{{1,0},{0,1}},{{1,0},{1,0},{0,1}},{{0,1,0},{0,0,1}},{{1,0},{0,1},{0,1}}],DualData[{1},{1},{1,2},{1,2},{2,1}]],BigraphWithDuals[GradedBigraph[{{1}},{{1}},{{1}},{{1},{1}},{{1,0},{0,1}},{{1,0},{1,0},{0,1},{0,1}},{{0,1,0,0},{0,0,0,1},{1,0,0,0}},{{1,0,0},{0,1,0},{0,1,0},{0,0,1}},{{0,0,0,1},{1,0,0,0},{0,1,0,0}}],DualData[{1},{1},{1,2},{4,2,3,1},{3,2,1,4}]]},{BigraphWithDuals[GradedBigraph[{{1}},{{1}},{{1}},{{1},{1}},{{1,0},{1,0}},{{1,0},{0,1}},{{1,0},{0,1}},{{1,0},{0,1}},{{1,0},{0,1}}],DualData[{1},{1},{1,2},{1,2},{2,1}]],BigraphWithDuals[GradedBigraph[{{1}},{{1}},{{1}},{{1},{1}},{{1,0},{0,1}},{{1,0},{1,0},{0,1},{0,1}},{{0,0,0,1},{1,0,0,0}},{{1,0},{0,1}},{{0,1},{1,0}}],DualData[{1},{1},{1,2},{4,2,3,1},{1,2}]]}};

DisplayBigraph/@Weeds[o10]

DisplayBigraph/@RunOdometer[o10]

DisplayBigraph/@{"bwd1v1v1v1p1v1x0p0x1v1x0p0x1p0x1v1x0x0p0x0x1duals1v1v1x2v2x1x3","bwd1v1v1v1p1v1x0p1x0v0x1v1p1duals1v1v1x2v1"}

DisplayBigraph/@{"bwd1v1v1v1p1v1x0p0x1v1x0p1x0p0x1p0x1v0x1x0x0p0x0x1x0p0x0x0x1v1x0x0p1x0x0p0x1x0p0x0x1v1x0x0x0p0x0x1x0p0x0x0x1duals1v1v1x2v1x3x2x4v1x4x3x2","bwd1v1v1v1p1v1x0p1x0v1x0p0x1v0x1p1x0p0x1v1x0x0p0x1x0v0x1p1x0p0x1duals1v1v1x2v1x2v2x1"}

typesetVinesAndWeeds["10",o10]

tikzTree[o10]

Quadruple points

DisplayBigraph/@seeds[2]

DisplayBigraph/@(Weeds[seeds[2][[1]]]={{BigraphWithDuals[GradedBigraph[{{1}},{{1}},{{1},{1},{1}},{{1,0,0}}],DualData[{1},{1},{1}]],BigraphWithDuals[GradedBigraph[{{1}},{{1}},{{1},{1},{1}},{{1,0,0}}],DualData[{1},{1},{1}]]},{BigraphWithDuals[GradedBigraph[{{1}},{{1}},{{1},{1},{1}},{{1,0,0},{0,1,0}},{{1,0}}],DualData[{1},{1},{1,2}]],BigraphWithDuals[GradedBigraph[{{1}},{{1}},{{1},{1},{1}},{{1,0,0},{0,1,0}},{{1,0}}],DualData[{1},{1},{1,2}]]},{BigraphWithDuals[GradedBigraph[{{1}},{{1}},{{1},{1},{1}},{{1,0,0},{0,1,0}},{{1,0},{0,1}}],DualData[{1},{1},{1,2}]],BigraphWithDuals[GradedBigraph[{{1}},{{1}},{{1},{1},{1}},{{1,0,0},{0,1,0}},{{1,0},{0,1}}],DualData[{1},{1},{1,2}]]}})

DisplayBigraph/@RunOdometer[seeds[2][[1]]]

tikzTree[seeds[2][[1]]]

typesetVinesAndWeeds["e2",seeds[2][[1]]]

DisplayBigraph/@(Weeds[seeds[2][[2]]]={{BigraphWithDuals[GradedBigraph[{{1}},{{1}},{{1}},{{1},{1},{1}},{{1,0,0}}],DualData[{1},{1},{1,2,3}]],BigraphWithDuals[GradedBigraph[{{1}},{{1}},{{1}},{{1},{1},{1}},{{1,0,0}}],DualData[{1},{1},{1,2,3}]]},{BigraphWithDuals[GradedBigraph[{{1}},{{1}},{{1}},{{1},{1},{1}},{{1,0,0},{0,1,0}},{{1,0}}],DualData[{1},{1},{1,2,3},{1}]],BigraphWithDuals[GradedBigraph[{{1}},{{1}},{{1}},{{1},{1},{1}},{{1,0,0},{0,1,0}},{{1,0}}],DualData[{1},{1},{1,2,3},{1}]]}})

DisplayBigraph/@RunOdometer[seeds[2][[2]]]

typesetVinesAndWeeds["o2,a",seeds[2][[2]]]

tikzTree[seeds[2][[2]]]

DisplayBigraph/@(Weeds[seeds[2][[3]]]={{BigraphWithDuals[GradedBigraph[{{1}},{{1}},{{1}},{{1},{1},{1}},{{0,1,0}}],DualData[{1},{1},{3,2,1}]],BigraphWithDuals[GradedBigraph[{{1}},{{1}},{{1}},{{1},{1},{1}},{{0,1,0}}],DualData[{1},{1},{3,2,1}]]}})

DisplayBigraph/@RunOdometer[seeds[2][[3]]]

typesetVinesAndWeeds["o2,c",seeds[2][[3]]]

tikzTree[seeds[2][[3]]]

Conclusions

With[{g={BigraphWithDuals[GradedBigraph[{{1}},{{1}},{{1}},{{1},{1},{1}},{{1,0,0},{0,1,0}},{{1,0}}],DualData[{1},{1},{1,2,3},{1}]],BigraphWithDuals[GradedBigraph[{{1}},{{1}},{{1}},{{1},{1},{1}},{{1,0,0},{0,1,0}},{{1,0}}],DualData[{1},{1},{1,2,3},{1}]]}},
Print[DisplayBigraph[g]];
KillWeed[g,"Theorem 5.9"];
AppendTo[Weeds[],Translate[g,2]];
RunOdometer[Translate[g,2]];
Print[tikzTree[Translate[g,2]]];
Print[typesetVinesAndWeeds["", Translate[g,2]]];
]

GraphToString[BigraphWithDuals[GradedBigraph[{{1}},{{1}},{{1},{1},{1}},{{1,0,0},{0,1,0}},{{1,0},{0,1}}],DualData[{1},{1},{1,2}]]]

With[{g={BigraphWithDuals[GradedBigraph[{{1}},{{1}},{{1},{1},{1}},{{1,0,0},{0,1,0}},{{1,0},{0,1}}],DualData[{1},{1},{1,2}]],BigraphWithDuals[GradedBigraph[{{1}},{{1}},{{1},{1},{1}},{{1,0,0},{0,1,0}},{{1,0},{0,1}}],DualData[{1},{1},{1,2}]]}},
Print[DisplayBigraph[g]];
KillWeed[g,"Theorem 5.11"];
]

With[{g={BigraphWithDuals[GradedBigraph[{{1}},{{1}},{{1},{1},{1}},{{1,0,0},{0,1,0}},{{1,0}}],DualData[{1},{1},{1,2}]],BigraphWithDuals[GradedBigraph[{{1}},{{1}},{{1},{1},{1}},{{1,0,0},{0,1,0}},{{1,0}}],DualData[{1},{1},{1,2}]]},w=GraphFromString/@{"bwd1v1v1v1v1p1p1v1x0x0p0x1x0v1x0v1v1v1duals1v1v1v1x2v1v1","bwd1v1v1v1v1p1p1v1x0x0p0x1x0v1x0v1v1v1duals1v1v1v1x2v1v1"}},
Print[DisplayBigraph[g]];
Print[DisplayBigraph[w]];
KillWeed[g,"Theorem 5.10"];
Weeds[Translate[g,2]]={w};
AppendTo[Weeds[],Translate[g,2]];
RunOdometer[Translate[g,2]];
KillWeed[w,"Theorem 5.10"];
Print["Vines:\n",DisplayBigraph/@Vines[Translate[g,2]]];
Print[tikzTree[Translate[g,2]]];
]

Weeds[]

DisplayBigraph/@Weeds[]

Vines[]=Union[Vines[]]

DisplayBigraph/@(AsDs={{A3,A3},{A4,A4},
{BigraphWithDuals[GradedBigraph[{{1}},{{1},{1}}],DualData[{1},{1,2}]],
BigraphWithDuals[GradedBigraph[{{1}},{{1},{1}}],DualData[{1},{1,2}]]},
{BigraphWithDuals[GradedBigraph[{{1}},{{1},{1}}],DualData[{1},{2,1}]],
BigraphWithDuals[GradedBigraph[{{1}},{{1},{1}}],DualData[{1},{2,1}]]},
{BigraphWithDuals[GradedBigraph[{{1}},{{1}},{{1},{1}}],DualData[{1},{1}]],
BigraphWithDuals[GradedBigraph[{{1}},{{1}},{{1},{1}}],DualData[{1},{1}]]},{BigraphWithDuals[GradedBigraph[{{1}},{{1}},{{1}},{{1},{1}}],DualData[{1},{1},{1,2}]],BigraphWithDuals[GradedBigraph[{{1}},{{1}},{{1}},{{1},{1}}],DualData[{1},{1},{1,2}]]},{BigraphWithDuals[GradedBigraph[{{1}},{{1}},{{1}},{{1},{1}}],DualData[{1},{1},{2,1}]],BigraphWithDuals[GradedBigraph[{{1}},{{1}},{{1}},{{1},{1}}],DualData[{1},{1},{2,1}]]}})

Vines[]=Complement[Vines[],AsDs]

Length[Vines[]]

GradedBigraphsInVines=CanonicalizeBigraph/@(First/@Flatten[Vines[]]);

GradedBigraphsInVines=Complement[GradedBigraphsInVines,Translate[#,1]&/@GradedBigraphsInVines];

Length[GradedBigraphsInVines]

GraphToString/@GradedBigraphsInVines

DisplayBigraph/@GradedBigraphsInVines

StringJoin@@("    & "<>#<>", \\displaybreak[1]\\\\\n"&/@GraphToString/@Weeds[])

DisplayBigraph/@Weeds[]

StringJoin@@("    & "<>#<>", \\displaybreak[1]\\\\\n"&/@GraphToString/@Vines[])

DisplayBigraph/@Vines[]

Crab out to 3+(Sqrt[3]), for the second paper.

crab={GraphFromString["bwd1v1v1v1p1v1x0p0x1v1x0p0x1p0x1v1x0x0p0x0x1duals1v1v1x2v2x1x3"], GraphFromString["bwd1v1v1v1p1v1x0p1x0v0x1v1p1duals1v1v1x2v1"]}

L=3+(Sqrt[3]);

RunOdometer[crab]

typesetVinesAndWeeds["crab",crab]

tikzTree[crab]