From 31f171adf74a9633cb7888971787430164fc353a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radek=20Hu=C5=A1ek?= <husek@iuuk.mff.cuni.cz> Date: Tue, 1 Feb 2022 18:05:42 +0100 Subject: [PATCH] improve experiments' docs --- experiments/cdc_4_boundaries.py | 17 +++++++---------- experiments/cdc_5_boundaries.py | 19 ++++++++++--------- experiments/flower-snarks.py | 17 +++++++---------- experiments/flowers.py | 16 ++++++++-------- experiments/ladders.py | 9 +++------ experiments/reduce-cycle.py | 6 ++---- experiments/small-snarks.py | 9 +++------ 7 files changed, 40 insertions(+), 53 deletions(-) diff --git a/experiments/cdc_4_boundaries.py b/experiments/cdc_4_boundaries.py index 3fbcff8..3a76890 100755 --- a/experiments/cdc_4_boundaries.py +++ b/experiments/cdc_4_boundaries.py @@ -1,22 +1,19 @@ #!/usr/bin/python """ -Calculate a lower bound on the number of 4-boundaries -of a linear representation of the number of circuit double -covers. + Calculate a the number of 4-boundaries of a linear + representation of the number of circuit double covers. -It uses cyclic ladder gadgets with sizes 2 up to 7 with -permutations of all half-edges except the first one. -This gives matrix of size 36 with rank 21. + It uses cyclic ladder gadgets with sizes 2 up to 7 with + permutations of all half-edges except the first one. + This gives matrix of size 36 with rank 21 which matches + the upper bound which is the rank of the join matrix. """ -import sys, os -sys.path.append(os.path.dirname(__file__) + "/..") - +import _experiment from itertools import permutations from graph_tools.all import * - LadderGadget = lambda k: CyclicLadder().gadget(k) ladders = list(map(LadderGadget, range(2, 8))) gadgets = [ l.permute((1,) + p) diff --git a/experiments/cdc_5_boundaries.py b/experiments/cdc_5_boundaries.py index ccc0ddd..44946cc 100755 --- a/experiments/cdc_5_boundaries.py +++ b/experiments/cdc_5_boundaries.py @@ -1,18 +1,19 @@ #!/usr/bin/python """ -Calculate a lower bound on the number of 4-boundaries -of a linear representation of the number of circuit double -covers. + Calculate a lower bound on the number of 5-boundaries + of a linear representation of the number of circuit double + covers. -It uses cyclic ladder gadgets with sizes 2 up to 7 with -permutations of all half-edges except the first one. -This gives matrix of size 36 with rank 21. -""" + It uses cyclic ladder gadgets with sizes 2 up to 7 with + permutations of all half-edges except the first one. + This gives matrix of size 576 with rank 161. The upper + bound is 202 -- the rank of the join matrix. -import sys, os -sys.path.append(os.path.dirname(__file__) + "/..") + WARNING: This experiment takes a long time to complete. +""" +import _experiment from itertools import permutations from graph_tools.all import * diff --git a/experiments/flower-snarks.py b/experiments/flower-snarks.py index f71438d..f282955 100755 --- a/experiments/flower-snarks.py +++ b/experiments/flower-snarks.py @@ -1,17 +1,15 @@ #!/usr/bin/python -DOC = """ -Calculate that the number of CDCs of Flower snark $J_k$ is $c16^k \pm O(15^k)$. - -We calculate the step matrix $M$, show that 16 is its eigenvalue by finding -its eigenvector. The eigenvector is guessed for the ratios of coefficients -of $M^10 x$ and $M^9 x$ where $x$ is the initial vector. This eigenvector -shares one non-zero coordinate with the final vector. """ + Calculate that the number of CDCs of Flower snark $J_k$ is $c16^k \pm O(15^k)$. -import sys, os -sys.path.append(os.path.dirname(__file__) + "/..") + We calculate the step matrix $M$, show that 16 is its eigenvalue by finding + its eigenvector. The eigenvector is guessed for the ratios of coefficients + of $M^10 x$ and $M^9 x$ where $x$ is the initial vector. This eigenvector + shares one non-zero coordinate with the final vector. +""" +import _experiment from graph_tools.all import * from sage.all import identity_matrix, QQ, DiGraph, matrix @@ -77,7 +75,6 @@ def matrix_to_rev_graph(M): if __name__ == "__main__": - print(DOC) print("Stabilizing...") S = FlowerSnark.stabilize(CircuitDoubleCover, jordan=False) print("Done") diff --git a/experiments/flowers.py b/experiments/flowers.py index 393a824..16271fd 100755 --- a/experiments/flowers.py +++ b/experiments/flowers.py @@ -1,14 +1,14 @@ #!/usr/bin/python """ -Derive a formula for the number of circuit double covers of a flower. - -Let $G$ be embedding of a graph into some surface. We say that a face -$f$ of size $k$ together with its neighbour faces are a {\em $k$-flower -with center $f$} given that $k \geq 3$, $f$ shares exactly one edge -with each of its neighbour faces, consecutive neighbour faces also -share exactly one edge, and non-consecutive neighbour faces do not -share any edge. + Derive a formula for the number of circuit double covers of a flower. + + Let $G$ be embedding of a graph into some surface. We say that a face + $f$ of size $k$ together with its neighbour faces are a {\em $k$-flower + with center $f$} given that $k \geq 3$, $f$ shares exactly one edge + with each of its neighbour faces, consecutive neighbour faces also + share exactly one edge, and non-consecutive neighbour faces do not + share any edge. """ import _experiment diff --git a/experiments/ladders.py b/experiments/ladders.py index b84f6c1..e14ac96 100755 --- a/experiments/ladders.py +++ b/experiments/ladders.py @@ -1,20 +1,17 @@ #!/usr/bin/python """ -Derive a formula for the number of circuit double covers -of cyclic ladders and crossed cyclic ladders. + Derive a formula for the number of circuit double covers + of cyclic ladders and crossed cyclic ladders. """ -import sys, os -sys.path.append(os.path.dirname(__file__) + "/..") - +import _experiment from graph_tools.all import * L = CyclicLadder().stabilize(CircuitDoubleCover, jordan=True) CL = CyclicLadder(True).stabilize(CircuitDoubleCover, jordan=True) if __name__ == "__main__": - print(__doc__) print("Cyclic ladders:\n Formula: %s\n Under the condition %s\n" % (L["formula"], L["formula_if"])) print("Crossed cyclic ladders:\n Formula: %s\n Under the condition %s" % diff --git a/experiments/reduce-cycle.py b/experiments/reduce-cycle.py index 097b443..d7726ec 100755 --- a/experiments/reduce-cycle.py +++ b/experiments/reduce-cycle.py @@ -2,14 +2,12 @@ """ Application of Theorem 6.12 to triangles, 4-cycles (Theorem 6.13) -and 5.cycles (Theorem 6.14). Note that the results are numeric +and 5-cycles (Theorem 6.14). Note that the results are numeric calculation so it is necessary to review the system of equations by hand. (It is printed by the command-line parameter -v.) """ -import sys, os -sys.path.append(os.path.dirname(__file__) + "/..") - +import _experiment from graph_tools.base import * from graph_tools.parameters import CircuitDoubleCover, VertexCount from graph_tools.misc import sun diff --git a/experiments/small-snarks.py b/experiments/small-snarks.py index ff84ada..e6885df 100755 --- a/experiments/small-snarks.py +++ b/experiments/small-snarks.py @@ -1,13 +1,11 @@ #!/usr/bin/python """ -Calculate the number of circuit double covers for the Petersen -graph a Blanusa snarks. + Calculate the number of circuit double covers for the Petersen + graph and Blanusa snarks. """ -import sys, os -sys.path.append(os.path.dirname(__file__) + "/..") - +import _experiment from graph_tools.all import * from sage.all import graphs @@ -18,7 +16,6 @@ L = { } if __name__ == "__main__": - print(__doc__) for n, g in L.items(): print("%s: %i" % (n, graph_to_gadget(g).eval(CircuitDoubleCover))) -- GitLab