(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 12.2' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 158, 7] NotebookDataLength[ 50224, 1287] NotebookOptionsPosition[ 47007, 1233] NotebookOutlinePosition[ 47410, 1249] CellTagsIndexPosition[ 47367, 1246] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[BoxData[ RowBox[{ RowBox[{"pivots", "[", "A_", "]"}], ":=", RowBox[{"Flatten", "[", RowBox[{ RowBox[{"FirstPosition", "[", "1", "]"}], "/@", RowBox[{"Transpose", "[", "A", "]"}]}], "]"}]}]], "Input", CellChangeTimes->{{3.831194837404834*^9, 3.8311948924696903`*^9}, { 3.831194930347896*^9, 3.831194932848599*^9}}, CellLabel->"In[26]:=",ExpressionUUID->"e1bc883b-2413-4a7d-abe0-4a19eb3f78fd"], Cell[BoxData[ RowBox[{ RowBox[{"pMatrix", "[", "n_", "]"}], ":=", RowBox[{"Table", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"Which", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"i", "\[Equal]", "2"}], "&&", RowBox[{"j", "\[Equal]", "1"}]}], "||", RowBox[{ RowBox[{"i", "\[Equal]", "1"}], "&&", RowBox[{"j", "\[Equal]", "2"}]}]}], ",", RowBox[{ RowBox[{"-", "1"}], "/", "2"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"i", "\[Equal]", "j"}], "&&", RowBox[{"i", ">", "2"}]}], ",", "1", ",", "\[IndentingNewLine]", "True", ",", "0"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", " ", "n"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "n"}], "}"}]}], "]"}]}]], "Input", CellChangeTimes->{{3.831107414093502*^9, 3.83110748040809*^9}, { 3.831107557920609*^9, 3.8311075805621977`*^9}, {3.8311076270925627`*^9, 3.831107722019619*^9}}, CellLabel->"In[27]:=",ExpressionUUID->"025b5df5-f2a6-4cee-a294-e76ee16e74d4"], Cell[BoxData[ RowBox[{ RowBox[{"gramMatrix", "[", "W_", "]"}], ":=", RowBox[{"Simplify", "[", RowBox[{ RowBox[{"Transpose", "[", "W", "]"}], ".", RowBox[{"pMatrix", "[", RowBox[{"Length", "[", "W", "]"}], "]"}], ".", "W"}], "]"}]}]], "Input", CellChangeTimes->{{3.831107486071478*^9, 3.831107546093779*^9}, { 3.831109392242589*^9, 3.831109394639595*^9}, {3.831110190169511*^9, 3.831110193792735*^9}}, CellLabel->"In[28]:=",ExpressionUUID->"54cc4a6c-be37-4091-ac21-3dfd11eb53ea"], Cell[BoxData[ RowBox[{ RowBox[{"linearRelationsMatrix", "[", "G_", "]"}], ":=", RowBox[{ RowBox[{ RowBox[{"RowReduce", "[", "G", "]"}], "[", RowBox[{"[", RowBox[{"1", ";;", RowBox[{"MatrixRank", "[", "G", "]"}]}], "]"}], "]"}], "//", "Transpose"}]}]], "Input", CellChangeTimes->{{3.831109396818718*^9, 3.831109426888632*^9}}, CellLabel->"In[29]:=",ExpressionUUID->"d3298122-6e10-4115-8e61-a949acba4e08"], Cell[BoxData[ RowBox[{ RowBox[{"linearRelations", "[", "L_", "]"}], ":=", RowBox[{"Select", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"Equal", "[", RowBox[{ SubscriptBox["b", "i"], ",", RowBox[{ RowBox[{"L", "[", RowBox[{"[", "i", "]"}], "]"}], ".", RowBox[{"Table", "[", RowBox[{ SubscriptBox["b", "i"], ",", RowBox[{"{", RowBox[{"i", ",", RowBox[{"pivots", "[", "L", "]"}]}], "}"}]}], "]"}]}]}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", RowBox[{"Length", "[", "L", "]"}]}], "}"}]}], "]"}], ",", RowBox[{ RowBox[{"Not", "[", RowBox[{"BooleanQ", "[", "#", "]"}], "]"}], "&"}]}], "]"}]}]], "Input", CellChangeTimes->{{3.831109446192391*^9, 3.831109495064299*^9}, { 3.8311095335606937`*^9, 3.831109534992022*^9}, {3.831109584393684*^9, 3.831109833956565*^9}, {3.8311098747139893`*^9, 3.8311099163122053`*^9}, { 3.831110035487195*^9, 3.83111004405739*^9}, {3.831110077358601*^9, 3.831110081551445*^9}, {3.831194643897842*^9, 3.8311946492229443`*^9}, { 3.831194680087949*^9, 3.831194680680228*^9}, {3.831194956352386*^9, 3.831195002875142*^9}, {3.831205178380069*^9, 3.831205187846324*^9}}, CellLabel->"In[30]:=",ExpressionUUID->"4e2a5664-aeb5-4dfb-88fb-7e7839ba2141"], Cell[BoxData[ RowBox[{ RowBox[{"linearRelationsFromW", "=", RowBox[{ "linearRelations", "@*", "linearRelationsMatrix", "@*", "gramMatrix"}]}], ";"}]], "Input", CellChangeTimes->{{3.831110103314905*^9, 3.831110162272215*^9}, 3.831206070230084*^9}, CellLabel->"In[31]:=",ExpressionUUID->"c9a1b25a-8cb3-40d1-ac83-1d2405398934"], Cell[BoxData[ RowBox[{ RowBox[{"inverseLinearRelations", "[", "G_", "]"}], ":=", RowBox[{ RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"i", "\[Equal]", "#"}], ",", "1", ",", "0"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", RowBox[{"Length", "[", RowBox[{"G", "[", RowBox[{"[", "1", "]"}], "]"}], "]"}]}], "}"}]}], "]"}], "&"}], "/@", RowBox[{"Flatten", "[", RowBox[{ RowBox[{ RowBox[{"FirstPosition", "[", RowBox[{"#", ",", "1"}], "]"}], "&"}], "/@", RowBox[{"(", RowBox[{ RowBox[{"RowReduce", "[", "G", "]"}], "//", RowBox[{"Select", "[", RowBox[{ RowBox[{"Not", "[", RowBox[{"AllTrue", "[", RowBox[{"#", ",", RowBox[{ RowBox[{"#", "\[Equal]", "0"}], "&"}]}], "]"}], "]"}], "&"}], "]"}]}], ")"}]}], "]"}]}]}]], "Input", CellChangeTimes->{{3.831194278291965*^9, 3.831194298458626*^9}, 3.831195204231324*^9}, CellLabel->"In[32]:=",ExpressionUUID->"30b57c08-a123-4e7d-9b0a-b512fcfecee8"], Cell[BoxData[ RowBox[{ RowBox[{"quadraticFormMatrix", "[", RowBox[{"G_", ",", "L_"}], "]"}], ":=", RowBox[{"Inverse", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"G", "[", RowBox[{"[", RowBox[{"i", ",", " ", "j"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", RowBox[{"pivots", "[", "L", "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", RowBox[{"pivots", "[", "L", "]"}]}], "}"}]}], "]"}], "]"}]}]], "Input",\ CellChangeTimes->{{3.831195055004586*^9, 3.83119507699967*^9}, { 3.831195107195753*^9, 3.831195121990181*^9}, {3.831195208095559*^9, 3.831195214781535*^9}}, CellLabel->"In[33]:=",ExpressionUUID->"e30807a9-5381-4ad1-b9fd-a6a877ae69fe"], Cell[BoxData[ RowBox[{ RowBox[{"quadraticForm", "[", RowBox[{"Q_", ",", "L_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"v", "=", RowBox[{"Table", "[", RowBox[{ SubscriptBox["b", "i"], ",", RowBox[{"{", RowBox[{"i", ",", RowBox[{"pivots", "[", "L", "]"}]}], "}"}]}], "]"}]}], "}"}], ",", RowBox[{"Simplify", "[", RowBox[{ RowBox[{"v", ".", "Q", ".", "v"}], "\[Equal]", "0"}], "]"}]}], "]"}]}]], "Input", CellChangeTimes->{{3.831195241841057*^9, 3.831195289590564*^9}}, CellLabel->"In[34]:=",ExpressionUUID->"d1264330-efcb-4ca7-a1c2-f6744f28eebe"], Cell[BoxData[ RowBox[{ RowBox[{"quadform", "[", "W_", "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"G", "=", RowBox[{"gramMatrix", "[", "W", "]"}]}], "}"}], ",", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"L", "=", RowBox[{"linearRelationsMatrix", "[", "G", "]"}]}], "}"}], ",", RowBox[{"quadraticForm", "[", RowBox[{ RowBox[{"quadraticFormMatrix", "[", RowBox[{"G", ",", "L"}], "]"}], ",", "L"}], "]"}]}], "]"}]}], "]"}]}]], "Input", CellChangeTimes->{{3.831195337159152*^9, 3.831195396279203*^9}}, CellLabel->"In[35]:=",ExpressionUUID->"efd0e321-9f31-4641-bf42-f73e16044635"], Cell[BoxData[ RowBox[{ RowBox[{"quadformFromG", "[", "G_", "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"L", "=", RowBox[{"linearRelationsMatrix", "[", "G", "]"}]}], "}"}], ",", RowBox[{"quadraticForm", "[", RowBox[{ RowBox[{"quadraticFormMatrix", "[", RowBox[{"G", ",", "L"}], "]"}], ",", "L"}], "]"}]}], "]"}]}]], "Input",\ CellChangeTimes->{{3.8312049925958433`*^9, 3.8312050200596113`*^9}}, CellLabel->"In[36]:=",ExpressionUUID->"810323e6-91cb-44f2-ad55-323fbec422eb"], Cell[BoxData[ RowBox[{ RowBox[{"graphFromG", "[", "G_", "]"}], ":=", RowBox[{"PlanarGraph", "[", RowBox[{"AdjacencyGraph", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"#", "\[Equal]", RowBox[{"-", "1"}]}], ",", "1", ",", "0"}], "]"}], "&"}], "/@", "#"}], "&"}], "/@", "G"}], ",", RowBox[{"VertexLabels", "\[Rule]", "\"\\""}]}], "]"}], "]"}]}]], "Input", CellChangeTimes->{{3.8315843493182087`*^9, 3.831584372878718*^9}, { 3.831584545556731*^9, 3.831584563248426*^9}}, CellLabel->"In[37]:=",ExpressionUUID->"948959db-c926-4458-9e45-ef7f3fb99ba5"], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"nextCandidate", "[", RowBox[{"s_", ",", "t_", ",", "adj_"}], "]"}], ":=", RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"length", ",", "pos"}], "}"}], ",", RowBox[{ RowBox[{"length", "=", RowBox[{"Length", "[", "adj", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"pos", "=", RowBox[{"Mod", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"Position", "[", RowBox[{"adj", ",", "s"}], "]"}], "[", RowBox[{"[", RowBox[{"1", ",", "1"}], "]"}], "]"}], "+", "1"}], ",", "length", ",", "1"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"t", ",", RowBox[{"adj", "[", RowBox[{"[", "pos", "]"}], "]"}]}], "}"}]}]}], "]"}]}], ";"}]], "Input", CellChangeTimes->{3.831210886725911*^9}, CellLabel->"In[38]:=",ExpressionUUID->"e7b8a43b-0fbc-4073-928d-10a091e21dd7"], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"FindFace", "[", RowBox[{"g_", "?", "PlanarGraphQ"}], "]"}], ":=", RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "emb", "}"}], ",", RowBox[{ RowBox[{"emb", "=", RowBox[{"GraphEmbedding", "[", RowBox[{"g", ",", "\"\\""}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"FindFace", "[", RowBox[{"g", ",", "emb"}], "]"}]}]}], "]"}]}], ";"}], "\[IndentingNewLine]"}], "\n", RowBox[{ RowBox[{"FindFace", "[", RowBox[{ RowBox[{"g_", "?", "PlanarGraphQ"}], ",", "emb_"}], "]"}], ":=", RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ "m", ",", "orderings", ",", "pAdj", ",", "rightF", ",", "s", ",", "t", ",", "initial", ",", "face"}], "}"}], ",", RowBox[{ RowBox[{"m", "=", RowBox[{"AdjacencyMatrix", "[", "g", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{"pAdj", "[", "v", "]"}], "=", RowBox[{"SortBy", "[", RowBox[{ RowBox[{"Pick", "[", RowBox[{ RowBox[{"VertexList", "[", "g", "]"}], ",", RowBox[{"m", "[", RowBox[{"[", "v", "]"}], "]"}], ",", "1"}], "]"}], ",", RowBox[{ RowBox[{"ArcTan", "@@", RowBox[{"(", RowBox[{ RowBox[{"emb", "[", RowBox[{"[", "v", "]"}], "]"}], "-", RowBox[{"emb", "[", RowBox[{"[", "#", "]"}], "]"}]}], ")"}]}], "&"}]}], "]"}]}], ",", RowBox[{"{", RowBox[{"v", ",", RowBox[{"VertexList", "[", "g", "]"}]}], "}"}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"rightF", "[", "_", "]"}], ":=", "False"}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"Reap", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"!", RowBox[{"rightF", "[", "e", "]"}]}], ",", RowBox[{ RowBox[{"s", "=", RowBox[{"e", "[", RowBox[{"[", "1", "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"t", "=", RowBox[{"e", "[", RowBox[{"[", "2", "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"initial", "=", "s"}], ";", "\[IndentingNewLine]", RowBox[{"face", "=", RowBox[{"{", "s", "}"}]}], ";", "\[IndentingNewLine]", RowBox[{"While", "[", RowBox[{ RowBox[{"t", "=!=", "initial"}], ",", RowBox[{ RowBox[{ RowBox[{"rightF", "[", RowBox[{"UndirectedEdge", "[", RowBox[{"s", ",", "t"}], "]"}], "]"}], "=", "True"}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", RowBox[{"s", ",", "t"}], "}"}], "=", RowBox[{"nextCandidate", "[", RowBox[{"s", ",", "t", ",", RowBox[{"pAdj", "[", "t", "]"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"face", "=", RowBox[{"Join", "[", RowBox[{"face", ",", RowBox[{"{", "s", "}"}]}], "]"}]}], ";"}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"Sow", "[", "face", "]"}], ";"}]}], "]"}], ",", RowBox[{"{", RowBox[{"e", ",", RowBox[{"EdgeList", "[", "g", "]"}]}], "}"}]}], "]"}], "]"}], "[", RowBox[{"[", RowBox[{"2", ",", "1"}], "]"}], "]"}]}]}], "]"}]}]}], "Input", CellChangeTimes->{{3.8312108953940573`*^9, 3.831210895411563*^9}, 3.8312119634327393`*^9, 3.831542420732052*^9}, CellLabel->"In[39]:=",ExpressionUUID->"5cb4f612-3c02-42ac-ad57-4fb2daf3366b"], Cell[BoxData[ RowBox[{ RowBox[{"findGenerators", "[", RowBox[{"faces_", ",", "vertices_", ",", "G_"}], "]"}], ":=", RowBox[{"Table", "[", RowBox[{ RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ "face", ",", "otherVertex", ",", "verticesOnFace", ",", "allVertices", ",", "Gp", ",", "P", ",", "Gnew", ",", "L", ",", "Q", ",", "Qform", ",", "sol1", ",", "sol2", ",", "sols", ",", "coeff", ",", "coeffTable", ",", "small", ",", "Li", ",", "P2"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"face", "=", RowBox[{"faces", "[", RowBox[{"[", "i", "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"verticesOnFace", "=", RowBox[{"Sort", "[", RowBox[{"RandomSample", "[", RowBox[{"face", ",", "3"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"otherVertex", "=", RowBox[{"RandomChoice", "[", RowBox[{"Select", "[", RowBox[{"vertices", ",", RowBox[{ RowBox[{"Not", "[", RowBox[{"MemberQ", "[", RowBox[{"face", ",", "#"}], "]"}], "]"}], "&"}]}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"allVertices", "=", RowBox[{"Append", "[", RowBox[{"verticesOnFace", ",", "otherVertex"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"P", "=", RowBox[{"Transpose", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"IdentityMatrix", "[", RowBox[{"Length", "[", "vertices", "]"}], "]"}], "[", RowBox[{"[", "#", "]"}], "]"}], "&"}], "/@", RowBox[{"DeleteDuplicates", "[", RowBox[{"Join", "[", RowBox[{"allVertices", ",", "vertices"}], "]"}], "]"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Gnew", "=", RowBox[{ RowBox[{"Transpose", "[", "P", "]"}], ".", "G", ".", "P"}]}], ";", "\[IndentingNewLine]", RowBox[{"L", "=", RowBox[{"linearRelationsMatrix", "[", "Gnew", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Gp", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"G", "[", RowBox[{"[", RowBox[{"i", ",", "j"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "allVertices"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "allVertices"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Q", "=", RowBox[{"Inverse", "[", "Gp", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Qform", "=", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"#", ".", "Q", ".", "#"}], "&"}], "[", RowBox[{"Table", "[", RowBox[{ SubscriptBox["b", "j"], ",", RowBox[{"{", RowBox[{"j", ",", "allVertices"}], "}"}]}], "]"}], "]"}], ")"}], "\[Equal]", "0"}]}], ";", "\[IndentingNewLine]", RowBox[{"sols", "=", RowBox[{"Expand", "[", RowBox[{"FullSimplify", "[", RowBox[{"Total", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"#", "[", RowBox[{"[", "1", "]"}], "]"}], "[", RowBox[{"[", "2", "]"}], "]"}], "&"}], "/@", RowBox[{"Solve", "[", RowBox[{"Qform", ",", SubscriptBox["b", "otherVertex"]}], "]"}]}], "]"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"coeff", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"sols", "/.", RowBox[{"Table", "[", RowBox[{ RowBox[{ SubscriptBox["b", "i"], "\[Rule]", RowBox[{"If", "[", RowBox[{ RowBox[{"i", "\[Equal]", "curr"}], ",", "1", ",", "0"}], "]"}]}], ",", RowBox[{"{", RowBox[{"i", ",", "allVertices"}], "}"}]}], "]"}]}], ",", RowBox[{"{", RowBox[{"curr", ",", "allVertices"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"small", "=", RowBox[{"IdentityMatrix", "[", RowBox[{"Length", "[", "allVertices", "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"small", "[", RowBox[{"[", RowBox[{"-", "1"}], "]"}], "]"}], "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"j", "\[Equal]", "4"}], ",", RowBox[{"-", "1"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{"MemberQ", "[", RowBox[{"verticesOnFace", ",", RowBox[{"allVertices", "[", RowBox[{"[", "j", "]"}], "]"}]}], "]"}], ",", RowBox[{"coeff", "[", RowBox[{"[", "j", "]"}], "]"}], ",", "0"}], "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"j", ",", RowBox[{"Length", "[", "allVertices", "]"}]}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Li", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"j", "\[Equal]", "k"}], ",", "1", ",", "0"}], "]"}], ",", RowBox[{"{", RowBox[{"j", ",", RowBox[{"Length", "[", "vertices", "]"}]}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"k", ",", "allVertices"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"P2", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"j", "\[Equal]", "k"}], ",", "1", ",", "0"}], "]"}], ",", RowBox[{"{", RowBox[{"j", ",", RowBox[{"Length", "[", "vertices", "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"k", ",", RowBox[{"DeleteDuplicates", "[", RowBox[{"Join", "[", RowBox[{"allVertices", ",", "vertices"}], "]"}], "]"}]}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"P2", ".", "L", ".", "small", ".", "Li"}]}]}], "\[IndentingNewLine]", "]"}], ",", RowBox[{"{", RowBox[{"i", ",", RowBox[{"Length", "[", "faces", "]"}]}], "}"}]}], "]"}]}]], "Input", CellChangeTimes->{{3.831211980673108*^9, 3.831212009547978*^9}, { 3.831212047936781*^9, 3.831212064698745*^9}, {3.831212136824675*^9, 3.8312121924739923`*^9}, {3.83121282873549*^9, 3.831212895555662*^9}, { 3.8312129593096933`*^9, 3.831213052703521*^9}, {3.8312133826923237`*^9, 3.831213512078041*^9}, {3.831213579312004*^9, 3.831213607562201*^9}, { 3.8312136458477*^9, 3.8312136689119587`*^9}, {3.831213699813815*^9, 3.831213723704392*^9}, {3.8312138140717983`*^9, 3.831213889152441*^9}, { 3.831213941035733*^9, 3.831213957988277*^9}, {3.831213991504438*^9, 3.831214049771612*^9}, {3.8312142057843103`*^9, 3.831214227198838*^9}, { 3.8313934326708517`*^9, 3.83139343995124*^9}, {3.831393489506013*^9, 3.831393506386162*^9}, {3.831393555227632*^9, 3.8313935602186413`*^9}, { 3.8313936045286083`*^9, 3.83139367389612*^9}, {3.831393815407503*^9, 3.8313939935486803`*^9}, {3.83139404462208*^9, 3.831394092415612*^9}, { 3.831394131767799*^9, 3.831394217388193*^9}, {3.831394341420259*^9, 3.831394342312114*^9}, {3.83139445920255*^9, 3.8313945442248793`*^9}, { 3.8313945973518257`*^9, 3.831394680082652*^9}, {3.8313947347981873`*^9, 3.831394898892132*^9}, {3.83139493417336*^9, 3.831395053557044*^9}, { 3.831395100567893*^9, 3.83139518418989*^9}, {3.831395217466712*^9, 3.831395241186327*^9}, {3.831395355721635*^9, 3.8313954066678057`*^9}, { 3.831395475153723*^9, 3.831395516960009*^9}, {3.83139559485061*^9, 3.8313956385922327`*^9}, {3.831395769312038*^9, 3.8313958340021877`*^9}, { 3.831395865647847*^9, 3.83139610784988*^9}, {3.831396182381921*^9, 3.831396202527211*^9}, {3.8313962730948772`*^9, 3.8313963875560293`*^9}, { 3.831396427697093*^9, 3.8313965616329517`*^9}, {3.831396608167254*^9, 3.83139664360338*^9}, {3.83139670106045*^9, 3.8313967846470547`*^9}, { 3.8313968308609743`*^9, 3.8313969389717007`*^9}, 3.831396972519156*^9, { 3.831397018773802*^9, 3.831397020188629*^9}, {3.831397062011731*^9, 3.831397076917077*^9}, {3.8313971287749977`*^9, 3.8313971288803463`*^9}, { 3.831397158974574*^9, 3.831397164029716*^9}, {3.831451905653893*^9, 3.831451941106399*^9}, {3.8314519809069433`*^9, 3.831452094855884*^9}, { 3.831542443369563*^9, 3.83154246854852*^9}, {3.831542595276044*^9, 3.8315426013894053`*^9}, {3.831542828964487*^9, 3.831542862477805*^9}, 3.8315429215303297`*^9, {3.831543065147149*^9, 3.831543089933201*^9}, { 3.8315431288434877`*^9, 3.831543129636121*^9}, {3.83154323687431*^9, 3.831543260658288*^9}, {3.831543295045744*^9, 3.831543299689423*^9}, 3.831543486496207*^9, {3.831543653211835*^9, 3.831543654095707*^9}, { 3.831544292671633*^9, 3.8315442949499702`*^9}, {3.831544329733664*^9, 3.831544394563963*^9}, {3.831544636528879*^9, 3.831544663053648*^9}, 3.831544723323721*^9, 3.831546276666531*^9, {3.8315463223978786`*^9, 3.831546322569023*^9}, {3.831546446056045*^9, 3.83154644840313*^9}, { 3.8315465437277803`*^9, 3.8315465842454453`*^9}, {3.8315466426699533`*^9, 3.831546646606488*^9}, {3.831546727818715*^9, 3.831546788772341*^9}, { 3.831546839246593*^9, 3.8315468396090813`*^9}, {3.83154706753721*^9, 3.8315471373421164`*^9}, {3.831549700570283*^9, 3.831549703647592*^9}, { 3.8315497447736797`*^9, 3.831549761864801*^9}, {3.831549996792459*^9, 3.831550026202232*^9}, {3.831550732962453*^9, 3.831550735264537*^9}, { 3.8315509704443493`*^9, 3.8315509727254343`*^9}, {3.831551320669722*^9, 3.831551407002722*^9}, 3.831551438305327*^9, {3.8315518862869797`*^9, 3.831551891551553*^9}, {3.831552338431473*^9, 3.8315523578513947`*^9}, { 3.8315524412649384`*^9, 3.831552441791979*^9}, {3.831552847687746*^9, 3.8315528556641293`*^9}, {3.83172514482829*^9, 3.831725228085017*^9}, { 3.831725320892393*^9, 3.8317253386411657`*^9}, {3.8317254340311728`*^9, 3.831725440268997*^9}, {3.8317255156810293`*^9, 3.8317256205301943`*^9}, { 3.831725829008904*^9, 3.831725851322979*^9}, {3.831726730605854*^9, 3.8317267923612432`*^9}}, CellLabel->"In[88]:=",ExpressionUUID->"df61872a-1e93-4b2b-ad66-1c8fee203402"], Cell[BoxData[ RowBox[{ RowBox[{"findGeneratorsFromG", "[", "G_", "]"}], ":=", RowBox[{"findGenerators", "[", RowBox[{ RowBox[{"FindFace", "[", RowBox[{"PlanarGraph", "[", RowBox[{"AdjacencyGraph", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"#", "\[Equal]", RowBox[{"-", "1"}]}], ",", "1", ",", "0"}], "]"}], "&"}], "/@", "#"}], "&"}], "/@", "G"}], ",", RowBox[{"VertexLabels", "\[Rule]", "\"\\""}]}], "]"}], "]"}], "]"}], ",", RowBox[{"Range", "[", RowBox[{"Length", "[", "G", "]"}], "]"}], ",", "G"}], "]"}]}]], "Input", CellChangeTimes->{{3.831554845925479*^9, 3.8315548977219877`*^9}}, CellLabel->"In[42]:=",ExpressionUUID->"bd52b017-bd99-4bdf-9126-b7c62804c9f2"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"root", "=", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "2", ",", "2", ",", "4", ",", "4"}], "}"}]}]], "Input", CellChangeTimes->{{3.8315844779296722`*^9, 3.83158448503473*^9}, 3.8315845350751143`*^9}, CellLabel->"In[43]:=",ExpressionUUID->"0dee5c81-bf5b-4a3d-b97a-365d1fa22054"], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "2", ",", "2", ",", "4", ",", "4"}], "}"}]], "Output", CellChangeTimes->{ 3.831584639282403*^9, 3.831593478548482*^9, 3.831722045325165*^9, { 3.831724196424776*^9, 3.831724219608436*^9}}, CellLabel->"Out[43]=",ExpressionUUID->"24045598-9e03-4154-b5b4-26618438a52d"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"faces", "=", RowBox[{"FindFace", "[", RowBox[{"PlanarGraph", "[", RowBox[{"AdjacencyGraph", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"#", "\[Equal]", RowBox[{"-", "1"}]}], ",", "1", ",", "0"}], "]"}], "&"}], "/@", "#"}], "&"}], "/@", "G"}], ",", RowBox[{"VertexLabels", "\[Rule]", "\"\\""}]}], "]"}], "]"}], "]"}]}]], "Input", CellChangeTimes->{{3.831722838476529*^9, 3.8317228391121197`*^9}}, CellLabel->"In[44]:=",ExpressionUUID->"965146b1-1c31-406b-b3be-b3243e13b724"], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "2", ",", "4"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "3", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "4", ",", "5"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "5", ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "3", ",", "6"}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "6", ",", "4"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "5", ",", "6"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "6", ",", "5"}], "}"}]}], "}"}]], "Output", CellChangeTimes->{{3.8317228363662443`*^9, 3.831722839557581*^9}, { 3.831724196503327*^9, 3.831724219637782*^9}}, CellLabel->"Out[44]=",ExpressionUUID->"82e35b12-74ea-4d56-949a-5542e272f403"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"PlanarGraph", "[", RowBox[{"AdjacencyGraph", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"#", "\[Equal]", RowBox[{"-", "1"}]}], ",", "1", ",", "0"}], "]"}], "&"}], "/@", "#"}], "&"}], "/@", "G"}], ",", RowBox[{"VertexLabels", "\[Rule]", "\"\\""}]}], "]"}], "]"}]], "Input", CellLabel->"In[45]:=",ExpressionUUID->"7d7a9baa-1ee2-4551-818f-a3bee7a7be15"], Cell[BoxData[ GraphicsBox[ NamespaceBox["NetworkGraphics", DynamicModuleBox[{Typeset`graph = HoldComplete[ Graph[{1, 2, 3, 4, 5, 6}, { Null, {{1, 2}, {1, 3}, {1, 4}, {1, 5}, {2, 3}, {2, 4}, {2, 6}, {3, 5}, { 3, 6}, {4, 5}, {4, 6}, {5, 6}}}, { GraphLayout -> "TutteEmbedding", VertexLabels -> {"Name"}}]]}, TagBox[GraphicsGroupBox[{ {Hue[0.6, 0.7, 0.5], Opacity[0.7], Arrowheads[0.], ArrowBox[CompressedData[" 1:eJxTTMoPSmVmYGDgAWImKObqmudjWblqDwMYfLBf7RPxomrba/vf/0Hg/n50 ee5wnR8rtI/Zs66Q0fk2c6c9uvxKiP79LGD+Awz9fzfxCHdqH9v/wzDl4RWg fnT70M1Hl0c3H12egUFiifzT9XaHnvjPa5t5EsM8dPvR5dH1o9uHrh9dHl0/ unp0eQAbe76Z "], 0.020399597244776385`]}, {Hue[0.6, 0.2, 0.8], EdgeForm[{GrayLevel[0], Opacity[ 0.7]}], { DiskBox[{-1.8369701987210297*^-16, 1.}, 0.020399597244776385], InsetBox["1", Offset[{2, 2}, {0.0203995972447762, 1.0203995972447764}], ImageScaled[{0, 0}], BaseStyle->"Graphics"]}, { DiskBox[{0.8660254037844387, -0.4999999999999997}, 0.020399597244776385], InsetBox["2", Offset[{2, 2}, {0.8864250010292151, -0.4796004027552233}], ImageScaled[{0, 0}], BaseStyle->"Graphics"]}, { DiskBox[{0.1732073985846728, 0.10000551773978834}, 0.020399597244776385], InsetBox["3", Offset[{2, 2}, {0.19360699582944918, 0.12040511498456473}], ImageScaled[{0, 0}], BaseStyle->"Graphics"]}, { DiskBox[{-0.8660254037844385, -0.5000000000000004}, 0.020399597244776385], InsetBox["4", Offset[{2, 2}, {-0.8456258065396621, -0.4796004027552241}], ImageScaled[{0, 0}], BaseStyle->"Graphics"]}, { DiskBox[{-0.17320359640270758, 0.1000035333892767}, 0.020399597244776385], InsetBox["5", Offset[{2, 2}, {-0.1528039991579312, 0.12040313063405308}], ImageScaled[{0, 0}], BaseStyle->"Graphics"]}, { DiskBox[{9.505454913738554*^-7, -0.19999773721773378}, 0.020399597244776385], InsetBox["6", Offset[{2, 2}, {0.02040054779026776, -0.1795981399729574}], ImageScaled[{0, 0}], BaseStyle->"Graphics"]}}}], MouseAppearanceTag["NetworkGraphics"]], AllowKernelInitialization->False]], DefaultBaseStyle->{ "NetworkGraphics", FrontEnd`GraphicsHighlightColor -> Hue[0.8, 1., 0.6]}, FormatType->TraditionalForm, FrameTicks->None]], "Output", CellChangeTimes->{ 3.831722925131528*^9, {3.831724196527287*^9, 3.831724219672398*^9}}, CellLabel->"Out[45]=",ExpressionUUID->"438f541f-8f14-4521-9286-7c37bf8f25d7"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"G", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", RowBox[{"-", "1"}], ",", RowBox[{"-", "1"}], ",", RowBox[{"-", "1"}], ",", RowBox[{"-", "1"}], ",", RowBox[{"-", "3"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "1", ",", RowBox[{"-", "1"}], ",", RowBox[{"-", "1"}], ",", RowBox[{"-", "3"}], ",", RowBox[{"-", "1"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", RowBox[{"-", "1"}], ",", "1", ",", RowBox[{"-", "3"}], ",", RowBox[{"-", "1"}], ",", RowBox[{"-", "1"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", RowBox[{"-", "1"}], ",", RowBox[{"-", "3"}], ",", "1", ",", RowBox[{"-", "1"}], ",", RowBox[{"-", "1"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", RowBox[{"-", "3"}], ",", RowBox[{"-", "1"}], ",", RowBox[{"-", "1"}], ",", "1", ",", RowBox[{"-", "1"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "3"}], ",", RowBox[{"-", "1"}], ",", RowBox[{"-", "1"}], ",", RowBox[{"-", "1"}], ",", RowBox[{"-", "1"}], ",", "1"}], "}"}]}], "}"}]}]], "Input", CellChangeTimes->{{3.8315845959939213`*^9, 3.8315846175243464`*^9}}, CellLabel->"In[46]:=",ExpressionUUID->"99762d4d-02fa-4c52-a966-81c24a88ebe5"], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", RowBox[{"-", "1"}], ",", RowBox[{"-", "1"}], ",", RowBox[{"-", "1"}], ",", RowBox[{"-", "1"}], ",", RowBox[{"-", "3"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "1", ",", RowBox[{"-", "1"}], ",", RowBox[{"-", "1"}], ",", RowBox[{"-", "3"}], ",", RowBox[{"-", "1"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", RowBox[{"-", "1"}], ",", "1", ",", RowBox[{"-", "3"}], ",", RowBox[{"-", "1"}], ",", RowBox[{"-", "1"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", RowBox[{"-", "1"}], ",", RowBox[{"-", "3"}], ",", "1", ",", RowBox[{"-", "1"}], ",", RowBox[{"-", "1"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", RowBox[{"-", "3"}], ",", RowBox[{"-", "1"}], ",", RowBox[{"-", "1"}], ",", "1", ",", RowBox[{"-", "1"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "3"}], ",", RowBox[{"-", "1"}], ",", RowBox[{"-", "1"}], ",", RowBox[{"-", "1"}], ",", RowBox[{"-", "1"}], ",", "1"}], "}"}]}], "}"}]], "Output", CellChangeTimes->{ 3.831584619265588*^9, 3.831593478575108*^9, 3.831722045339559*^9, 3.831722535861471*^9, {3.83172419654003*^9, 3.831724219683917*^9}}, CellLabel->"Out[46]=",ExpressionUUID->"a1a41bbc-b560-4098-a8cc-10e65cdf87bf"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"sigmas", "=", RowBox[{"findGeneratorsFromG", "[", "G", "]"}]}]], "Input", CellChangeTimes->{{3.831584622572513*^9, 3.8315846353858*^9}, { 3.831722772670558*^9, 3.8317227745157413`*^9}, {3.8317228053569736`*^9, 3.8317228076356153`*^9}}, CellLabel->"In[89]:=",ExpressionUUID->"b9f41909-31ad-46a1-b81f-600b23bb57a4"], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0", ",", "0", ",", "0", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1", ",", "0", ",", "0", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "4", ",", "0", ",", "3", ",", "0", ",", RowBox[{"-", "1"}]}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "0", ",", "1", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "3", ",", "0", ",", "4", ",", "0", ",", RowBox[{"-", "1"}]}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "4", ",", "0", ",", "4", ",", "0", ",", RowBox[{"-", "1"}]}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0", ",", "0", ",", "0", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1", ",", "0", ",", "0", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "1", ",", "0", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "4", ",", "3", ",", "0", ",", "0", ",", RowBox[{"-", "1"}]}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "3", ",", "4", ",", "0", ",", "0", ",", RowBox[{"-", "1"}]}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", "4", ",", "4", ",", "0", ",", "0", ",", RowBox[{"-", "1"}]}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0", ",", "0", ",", "0", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "0", ",", RowBox[{"-", "1"}], ",", "3", ",", "3", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "0", ",", RowBox[{"-", "1"}], ",", "2", ",", "4", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "0", ",", "1", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "0", ",", "0", ",", "1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "0", ",", RowBox[{"-", "1"}], ",", "3", ",", "4", ",", "0"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "0", ",", "0", ",", "0", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "0", ",", "3", ",", RowBox[{"-", "1"}], ",", "3", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "1", ",", "0", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "0", ",", "2", ",", RowBox[{"-", "1"}], ",", "4", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "0", ",", "0", ",", "1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", "0", ",", "3", ",", RowBox[{"-", "1"}], ",", "4", ",", "0"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "4", ",", "4", ",", "0", ",", "0", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1", ",", "0", ",", "0", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "1", ",", "0", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "4", ",", "3", ",", "0", ",", "0", ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "3", ",", "4", ",", "0", ",", "0", ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "0", ",", "0", ",", "0", ",", "1"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "4", ",", RowBox[{"-", "1"}], ",", "3", ",", "0", ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1", ",", "0", ",", "0", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "4", ",", RowBox[{"-", "1"}], ",", "2", ",", "0", ",", "4"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "0", ",", "1", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "3", ",", RowBox[{"-", "1"}], ",", "3", ",", "0", ",", "4"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "0", ",", "0", ",", "0", ",", "1"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0", ",", "3", ",", RowBox[{"-", "1"}], ",", "4", ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "3", ",", RowBox[{"-", "1"}], ",", "3", ",", "4"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "1", ",", "0", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "2", ",", RowBox[{"-", "1"}], ",", "4", ",", "4"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "0", ",", "0", ",", "1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "0", ",", "0", ",", "0", ",", "1"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "0", ",", "0", ",", "4", ",", "4", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "0", ",", "0", ",", "4", ",", "3", ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "0", ",", "0", ",", "3", ",", "4", ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "0", ",", "1", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "0", ",", "0", ",", "1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "0", ",", "0", ",", "0", ",", "1"}], "}"}]}], "}"}]}], "}"}]], "Output", CellChangeTimes->{ 3.831584636401613*^9, 3.831593478609365*^9, 3.8317220453547983`*^9, { 3.83172253814844*^9, 3.8317225451713*^9}, 3.83172280836547*^9, { 3.83172419666632*^9, 3.831724219741164*^9}, {3.831725157114129*^9, 3.831725180750599*^9}, 3.831725231417803*^9, {3.831725328775733*^9, 3.831725342671924*^9}, 3.831725443833132*^9, {3.8317256038104*^9, 3.831725624058765*^9}, 3.831725836047076*^9, {3.8317267386952133`*^9, 3.831726796778412*^9}}, CellLabel->"Out[89]=",ExpressionUUID->"0ceb7310-0d12-4a75-afd2-772d1d577420"] }, Open ]], Cell[BoxData[ RowBox[{ RowBox[{"search", "[", RowBox[{ "generators_", ",", "current_", ",", "previous_", ",", "lastgen_", ",", "upperBound_", ",", "faces_"}], "]"}], ":=", RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{"totals", ",", "invalid"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"Print", "[", "current", "]"}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"invalid", "[", RowBox[{"\[Sigma]_", ",", "face_"}], "]"}], ":=", RowBox[{ RowBox[{"\[Sigma]", "\[Equal]", "lastgen"}], "||", RowBox[{"AllTrue", "[", RowBox[{ RowBox[{"Delete", "[", RowBox[{ RowBox[{"\[Sigma]", ".", "current"}], ",", RowBox[{ RowBox[{ RowBox[{"{", "#", "}"}], "&"}], "/@", "face"}]}], "]"}], ",", RowBox[{ RowBox[{"#", ">", "upperBound"}], "&"}]}], "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"totals", "[", "i_", "]"}], ":=", RowBox[{"If", "[", RowBox[{ RowBox[{"invalid", "[", RowBox[{ RowBox[{"generators", "[", RowBox[{"[", "i", "]"}], "]"}], ",", RowBox[{"faces", "[", RowBox[{"[", "i", "]"}], "]"}]}], "]"}], ",", "0", ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"Length", "[", "current", "]"}], "-", RowBox[{"Length", "[", RowBox[{"faces", "[", RowBox[{"[", "i", "]"}], "]"}], "]"}], "-", RowBox[{"Length", "[", RowBox[{"Select", "[", RowBox[{ RowBox[{"Delete", "[", RowBox[{"current", ",", RowBox[{ RowBox[{ RowBox[{"{", "#", "}"}], "&"}], "/@", RowBox[{"faces", "[", RowBox[{"[", "i", "]"}], "]"}]}]}], "]"}], ",", RowBox[{ RowBox[{"#", ">", "upperBound"}], "&"}]}], "]"}], "]"}], "+", RowBox[{"search", "[", RowBox[{"generators", ",", RowBox[{ RowBox[{"generators", "[", RowBox[{"[", "i", "]"}], "]"}], ".", "current"}], ",", "current", ",", RowBox[{"generators", "[", RowBox[{"[", "i", "]"}], "]"}], ",", "upperBound", ",", "faces"}], "]"}]}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Total", "[", RowBox[{"totals", "/@", RowBox[{"Range", "[", RowBox[{"Length", "[", "generators", "]"}], "]"}]}], "]"}]}]}], "]"}]}]], "Input", CellChangeTimes->{{3.831585478390266*^9, 3.831585832096991*^9}, { 3.831585873047202*^9, 3.831585884320414*^9}, {3.8315859333563128`*^9, 3.83158598633525*^9}, {3.831586158378029*^9, 3.831586222152265*^9}, { 3.831586295582384*^9, 3.831586377705759*^9}, {3.8315864822120523`*^9, 3.831586554779951*^9}, {3.8315866296308203`*^9, 3.831586667667411*^9}, { 3.831586741340292*^9, 3.831586755993217*^9}, {3.831592107164525*^9, 3.831592113959847*^9}, {3.831592169716857*^9, 3.831592280561895*^9}, { 3.831593557409717*^9, 3.8315935576894217`*^9}, {3.831593848468913*^9, 3.8315939374159*^9}, {3.831593976921562*^9, 3.831594001541377*^9}, { 3.8315940487580757`*^9, 3.8315940927666388`*^9}, {3.831594365932665*^9, 3.831594522762847*^9}, {3.831594614138864*^9, 3.831594754985476*^9}, { 3.8315949767507057`*^9, 3.831594980589171*^9}, {3.8316319386522493`*^9, 3.8316319392747498`*^9}, {3.831641985178143*^9, 3.831642038615139*^9}, 3.8316436263727818`*^9, {3.831643663092218*^9, 3.8316436694418087`*^9}, { 3.831643837833714*^9, 3.831643845617309*^9}, {3.8316438865181704`*^9, 3.831643933219273*^9}, {3.831643991735036*^9, 3.831644005728479*^9}, { 3.831718518985198*^9, 3.831718538584508*^9}, {3.831718573982415*^9, 3.831718579591817*^9}, {3.831718638646072*^9, 3.83171867240186*^9}, { 3.8317201135527287`*^9, 3.831720118218873*^9}, {3.831720321587966*^9, 3.831720325967662*^9}, {3.831721027895946*^9, 3.831721065838575*^9}, { 3.831721143231716*^9, 3.831721181846493*^9}, {3.831721396838306*^9, 3.83172139923806*^9}, {3.831721668116399*^9, 3.831721676695764*^9}, { 3.831723288861394*^9, 3.831723291074202*^9}, {3.83172431511852*^9, 3.831724317665661*^9}},ExpressionUUID->"4186f080-27d0-474f-9433-\ 7cdeb3a7a49d"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"sigmas", "[", RowBox[{"[", "2", "]"}], "]"}], ".", RowBox[{"sigmas", "[", RowBox[{"[", "1", "]"}], "]"}], ".", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "2", ",", "2", ",", "4", ",", "4", ",", "7"}], "}"}]}]], "Input", CellChangeTimes->{{3.831724234689178*^9, 3.831724283457025*^9}, { 3.831724972343956*^9, 3.8317249758606863`*^9}, {3.831725070698852*^9, 3.831725103084877*^9}, {3.8317256361313677`*^9, 3.831725651843144*^9}, { 3.831726812833735*^9, 3.8317268240881433`*^9}}, CellLabel->"In[92]:=",ExpressionUUID->"ed668427-5774-4eea-a66a-f4ee3f6d5b22"], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "2", ",", "10", ",", "20", ",", "28", ",", "31"}], "}"}]], "Output", CellChangeTimes->{{3.831724241702208*^9, 3.8317242837322893`*^9}, 3.831724976289991*^9, {3.831725071460204*^9, 3.8317251039026957`*^9}, { 3.831725630971492*^9, 3.831725652646872*^9}, 3.831725840720372*^9, { 3.831726799523673*^9, 3.831726824574212*^9}}, CellLabel->"Out[92]=",ExpressionUUID->"f67f478c-5848-4791-8910-cf38c6b66079"] }, Open ]] }, WindowSize->{1419., 770.25}, WindowMargins->{{10.5, Automatic}, {10.5, Automatic}}, FrontEndVersion->"12.2 for Linux x86 (64-bit) (December 12, 2020)", StyleDefinitions->"Default.nb", ExpressionUUID->"e8622aad-0bd2-483b-a68b-2a26bc5485be" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[558, 20, 419, 9, 29, "Input",ExpressionUUID->"e1bc883b-2413-4a7d-abe0-4a19eb3f78fd"], Cell[980, 31, 1054, 27, 92, "Input",ExpressionUUID->"025b5df5-f2a6-4cee-a294-e76ee16e74d4"], Cell[2037, 60, 510, 11, 29, "Input",ExpressionUUID->"54cc4a6c-be37-4091-ac21-3dfd11eb53ea"], Cell[2550, 73, 440, 11, 29, "Input",ExpressionUUID->"d3298122-6e10-4115-8e61-a949acba4e08"], Cell[2993, 86, 1407, 33, 51, "Input",ExpressionUUID->"4e2a5664-aeb5-4dfb-88fb-7e7839ba2141"], Cell[4403, 121, 343, 8, 29, "Input",ExpressionUUID->"c9a1b25a-8cb3-40d1-ac83-1d2405398934"], Cell[4749, 131, 1141, 33, 29, "Input",ExpressionUUID->"30b57c08-a123-4e7d-9b0a-b512fcfecee8"], Cell[5893, 166, 741, 20, 29, "Input",ExpressionUUID->"e30807a9-5381-4ad1-b9fd-a6a877ae69fe"], Cell[6637, 188, 672, 19, 29, "Input",ExpressionUUID->"d1264330-efcb-4ca7-a1c2-f6744f28eebe"], Cell[7312, 209, 708, 19, 29, "Input",ExpressionUUID->"efd0e321-9f31-4641-bf42-f73e16044635"], Cell[8023, 230, 548, 14, 29, "Input",ExpressionUUID->"810323e6-91cb-44f2-ad55-323fbec422eb"], Cell[8574, 246, 702, 19, 29, "Input",ExpressionUUID->"948959db-c926-4458-9e45-ef7f3fb99ba5"], Cell[9279, 267, 996, 28, 71, "Input",ExpressionUUID->"e7b8a43b-0fbc-4073-928d-10a091e21dd7"], Cell[10278, 297, 3990, 106, 298, "Input",ExpressionUUID->"5cb4f612-3c02-42ac-ad57-4fb2daf3366b"], Cell[14271, 405, 10788, 230, 422, "Input",ExpressionUUID->"df61872a-1e93-4b2b-ad66-1c8fee203402"], Cell[25062, 637, 885, 23, 29, "Input",ExpressionUUID->"bd52b017-bd99-4bdf-9126-b7c62804c9f2"], Cell[CellGroupData[{ Cell[25972, 664, 327, 8, 29, "Input",ExpressionUUID->"0dee5c81-bf5b-4a3d-b97a-365d1fa22054"], Cell[26302, 674, 343, 8, 33, "Output",ExpressionUUID->"24045598-9e03-4154-b5b4-26618438a52d"] }, Open ]], Cell[CellGroupData[{ Cell[26682, 687, 666, 18, 29, "Input",ExpressionUUID->"965146b1-1c31-406b-b3be-b3243e13b724"], Cell[27351, 707, 801, 21, 33, "Output",ExpressionUUID->"82e35b12-74ea-4d56-949a-5542e272f403"] }, Open ]], Cell[CellGroupData[{ Cell[28189, 733, 510, 15, 29, "Input",ExpressionUUID->"7d7a9baa-1ee2-4551-818f-a3bee7a7be15"], Cell[28702, 750, 2722, 61, 338, "Output",ExpressionUUID->"438f541f-8f14-4521-9286-7c37bf8f25d7"] }, Open ]], Cell[CellGroupData[{ Cell[31461, 816, 1491, 47, 29, "Input",ExpressionUUID->"99762d4d-02fa-4c52-a966-81c24a88ebe5"], Cell[32955, 865, 1516, 48, 33, "Output",ExpressionUUID->"a1a41bbc-b560-4098-a8cc-10e65cdf87bf"] }, Open ]], Cell[CellGroupData[{ Cell[34508, 918, 347, 6, 29, "Input",ExpressionUUID->"b9f41909-31ad-46a1-b81f-600b23bb57a4"], Cell[34858, 926, 6608, 178, 178, "Output",ExpressionUUID->"0ceb7310-0d12-4a75-afd2-772d1d577420"] }, Open ]], Cell[41481, 1107, 4372, 94, 154, "Input",ExpressionUUID->"4186f080-27d0-474f-9433-7cdeb3a7a49d"], Cell[CellGroupData[{ Cell[45878, 1205, 628, 14, 29, "Input",ExpressionUUID->"ed668427-5774-4eea-a66a-f4ee3f6d5b22"], Cell[46509, 1221, 482, 9, 56, "Output",ExpressionUUID->"f67f478c-5848-4791-8910-cf38c6b66079"] }, Open ]] } ] *)