From 63c7da971c2190fa75056b6d4a16bfebc0795011 Mon Sep 17 00:00:00 2001 From: janmenjayap Date: Fri, 28 Jun 2024 22:49:00 +0530 Subject: [PATCH 01/23] added CKWL2019 --- src/doc/en/reference/references/index.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/doc/en/reference/references/index.rst b/src/doc/en/reference/references/index.rst index 3d314f9c466..0790095e5d8 100644 --- a/src/doc/en/reference/references/index.rst +++ b/src/doc/en/reference/references/index.rst @@ -1678,6 +1678,10 @@ REFERENCES: bi-matrix games*. http://vknight.org/unpeudemath/code/2015/06/25/on_testing_degeneracy_of_games/ (2015) +.. [CKWL2019] Marcelo H. de Carvalho, Nishad Kothari, Xiumei Wang and Yixun + Linc. *Birkhoff-von Neumann graphs that are PM-compact*. 2019. + :doi:`10.48550/arXiv.1807.07339`. + .. [CL1996] Chartrand, G. and Lesniak, L.: *Graphs and Digraphs*. Chapman and Hall/CRC, 1996. From 2aca7a10234793c39cef03818bfff0e26b6ccf02 Mon Sep 17 00:00:00 2001 From: janmenjayap Date: Fri, 28 Jun 2024 22:55:32 +0530 Subject: [PATCH 02/23] added LM2024 --- src/doc/en/reference/references/index.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/doc/en/reference/references/index.rst b/src/doc/en/reference/references/index.rst index 0790095e5d8..3172351fe41 100644 --- a/src/doc/en/reference/references/index.rst +++ b/src/doc/en/reference/references/index.rst @@ -4360,6 +4360,10 @@ REFERENCES: .. [LM2018] \A. Lauve, M. Mastnak. *Bialgebra coverings and transfer of structure*. Preprint, :arxiv:`1803.02691`. +.. [LM2024] C.L. Lucchesi, U.S.R. Murty. *Perfect Matchings: A Theory of + Matching Covered Graphs*. Algorithms and Computation in Mathematics. + Springer Cham, 1st edition, 2024, :doi:`10.1007/978-3-031-47504-7`. + .. [LMR2010] \N. Linial, R. Meshulam and M. Rosenthal, "Sum complexes -- a new family of hypertrees", Discrete & Computational Geometry, 2010, Volume 44, Number 3, Pages 622-636 From c2162c81dd1120d39a7685770bf208f4cec10c9b Mon Sep 17 00:00:00 2001 From: janmenjayap Date: Sat, 29 Jun 2024 20:48:04 +0530 Subject: [PATCH 03/23] added NT2007 --- src/doc/en/reference/references/index.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/doc/en/reference/references/index.rst b/src/doc/en/reference/references/index.rst index 3172351fe41..7848956e1b5 100644 --- a/src/doc/en/reference/references/index.rst +++ b/src/doc/en/reference/references/index.rst @@ -5090,6 +5090,10 @@ REFERENCES: :doi:`10.1007/s00453-006-1225-y`, http://www.cs.uoi.gr/~stavros/C-Papers/C-2004-SODA.pdf +.. [NT2007] Serguei Norine and Robin Thomas. *Minimally Non-Pfaffian Graphs*. + Combinatorica, vol. 27, no. 5, pages: 587 -- 600, Springer. 2007. + :doi:`10.1016/j.jctb.2007.12.005`. + .. [NWS2002] Newman, M.E.J., Watts, D.J. and Strogatz, S.H. *Random graph models of social networks*. Proc. Nat. Acad. Sci. USA 99:1 (2002), 2566-2572. :doi:`10.1073/pnas.012582999` From f3cae1a604517d54d4e8a7795f153e3146794d10 Mon Sep 17 00:00:00 2001 From: janmenjayap Date: Mon, 1 Jul 2024 08:51:22 +0530 Subject: [PATCH 04/23] initialized the generators --- src/sage/graphs/digraph_generators.py | 12 ++++++++ src/sage/graphs/generators/smallgraphs.py | 36 +++++++++++++++++++++++ src/sage/graphs/graph_generators.py | 10 +++++++ 3 files changed, 58 insertions(+) diff --git a/src/sage/graphs/digraph_generators.py b/src/sage/graphs/digraph_generators.py index 7d89a1ce02f..14803a08382 100644 --- a/src/sage/graphs/digraph_generators.py +++ b/src/sage/graphs/digraph_generators.py @@ -27,6 +27,7 @@ :meth:`~DiGraphGenerators.GeneralizedDeBruijn` | Return the generalized de Bruijn digraph of order `n` and degree `d`. :meth:`~DiGraphGenerators.ImaseItoh` | Return the digraph of Imase and Itoh of order `n` and degree `d`. :meth:`~DiGraphGenerators.Kautz` | Return the Kautz digraph of degree `d` and diameter `D`. + :meth:`~DiGraphGenerators.KohTindellDiGraph` | Return the KohTindell digraph. :meth:`~DiGraphGenerators.nauty_directg` | Return an iterator yielding digraphs using nauty's ``directg`` program. :meth:`~DiGraphGenerators.Paley` | Return a Paley digraph on `q` vertices. :meth:`~DiGraphGenerators.Path` | Return a directed path on `n` vertices. @@ -48,6 +49,7 @@ - Emily A. Kirkman (2006) - Michael C. Yurko (2009) - David Coudert (2012) +- Janmenjaya Panda (2024) Functions and methods --------------------- @@ -57,6 +59,7 @@ # and Emily A. Kirkman # Copyright (C) 2009 Michael C. Yurko # Copyright (C) 2012 David Coudert +# Copyright (C) 2024 Janmenjaya Panda # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -108,6 +111,9 @@ class DiGraphGenerators: - TransitiveTournament - tournaments_nauty + Named Graphs: + - KohTindellDiGraph + ORDERLY GENERATION: digraphs(vertices, property=lambda x: True, augment='edges', size=None) @@ -1676,6 +1682,12 @@ def RandomSemiComplete(self, n): return G + def KohTindellDiGraph(): + r""" + Return the KohTindell digraph. + """ + raise NotImplementedError() + # ############################################################################## # DiGraph Iterators # ############################################################################## diff --git a/src/sage/graphs/generators/smallgraphs.py b/src/sage/graphs/generators/smallgraphs.py index f1eaa816d6c..9bfb6cd185d 100644 --- a/src/sage/graphs/generators/smallgraphs.py +++ b/src/sage/graphs/generators/smallgraphs.py @@ -7,6 +7,7 @@ # Copyright (C) 2006 Robert L. Miller # and Emily A. Kirkman # Copyright (C) 2009 Michael C. Yurko +# Copyright (C) 2024 Janmenjaya Panda # # Distributed under the terms of the GNU General Public License (GPL) # as published by the Free Software Foundation; either version 2 of @@ -1052,6 +1053,13 @@ def Balaban11Cage(embedding=1): raise ValueError("the value of embedding must be 1, 2, or 3") +def BicornGraph(): + r""" + Return the Bicorn graph. + """ + raise NotImplementedError() + + def BidiakisCube(): r""" Return the Bidiakis cube. @@ -1900,6 +1908,13 @@ def CoxeterGraph(): return g +def CubeplexGraph(): + r""" + Return the Cubeplex graph. + """ + raise NotImplementedError() + + def DejterGraph(): r""" Return the Dejter graph. @@ -3817,6 +3832,13 @@ def MoserSpindle(): return Graph(edge_dict, pos=pos_dict, name="Moser spindle") +def MurtyGraph(): + r""" + Return the Murty graph. + """ + raise NotImplementedError() + + def NauruGraph(embedding=2): """ Return the Nauru Graph. @@ -4376,6 +4398,13 @@ def TietzeGraph(): return g +def TricornGraph(): + r""" + Return the Tricorn graph. + """ + raise NotImplementedError() + + def TruncatedIcosidodecahedralGraph(): r""" Return the truncated icosidodecahedron. @@ -4575,6 +4604,13 @@ def TutteGraph(): return g +def TwinplexGraph(): + r""" + Return the Twinplex graph. + """ + raise NotImplementedError() + + def WagnerGraph(): """ Return the Wagner Graph. diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generators.py index 0461cfb4ccc..a27b62a775c 100644 --- a/src/sage/graphs/graph_generators.py +++ b/src/sage/graphs/graph_generators.py @@ -98,6 +98,7 @@ def wrap_name(x): __append_to_doc( ["Balaban10Cage", "Balaban11Cage", + "BicornGraph", "BidiakisCube", "BiggsSmithGraph", "BlanusaFirstSnarkGraph", @@ -113,6 +114,7 @@ def wrap_name(x): "cocliques_HoffmannSingleton", "ConwaySmith_for_3S7", "CoxeterGraph", + "CubeplexGraph", "DesarguesGraph", "DejterGraph", "distance_3_doubly_truncated_Golay_code_graph", @@ -172,6 +174,7 @@ def wrap_name(x): "MeredithGraph", "MoebiusKantorGraph", "MoserSpindle", + "MurtyGraph", "NauruGraph", "PappusGraph", "PoussinGraph", @@ -188,12 +191,14 @@ def wrap_name(x): "SzekeresSnarkGraph", "ThomsenGraph", "TietzeGraph", + "TricornGraph", "TruncatedIcosidodecahedralGraph", "TruncatedTetrahedralGraph", "TruncatedWittGraph", "Tutte12Cage", "TutteCoxeterGraph", "TutteGraph", + "TwinplexGraph", "U42Graph216", "U42Graph540", "WagnerGraph", @@ -2516,6 +2521,7 @@ def quadrangulations(self, order, minimum_degree=None, minimum_connectivity=None from .generators import smallgraphs, distance_regular Balaban10Cage = staticmethod(smallgraphs.Balaban10Cage) Balaban11Cage = staticmethod(smallgraphs.Balaban11Cage) + BicornGraph = staticmethod(smallgraphs.BicornGraph) BidiakisCube = staticmethod(smallgraphs.BidiakisCube) BiggsSmithGraph = staticmethod(smallgraphs.BiggsSmithGraph) BlanusaFirstSnarkGraph = staticmethod(smallgraphs.BlanusaFirstSnarkGraph) @@ -2531,6 +2537,7 @@ def quadrangulations(self, order, minimum_degree=None, minimum_connectivity=None cocliques_HoffmannSingleton = staticmethod(distance_regular.cocliques_HoffmannSingleton) ConwaySmith_for_3S7 = staticmethod(distance_regular.ConwaySmith_for_3S7) CoxeterGraph = staticmethod(smallgraphs.CoxeterGraph) + CubeplexGraph = staticmethod(smallgraphs.CubeplexGraph) DejterGraph = staticmethod(smallgraphs.DejterGraph) DesarguesGraph = staticmethod(smallgraphs.DesarguesGraph) distance_3_doubly_truncated_Golay_code_graph = staticmethod(distance_regular.distance_3_doubly_truncated_Golay_code_graph) @@ -2591,6 +2598,7 @@ def quadrangulations(self, order, minimum_degree=None, minimum_connectivity=None MeredithGraph = staticmethod(smallgraphs.MeredithGraph) MoebiusKantorGraph = staticmethod(smallgraphs.MoebiusKantorGraph) MoserSpindle = staticmethod(smallgraphs.MoserSpindle) + MurtyGraph = staticmethod(smallgraphs.MurtyGraph) NauruGraph = staticmethod(smallgraphs.NauruGraph) PappusGraph = staticmethod(smallgraphs.PappusGraph) PoussinGraph = staticmethod(smallgraphs.PoussinGraph) @@ -2607,12 +2615,14 @@ def quadrangulations(self, order, minimum_degree=None, minimum_connectivity=None SzekeresSnarkGraph = staticmethod(smallgraphs.SzekeresSnarkGraph) ThomsenGraph = staticmethod(smallgraphs.ThomsenGraph) TietzeGraph = staticmethod(smallgraphs.TietzeGraph) + TricornGraph = staticmethod(smallgraphs.TricornGraph) Tutte12Cage = staticmethod(smallgraphs.Tutte12Cage) TruncatedIcosidodecahedralGraph = staticmethod(smallgraphs.TruncatedIcosidodecahedralGraph) TruncatedTetrahedralGraph = staticmethod(smallgraphs.TruncatedTetrahedralGraph) TruncatedWittGraph = staticmethod(distance_regular.TruncatedWittGraph) TutteCoxeterGraph = staticmethod(smallgraphs.TutteCoxeterGraph) TutteGraph = staticmethod(smallgraphs.TutteGraph) + TwinplexGraph = staticmethod(smallgraphs.TwinplexGraph) U42Graph216 = staticmethod(smallgraphs.U42Graph216) U42Graph540 = staticmethod(smallgraphs.U42Graph540) WagnerGraph = staticmethod(smallgraphs.WagnerGraph) From 1f4700a0fc4efc3991b293cfbe55426cabe54dbf Mon Sep 17 00:00:00 2001 From: janmenjayap Date: Wed, 31 Jul 2024 01:37:27 +0530 Subject: [PATCH 05/23] removed BicornGraph() & KohTindellDiGraph() --- src/sage/graphs/digraph_generators.py | 10 ---------- src/sage/graphs/generators/smallgraphs.py | 7 ------- src/sage/graphs/graph_generators.py | 2 -- 3 files changed, 19 deletions(-) diff --git a/src/sage/graphs/digraph_generators.py b/src/sage/graphs/digraph_generators.py index 14803a08382..253feac01e5 100644 --- a/src/sage/graphs/digraph_generators.py +++ b/src/sage/graphs/digraph_generators.py @@ -27,7 +27,6 @@ :meth:`~DiGraphGenerators.GeneralizedDeBruijn` | Return the generalized de Bruijn digraph of order `n` and degree `d`. :meth:`~DiGraphGenerators.ImaseItoh` | Return the digraph of Imase and Itoh of order `n` and degree `d`. :meth:`~DiGraphGenerators.Kautz` | Return the Kautz digraph of degree `d` and diameter `D`. - :meth:`~DiGraphGenerators.KohTindellDiGraph` | Return the KohTindell digraph. :meth:`~DiGraphGenerators.nauty_directg` | Return an iterator yielding digraphs using nauty's ``directg`` program. :meth:`~DiGraphGenerators.Paley` | Return a Paley digraph on `q` vertices. :meth:`~DiGraphGenerators.Path` | Return a directed path on `n` vertices. @@ -111,9 +110,6 @@ class DiGraphGenerators: - TransitiveTournament - tournaments_nauty - Named Graphs: - - KohTindellDiGraph - ORDERLY GENERATION: digraphs(vertices, property=lambda x: True, augment='edges', size=None) @@ -1682,12 +1678,6 @@ def RandomSemiComplete(self, n): return G - def KohTindellDiGraph(): - r""" - Return the KohTindell digraph. - """ - raise NotImplementedError() - # ############################################################################## # DiGraph Iterators # ############################################################################## diff --git a/src/sage/graphs/generators/smallgraphs.py b/src/sage/graphs/generators/smallgraphs.py index 9bfb6cd185d..a39d287b41d 100644 --- a/src/sage/graphs/generators/smallgraphs.py +++ b/src/sage/graphs/generators/smallgraphs.py @@ -1053,13 +1053,6 @@ def Balaban11Cage(embedding=1): raise ValueError("the value of embedding must be 1, 2, or 3") -def BicornGraph(): - r""" - Return the Bicorn graph. - """ - raise NotImplementedError() - - def BidiakisCube(): r""" Return the Bidiakis cube. diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generators.py index a27b62a775c..4b051e09f7e 100644 --- a/src/sage/graphs/graph_generators.py +++ b/src/sage/graphs/graph_generators.py @@ -98,7 +98,6 @@ def wrap_name(x): __append_to_doc( ["Balaban10Cage", "Balaban11Cage", - "BicornGraph", "BidiakisCube", "BiggsSmithGraph", "BlanusaFirstSnarkGraph", @@ -2521,7 +2520,6 @@ def quadrangulations(self, order, minimum_degree=None, minimum_connectivity=None from .generators import smallgraphs, distance_regular Balaban10Cage = staticmethod(smallgraphs.Balaban10Cage) Balaban11Cage = staticmethod(smallgraphs.Balaban11Cage) - BicornGraph = staticmethod(smallgraphs.BicornGraph) BidiakisCube = staticmethod(smallgraphs.BidiakisCube) BiggsSmithGraph = staticmethod(smallgraphs.BiggsSmithGraph) BlanusaFirstSnarkGraph = staticmethod(smallgraphs.BlanusaFirstSnarkGraph) From 73f28b43f5194c0cb1d30fc9482cf5c49288354c Mon Sep 17 00:00:00 2001 From: janmenjayap Date: Fri, 2 Aug 2024 08:57:22 +0530 Subject: [PATCH 06/23] added Koh-Tindell digraph --- src/sage/graphs/digraph_generators.py | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/sage/graphs/digraph_generators.py b/src/sage/graphs/digraph_generators.py index 253feac01e5..7eab53351bc 100644 --- a/src/sage/graphs/digraph_generators.py +++ b/src/sage/graphs/digraph_generators.py @@ -835,6 +835,12 @@ def Circulant(self, n, integers): r""" Return a circulant digraph on `n` vertices from a set of integers. + Note that ``digraphs.Circulant(7, [1, 5])`` is also known as the + ``Koh-Tindell digraph``. It is a directed circulant based on + `\mathbb{Z}_7`. This `2`-diregular digraph is is vertex-transitive + but not arc-transitive. The associated bipartite digraph of the + Koh-Tindell digraph is a Pfaffian orientation of the Heawood graph. + INPUT: - ``n`` -- integer; number of vertices @@ -843,12 +849,20 @@ def Circulant(self, n, integers): that there is an edge from `i` to `j` if and only if ``(j-i)%n in integers`` - EXAMPLES:: + EXAMPLES: - sage: digraphs.Circulant(13,[3,5,7]) - Circulant graph ([3, 5, 7]): Digraph on 13 vertices + Construct and show the circulant graph ([3, 5, 7]): a digraph on 13 + vertices:: - TESTS:: + sage: g = digraphs.Circulant(13,[3,5,7]) + sage: g.show() # long time # needs sage.plot + + Construct and show the Koh-Tindell digraph:: + + sage: kohTindellDigraph = digraphs.Circulant(7, [1, 5]) + sage: kohTindellDigraph.show() # long time # needs sage.plot + + TESTS: sage: digraphs.Circulant(13,[3,5,7,"hey"]) Traceback (most recent call last): @@ -858,6 +872,10 @@ def Circulant(self, n, integers): Traceback (most recent call last): ... ValueError: the list must contain only integers + + REFERENCES: + + - [LM2024]_ """ from sage.rings.integer_ring import ZZ From 0f3d363242fb56009aba0746712c0d621d24a06e Mon Sep 17 00:00:00 2001 From: janmenjayap Date: Sat, 3 Aug 2024 17:52:23 +0530 Subject: [PATCH 07/23] added Lov1983 --- src/doc/en/reference/references/index.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/doc/en/reference/references/index.rst b/src/doc/en/reference/references/index.rst index 7848956e1b5..c4f9b99712f 100644 --- a/src/doc/en/reference/references/index.rst +++ b/src/doc/en/reference/references/index.rst @@ -4417,6 +4417,11 @@ REFERENCES: IEEE Trans. Inf. Th. 25(1979), 1-7. :doi:`10.1109/TIT.1979.1055985`. +.. [Lov1983] László Lovász, + *Ear-decompositions of matching-covered graphs*, + Combinatorica 3, 105--117 (1983) + :doi:`10.1007/BF02579346`. + .. [LP2007] \G. Leander and A. Poschmann, *On the Classification of 4 Bit S-boxes*; in WAIFI, (2007), pp. 159-176. From 22a7c98884362172521d97abc1d3cb65079e39c6 Mon Sep 17 00:00:00 2001 From: janmenjayap Date: Sat, 3 Aug 2024 17:53:39 +0530 Subject: [PATCH 08/23] added KM2015 --- src/doc/en/reference/references/index.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/doc/en/reference/references/index.rst b/src/doc/en/reference/references/index.rst index c4f9b99712f..13fc95d778c 100644 --- a/src/doc/en/reference/references/index.rst +++ b/src/doc/en/reference/references/index.rst @@ -3887,6 +3887,10 @@ REFERENCES: 47:95-104, 1997. :doi:`10.1023/A:1022444205860` +.. [KM2015] Nishad Kothari and U.S.R. Murty. *K4-free and C6¯-free Planar + Matching Covered Graphs.* Journal of Graph Theory. 82. (2015) + :doi:`10.1002/jgt.21882`. + .. [KMAUTOM2000] Masayuki Kanda, Shiho Moriai, Kazumaro Aoki, Hiroki Ueda, Youichi Takashima, Kazuo Ohta, and Tsutomu Matsumoto, *E2 - a new 128-bit block cipher*; in IEICE Transactions on From d411e05c714bb030f2535f4eb1b9c284ec36c027 Mon Sep 17 00:00:00 2001 From: janmenjayap Date: Sat, 3 Aug 2024 17:58:59 +0530 Subject: [PATCH 09/23] added TricornGraph() --- src/sage/graphs/generators/smallgraphs.py | 91 ++++++++++++++++++++++- 1 file changed, 90 insertions(+), 1 deletion(-) diff --git a/src/sage/graphs/generators/smallgraphs.py b/src/sage/graphs/generators/smallgraphs.py index a39d287b41d..b3516ab78a7 100644 --- a/src/sage/graphs/generators/smallgraphs.py +++ b/src/sage/graphs/generators/smallgraphs.py @@ -4394,8 +4394,97 @@ def TietzeGraph(): def TricornGraph(): r""" Return the Tricorn graph. + + The Tricorn graph is obtained by splicing a complete graph `K_4` with the + the triangular circular ladder graph `\overline{C_6}`. (Note that this + generates a unqiue graph as both of the graphs `K_4` and `\overline{C_6}` + are vertex-transitive). It is a nonsolid brick. This matching covered graph + is one of the ten extremal cubic bricks. (A matching covered graph `G` is + *extremal* if `\Phi(G) = dim(\mathcal{Lin}(G))`, where `\Phi(G)` denotes + the number of perfect matchings of `G`, and `dim(\mathcal{Lin}(G))` stands + for the dimension of the linear space of `G`). + + The Tricorn graph has no removable doubletons and has precisely three + removable edges. The wheel graph `W_5` and the complete graph `K_4` are + matching minors of the Tricorn graph. + + As per a theorem of Lovász [Lov1983]_, each non bipartite matching covered + graph has a conformal subgraph which is either a bi-subdivision of `K_4` or + of `\overline{C_6}` or both. In their paper, Kothari and Murty [KM2015]_ + characterized those planar bricks that are free of `\overline{C_6}` (that + is, the planar bricks that do not contain a bi-subdivision of + `\overline{C_6}` as a conformal subgraph). Besides two infinite families of + matching covered graphs (odd wheel graphs and staircase graphs of order + *4k*), the Tricorn graph is the only exception brick that is simple, planar + and free of `\overline{C_6}`. + + PLOTTING: + + Upon construction, the position dictionary is filled to override + the spring-layout algorithm. By convention, the Tricorn graph is + displayed as mentioned in the book [LM2024]_, with the central vertex being + the `0`-th one. Rest of the nine vertices are shown in groups of three, + one on the top, rest two on the bottom left and on the bottom right + corners respectively. + + OUTPUT: + + - ``G`` -- the Tricorn graph + + EXAMPLES: + + Construct and show the Tricorn graph; note that the edges `(2, 3)`, + `(5, 6)` and `(8, 9)` are the only removable edges of the Tricorn + graph:: + + sage: g = graphs.TricornGraph() + sage: g.name() + 'Tricorn Graph' + sage: g.order() + 10 + sage: g.size() + 15 + sage: g.girth() + 3 + sage: g.diameter() + 3 + sage: g.is_hamiltonian() + True + sage: g.show() # long time # needs sage.plot + + REFERENCES: + + - [KM2015]_ + - [LM2024]_ + - [Lov1983]_ + + AUTHORS: + + - Janmenjaya Panda (2024-08-02) """ - raise NotImplementedError() + pos_dict = { + 0: (0, 0), + 1: (0, 1), + 2: (1/2, 1 + sqrt(3)/2), + 3: (-1/2, 1 + sqrt(3)/2), + 4: (-sqrt(3)/2, -1/2), + 5: (-sqrt(3)/2 - 1, -1/2), + 6: (-sqrt(3)/2 - 1/2, -1/2 - sqrt(3)/2), + 7: (sqrt(3)/2, -1/2), + 8: (sqrt(3)/2 + 1/2, -1/2 - sqrt(3)/2), + 9: (sqrt(3)/2 + 1, -1/2) + } + + G = Graph(10, pos=pos_dict, name="Tricorn Graph") + + for v in range(1, 8, 3): + G.add_edges([ + (0, v), (v, v+1), + (v, v+2), (v+1, v+2), + (v+2, int((-v**2 + 7*v + 4)/2)) + ]) + + return G def TruncatedIcosidodecahedralGraph(): From a3f76b93048428ece6f496d42bfac960e2936182 Mon Sep 17 00:00:00 2001 From: janmenjayap Date: Sun, 4 Aug 2024 11:26:13 +0530 Subject: [PATCH 10/23] added CLM2006 --- src/doc/en/reference/references/index.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/doc/en/reference/references/index.rst b/src/doc/en/reference/references/index.rst index 13fc95d778c..2005620cb05 100644 --- a/src/doc/en/reference/references/index.rst +++ b/src/doc/en/reference/references/index.rst @@ -1704,6 +1704,11 @@ REFERENCES: .. [CLG1997] Frank Celler and C. R. Leedham-Green, *Calculating the Order of an Invertible Matrix*, 1997 +.. [CLM2006] Marcelo H. de Carvalho, Cláudio L. Lucchesi and U.S.R. Murty, + *How to build a brick*, Discrete Mathematics, Volume 306, + Issues 19--20, Pages 2383--2410,ISSN 0012--365X, (2006), + :doi:`10.1016/j.disc.2005.12.032`. + .. [CLRS2001] Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest and Clifford Stein, *Section 22.4: Topological sort*, Introduction to Algorithms (2nd ed.), MIT Press and From 678f03dd0d4951cf4ef01f936b848b9a3e0f6b21 Mon Sep 17 00:00:00 2001 From: janmenjayap Date: Sun, 4 Aug 2024 11:29:10 +0530 Subject: [PATCH 11/23] added MurtyGraph() --- src/sage/graphs/generators/smallgraphs.py | 81 ++++++++++++++++++++++- 1 file changed, 80 insertions(+), 1 deletion(-) diff --git a/src/sage/graphs/generators/smallgraphs.py b/src/sage/graphs/generators/smallgraphs.py index b3516ab78a7..0e862df2db7 100644 --- a/src/sage/graphs/generators/smallgraphs.py +++ b/src/sage/graphs/generators/smallgraphs.py @@ -3828,8 +3828,87 @@ def MoserSpindle(): def MurtyGraph(): r""" Return the Murty graph. + + Consider the complete bipartite graph `K_{3, 3}`. There is a set of three + black vertices and a set of three white vertices. Now, consider splicing + the complete graph `K_4` with one of the black vertices, this generates the + graph `K_4 \odot K_{3, 3}`. The Murty graph is obtained from + `K_4 \odot K_{3, 3}` with the addition of an edge joining the remaining two + black vertices. The Murty graph is free of conformal bicycles; in + other words, the Murty graph is an example of a graph that is Birkhoff-von + Neumann as well as PM-compact. + + This is the smallest brick that is Birkhoff-von Neumann, aka a solid + brick, but is not odd-intercyclic. It is in this context that + Prof. U.S.R. Murty first stumbled upon this graph, and it also appears in + the work of Carvalho, Lucchesi, and Murty [CLM2006]_. + + PLOTTING: + + Upon construction, the position dictionary is filled to override + the spring-layout algorithm. By convention, the Murty graph is + displayed as mentioned in the paper [CKWL2019]_, with the first two + (noncubic) vertices on the top row, the second three vertices (that form a + stable set) in the middle row, and the remaining three vertices (that form + a triangle) at the bottom. + + OUTPUT: + + - ``G`` -- the Murty graph + + EXAMPLES: + + Construct and show the Murty graph:: + + sage: g = graphs.MurtyGraph() + sage: g.name() + 'Murty Graph' + sage: g.order() + 8 + sage: g.size() + 13 + sage: g.girth() + 3 + sage: g.diameter() + 2 + sage: g.is_hamiltonian() + True + sage: g.show() # long time # needs sage.plot + + REFERENCES: + + - [CKWL2019]_ + - [CLM2006]_ + - [LM2024]_ + + AUTHORS: + + - Janmenjaya Panda (2024-08-03) """ - raise NotImplementedError() + pos_dict = { + 0: (-0.5, sqrt(3)/2), + 1: (0.5, sqrt(3)/2), + 2: (-1, 0), + 3: (0, 0), + 4: (1, 0), + 5: (-0.5, -1 - sqrt(3)/2), + 6: (0, -1), + 7: (0.5, -1 - sqrt(3)/2) + } + + G = Graph(8, pos=pos_dict, name="Murty Graph") + + G.add_edge(0, 1) + for v in range(2, 5): + G.add_edges([ + (0, v), (1, v), (v, v+3) + ]) + + G.add_edges([ + (5, 6), (5, 7), (6, 7) + ]) + + return G def NauruGraph(embedding=2): From 24c94a1a1a062b597fd67bef0ceb4585651959dc Mon Sep 17 00:00:00 2001 From: janmenjayap Date: Wed, 7 Aug 2024 09:55:34 +0530 Subject: [PATCH 12/23] added RST2019 --- src/doc/en/reference/references/index.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/doc/en/reference/references/index.rst b/src/doc/en/reference/references/index.rst index 2005620cb05..51c736f48ad 100644 --- a/src/doc/en/reference/references/index.rst +++ b/src/doc/en/reference/references/index.rst @@ -5611,6 +5611,11 @@ REFERENCES: .. [RS2012] G. Rudolph and M. Schmidt, "Differential Geometry and Mathematical Physics. Part I. Manifolds, Lie Groups and Hamiltonian Systems", Springer, 2012. +.. [RST2019] Neil Robertson, Paul Seymour and Robin Thomas, *Excluded minors in + cubic graphs*, Journal of Combinatorial Theory, Series B, vol. 138, + (2019), pages: 219 -- 285, ISSN: 0095 -- 8956, + :doi:`10.1016/j.jctb.2019.02.002`. + .. [RSW2011] Victor Reiner, Franco Saliola, Volkmar Welker. *Spectra of Symmetrized Shuffling Operators*. :arxiv:`1102.2460v2`. From 0cc1ee8ec98626335ceb8f03847a34d19c06e325 Mon Sep 17 00:00:00 2001 From: janmenjayap Date: Wed, 7 Aug 2024 09:57:22 +0530 Subject: [PATCH 13/23] added FiLi2001 --- src/doc/en/reference/references/index.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/doc/en/reference/references/index.rst b/src/doc/en/reference/references/index.rst index 51c736f48ad..1d06064bbf8 100644 --- a/src/doc/en/reference/references/index.rst +++ b/src/doc/en/reference/references/index.rst @@ -2602,6 +2602,11 @@ REFERENCES: Wehler K3 Surfaces over finite fields*. New Zealand Journal of Mathematics 45 (2015), 19–31. +.. [FiLi2001] Ilse Fischer and Charles H.C. Little, *A Characterisation of + Pfaffian Near Bipartite Graphs*, Journal of Combinatorial Theory, + Series B, vol. 82, issue 2, (2001), pages: 175 -- 222, ISSN: + 0095 -- 8956, :doi:`10.1006/jctb.2000.2025`. + .. [FIV2012] \H. Fournier, A. Ismail, and A. Vigneron. *Computing the Gromov hyperbolicity of a discrete metric space*. 2012. :arxiv:`1210.3323`. From db3372946e3e34cd3557710951dd12a9dca501f8 Mon Sep 17 00:00:00 2001 From: janmenjayap Date: Wed, 7 Aug 2024 09:58:50 +0530 Subject: [PATCH 14/23] added CHNP2020 --- src/doc/en/reference/references/index.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/doc/en/reference/references/index.rst b/src/doc/en/reference/references/index.rst index 1d06064bbf8..d841dda3b39 100644 --- a/src/doc/en/reference/references/index.rst +++ b/src/doc/en/reference/references/index.rst @@ -1431,6 +1431,11 @@ REFERENCES: for closed Riemannian manifolds*, Ann. of Math. (2) 45 (1944), 747–752. +.. [CHNP2020] Kieran Clancy, Michael Haythorpe, Alex Newcombe and Ed Pegg Jr, + *There Are No Cubic Graphs on 26 Vertices with Crossing Number 10 + or 11*, Graphs and Combinatorics 36, pages: 1713 -- 1721, (2020), + :doi:`10.1007/s00373-020-02204-6`. + .. [CP2023] \M. Cati and D.V. Pasechnik. *Implementing Hadamard Matrices in SageMath*. Preprint, :arxiv:`2306.16812`, (2023). From 7fff8dbf4f786e1d5898fbdeb4013d651257d57f Mon Sep 17 00:00:00 2001 From: janmenjayap Date: Wed, 7 Aug 2024 10:01:52 +0530 Subject: [PATCH 15/23] added CubeplexGraph() --- src/sage/graphs/generators/smallgraphs.py | 167 +++++++++++++++++++++- 1 file changed, 165 insertions(+), 2 deletions(-) diff --git a/src/sage/graphs/generators/smallgraphs.py b/src/sage/graphs/generators/smallgraphs.py index 0e862df2db7..2accf7b2043 100644 --- a/src/sage/graphs/generators/smallgraphs.py +++ b/src/sage/graphs/generators/smallgraphs.py @@ -1901,11 +1901,174 @@ def CoxeterGraph(): return g -def CubeplexGraph(): +def CubeplexGraph(embedding='LM'): r""" Return the Cubeplex graph. + + The Cubeplex graph is the cubic hamiltonian graph of order 12 that + corresponds to the graph labeled as `\Gamma_1` in Fischer and Little + [FiLi2001]_. It has LCF notation `[-6, -5, -3, -6, 3, 5, -6, -3, 5, -6, -5, + 3]`. + + The Fischer-Little Theorem [FiLi2001]_ may be stated as follows [LM2024]_: + + A near-bipartite graph is non-Pfaffian if and only if it contains one of + the graphs `K_{3, 3}`, `\Gamma_1` and `\Gamma_2` as an `S`-minor. + + Norine and Thomas [NT2007]_ use the term ``Cubeplex`` to describe one of + the 12-vertex cubic graphs, `\Gamma_1` and `\Gamma_2`, as defined by + Fischer and Little [FiLi2001]_. However, the figure in their paper that + supposedly provides embeddings for the graphs labeled Cubeplex and Twinplex + actually shows both embeddings corresponding to Fischer and Little's + `\Gamma_1`, which is the Cubeplex graph. Followingly, for + ``embedding='NT'``, we present only the embedding that is shown by the + labeling ``Cubeplex`` in the paper of Norine and Thomas [NT2007]_. + + PLOTTING: + + Upon construction, the position dictionary is filled to override + the spring-layout algorithm. For different values of the parameter + ``embedding``, the Cubeplex graph is displayed as it is mentioned in the + respective paper/ book. + + INPUT: + + - ``embedding`` -- string (default: ``'LM'``) + + - ``'LM'`` displays the embedding as shown for `\Gamma_1` by Lucchesi and + Murty [LM2024]_ + + - ``'FL'`` displays the embedding as shown for `\Gamma_1` by Fischer and + Little [FiLi2001]_ + + - ``'NT'`` displays the embedding as shown for the ``Cubeplex`` by Norine + and Thomas [NT2007]_ + + OUTPUT: + + - ``G`` -- the Cubeplex graph; note that a :class:`ValueError` is returned + if ``embedding`` is none of ``'FT'``, ``'NT'`` or ``'LM'`` + + EXAMPLES: + + Construct and show the Cubeplex graph:: + + sage: g = graphs.CubeplexGraph() + sage: g.name() + 'Cubeplex Graph' + sage: g.order() + 12 + sage: g.size() + 18 + sage: g.girth() + 4 + sage: g.diameter() + 3 + sage: g.is_hamiltonian() + True + sage: g.crossing_number() + 1 + sage: g.show() # long time # needs sage.plot + + TEST: + + Note that all three embeddings refer to the same graph, the Cubeplex graph, + aka `\Gamma_1`:: + + sage: fl = graphs.CubeplexGraph(embedding='FL') + sage: nt = graphs.CubeplexGraph(embedding='NT') + sage: lm = graphs.CubeplexGraph(embedding='LM') + sage: fl.is_isomorphic(nt) and fl.is_isomorphic(lm) + True + + The input parameter must be one of 'FL', 'NT' or 'LM':: + + sage: g = graphs.TwinplexGraph(embedding='embedding') + Traceback (most recent call last): + ... + ValueError: parameter 'embedding' must be either 'FL' or 'NT' or + otherwise 'LM' + + REFERENCES: + + - [FiLi2001]_ + - [LM2024]_ + - [NT2007]_ + + .. SEEALSO:: + + :meth:`~sage.graphs.graph_generators.GraphGenerators.TwinplexGraph` + + AUTHORS: + + - Janmenjaya Panda (2024-08-03) """ - raise NotImplementedError() + if embedding == 'FL': + from math import pi + + G = Graph(12, name='Cubeplex Graph') + G._circle_embedding(list(range(12)), angle=2*pi/3) + G.add_cycle(list(range(12))) + + G.add_edges([ + (0, 3), (1, 6), (2, 8), + (4, 9), (5, 11), (7, 10) + ]) + + elif embedding == 'NT': + pos_dict = { + 0: (1, 2), + 1: (3, 2), + 2: (0, 1), + 3: (1, 1), + 4: (2, 1), + 5: (3, 1), + 6: (4, 1), + 7: (0, -1), + 8: (1, 0), + 9: (2, 0), + 10: (3, 0), + 11: (4, -1), + } + + G = Graph(12, pos=pos_dict, name='Cubeplex Graph') + G.add_edges([ + (0, 2), (0, 4), (0, 6), + (1, 3), (1, 5), (1, 6), + (2, 7), (2, 8), (3, 7), + (3, 8), (4, 9), (4, 10), + (5, 9), (5, 10), (6, 11), + (7, 11), (8, 9), (10, 11) + ]) + + elif embedding == 'LM': + from math import pi + + pos_dict = { + 8: (0, 1), + 9: (1, 0), + 10: (-3*cos(pi/16), -3*sin(pi/16)), + 11: (3*cos(pi/16), -3*sin(pi/16)) + } + + for v in range(8): + t = pi * (v+2)/4 + pos_dict[v] = (-2*cos(t), 2*sin(t)) + + + G = Graph(12, pos=pos_dict, name='Cubeplex Graph') + + G.add_cycle(list(range(8))) + G.add_edges([ + (0, 8), (1, 11), (2, 9), (3, 11), (4, 8), + (5, 10), (6, 9), (7, 10), (8, 9), (10, 11) + ]) + + else: + raise ValueError("parameter 'embedding' must be either 'FL' or 'NT' or\ + otherwise 'LM'") + + return G def DejterGraph(): From f1eb8327001b9b14b0a4ce0d400fae907af6aca3 Mon Sep 17 00:00:00 2001 From: janmenjayap Date: Wed, 7 Aug 2024 10:03:37 +0530 Subject: [PATCH 16/23] added TwinplexGraph() --- src/sage/graphs/generators/smallgraphs.py | 203 +++++++++++++++++++++- 1 file changed, 201 insertions(+), 2 deletions(-) diff --git a/src/sage/graphs/generators/smallgraphs.py b/src/sage/graphs/generators/smallgraphs.py index 2accf7b2043..abf2ceab281 100644 --- a/src/sage/graphs/generators/smallgraphs.py +++ b/src/sage/graphs/generators/smallgraphs.py @@ -4928,11 +4928,210 @@ def TutteGraph(): return g -def TwinplexGraph(): +def TwinplexGraph(embedding='LM'): r""" Return the Twinplex graph. + + The Twinplex graph is a cubic hamiltonian graph of order 12 with the graph + crossing number 2 and has a girth 5 (that is the maximal girth among all + cubic graphs on 12 vertices [CHNP2020]_). It corresponds to the graph + labeled as `\Gamma_2` by Fischer and Little [FiLi2001]_. The Twinplex graph + has LCF notation `[-5, -4, 4, -4, 4, 5, -4, 5, -4, 4, -5, 4]`. + + The Fischer-Little Theorem [FiLi2001]_ may be stated as follows [LM2024]_: + + A near-bipartite graph is non-Pfaffian if and only if it contains one of + the graphs `K_{3, 3}`, `\Gamma_1` and `\Gamma_2` as an `S`-minor. + + Norine and Thomas [NT2007]_ use the term ``Twinplex`` to describe one of + the 12-vertex cubic graphs, `\Gamma_1` and `\Gamma_2`, as defined by + Fischer and Little [FiLi2001]_. However, the figure in their paper that + supposedly provides embeddings for the graphs labeled Cubeplex and Twinplex + actually shows both embeddings corresponding to Fischer and Little's + `\Gamma_1`, which is the Cubeplex graph. Followingly, for + ``embedding='NT'``, we present a correct version of the Twinplex graph + with a slight modification of the embedding that is labeled as ``Twinplex`` + in the paper of Norine and Thomas [NT2007]_. + + PLOTTING: + + Upon construction, the position dictionary is filled to override + the spring-layout algorithm. For different values of the parameter + ``embedding``, the Twinplex graph is displayed as it is mentioned in the + respective paper/ book. Note that for ``embedding='NT'``, a correct + embedding of the Twinplex graph is displayed with a minor modification to + the (incorrect) embedding shown in the paper [NT2007]_. + + INPUT: + + - ``embedding`` -- string (default: ``'LM'``) + + - ``'LM'`` displays the embedding as shown for `\Gamma_2` by Lucchesi and + Murty [LM2024]_ + + - ``'FL'`` displays the embedding as shown for `\Gamma_2` by Fischer and + Little [FiLi2001]_ + + - ``'NT'`` displays the correct embedding with a minor modification to + the one shown as the (incorrect) ``Twinplex`` by Norine and Thomas + [NT2007]_ + + - ``'RST'`` displays the embedding as shown for the ``Twinplex`` by + Robertson, Seymour and Thomas [RST2019]_ + + OUTPUT: + + - ``G`` -- the Twinplex graph; note that a :class:`ValueError` is returned + if ``embedding`` is none of ``'FT'``, ``'NT'``, ``'RST'`` or ``'LM'`` + + EXAMPLES: + + Construct and show the Twinplex graph:: + + sage: g = graphs.TwinplexGraph() + sage: g.name() + 'Twinplex Graph' + sage: g.order() + 12 + sage: g.size() + 18 + sage: g.girth() + 5 + sage: g.diameter() + 3 + sage: g.is_hamiltonian() + True + sage: g.crossing_number() + 2 + sage: g.show() # long time # needs sage.plot + + TEST: + + Note that all four embeddings refer to the same graph, the Twinplex graph, + aka `\Gamma_2`:: + + sage: fl = graphs.TwinplexGraph(embedding='FL') + sage: nt = graphs.TwinplexGraph(embedding='NT') + sage: rst = graphs.TwinplexGraph(embedding='RST') + sage: lm = graphs.TwinplexGraph(embedding='LM') + sage: fl.is_isomorphic(nt) and fl.is_isomorphic(rst) and \ + fl.is_isomorphic(lm) + True + + The input parameter must be one of 'FL', 'NT', 'RST' or 'LM':: + + sage: g = graphs.TwinplexGraph(embedding='embedding') + Traceback (most recent call last): + ... + ValueError: parameter 'embedding' must be either 'FL' or 'NT' or + 'LM' or otherwise 'RST' + + REFERENCES: + + - [FiLi2001]_ + - [LM2024]_ + - [NT2007]_ + - [RST2019]_ + + .. SEEALSO:: + + :meth:`~sage.graphs.graph_generators.GraphGenerators.CubeplexGraph` + + AUTHORS: + + - Janmenjaya Panda (2024-08-03) """ - raise NotImplementedError() + if embedding == 'FL': + from math import pi + + G = Graph(12, name='Twinplex Graph') + G._circle_embedding(list(range(12)), angle=5*pi/12) + G.add_cycle(list(range(12))) + + G.add_edges([ + (0, 8), (1, 5), (2, 9), + (3, 7), (4, 11), (6, 10) + ]) + + elif embedding == 'NT': + pos_dict = { + 0: (1, 2), + 1: (3, 2), + 2: (0, 1), + 3: (1, 1), + 4: (2, 1), + 5: (3, 1), + 6: (4, 1), + 7: (0, -1), + 8: (1, 0), + 9: (2, 0), + 10: (3, 0), + 11: (4, -1), + } + + G = Graph(12, pos=pos_dict, name='Twinplex Graph') + G.add_edges([ + (0, 2), (0, 4), (0, 6), + (1, 3), (1, 5), (1, 6), + (2, 7), (2, 9), (3, 7), + (3, 8), (4, 8), (4, 10), + (5, 9), (5, 10), (6, 11), + (7, 11), (8, 9), (10, 11) + ]) + + elif embedding == 'RST': + pos_dict = { + 0: (-1, 3), + 1: (1, 3), + 2: (3, 1), + 3: (3, -1), + 4: (1, -3), + 5: (-1, -3), + 6: (-3, -1), + 7: (-3, 1), + 8: (-1, 1), + 9: (1, 1), + 10: (1, -1), + 11: (-1, -1) + } + + G = Graph(12, pos=pos_dict, name='Twinplex Graph') + + G.add_cycle(list(range(8))) + G.add_edges([ + (0, 4), (1, 8), (2, 10), + (3, 9), (5, 10), (6, 8), + (7, 11), (8, 9), (9, 11), + (10, 11) + ]) + + elif embedding == 'LM': + from math import pi + + pos_dict = { + 8: (0, 1), + 9: (1, 0), + 10: (-3*cos(pi/16), -3*sin(pi/16)), + 11: (3*cos(pi/16), -3*sin(pi/16)) + } + + for v in range(8): + t = pi * (v+2)/4 + pos_dict[v] = (-2*cos(t), 2*sin(t)) + + G = Graph(12, pos=pos_dict, name='Twinplex Graph') + + G.add_cycle(list(range(8))) + G.add_edges([ + (0, 8), (1, 11), (2, 9), (3, 10), (4, 8), + (5, 11), (6, 9), (7, 10), (8, 9), (10, 11) + ]) + + else: + raise ValueError("parameter 'embedding' must be either 'FL' or 'NT' or\ + 'LM' or otherwise 'RST'") + + return G def WagnerGraph(): From 906e670c007fd2133283541b510cb4608f235760 Mon Sep 17 00:00:00 2001 From: janmenjayap Date: Wed, 7 Aug 2024 10:09:34 +0530 Subject: [PATCH 17/23] updated the indentation --- src/sage/graphs/generators/smallgraphs.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/sage/graphs/generators/smallgraphs.py b/src/sage/graphs/generators/smallgraphs.py index abf2ceab281..d07fa19b4e8 100644 --- a/src/sage/graphs/generators/smallgraphs.py +++ b/src/sage/graphs/generators/smallgraphs.py @@ -4063,13 +4063,9 @@ def MurtyGraph(): G.add_edge(0, 1) for v in range(2, 5): - G.add_edges([ - (0, v), (1, v), (v, v+3) - ]) + G.add_edges([(0, v), (1, v), (v, v+3)]) - G.add_edges([ - (5, 6), (5, 7), (6, 7) - ]) + G.add_edges([(5, 6), (5, 7), (6, 7)]) return G From a55d3b99a580690cc11b017f02fad0181f609c84 Mon Sep 17 00:00:00 2001 From: janmenjayap Date: Wed, 7 Aug 2024 10:18:54 +0530 Subject: [PATCH 18/23] changed TEST to TESTS --- src/sage/graphs/generators/smallgraphs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/graphs/generators/smallgraphs.py b/src/sage/graphs/generators/smallgraphs.py index 2a0b50f3f60..d3117e15f3d 100644 --- a/src/sage/graphs/generators/smallgraphs.py +++ b/src/sage/graphs/generators/smallgraphs.py @@ -1968,7 +1968,7 @@ def CubeplexGraph(embedding='LM'): 1 sage: g.show() # long time # needs sage.plot - TEST: + TESTS: Note that all three embeddings refer to the same graph, the Cubeplex graph, aka `\Gamma_1`:: @@ -4997,7 +4997,7 @@ def TwinplexGraph(embedding='LM'): 2 sage: g.show() # long time # needs sage.plot - TEST: + TESTS: Note that all four embeddings refer to the same graph, the Twinplex graph, aka `\Gamma_2`:: From 3b2fac9e0ae8aece1867678138bef135cba91aa0 Mon Sep 17 00:00:00 2001 From: janmenjayap Date: Wed, 7 Aug 2024 11:08:06 +0530 Subject: [PATCH 19/23] removed an extra blank line --- src/sage/graphs/generators/smallgraphs.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/sage/graphs/generators/smallgraphs.py b/src/sage/graphs/generators/smallgraphs.py index d3117e15f3d..ad0e357dc31 100644 --- a/src/sage/graphs/generators/smallgraphs.py +++ b/src/sage/graphs/generators/smallgraphs.py @@ -2053,7 +2053,6 @@ def CubeplexGraph(embedding='LM'): t = pi * (v+2)/4 pos_dict[v] = (-2*cos(t), 2*sin(t)) - G = Graph(12, pos=pos_dict, name='Cubeplex Graph') G.add_cycle(list(range(8))) From d24a3b00b0df51348a288ac55ec4c835a2f8eed2 Mon Sep 17 00:00:00 2001 From: janmenjayap Date: Thu, 8 Aug 2024 02:40:50 +0530 Subject: [PATCH 20/23] corrected the ValueError message --- src/sage/graphs/generators/smallgraphs.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/sage/graphs/generators/smallgraphs.py b/src/sage/graphs/generators/smallgraphs.py index ad0e357dc31..2d3d846a36d 100644 --- a/src/sage/graphs/generators/smallgraphs.py +++ b/src/sage/graphs/generators/smallgraphs.py @@ -1981,11 +1981,10 @@ def CubeplexGraph(embedding='LM'): The input parameter must be one of 'FL', 'NT' or 'LM':: - sage: g = graphs.TwinplexGraph(embedding='embedding') + sage: g = graphs.CubeplexGraph(embedding='embedding') Traceback (most recent call last): ... - ValueError: parameter 'embedding' must be either 'FL' or 'NT' or - otherwise 'LM' + ValueError: parameter 'embedding' must be 'FL', 'NT' or 'LM' REFERENCES: @@ -2062,8 +2061,7 @@ def CubeplexGraph(embedding='LM'): ]) else: - raise ValueError("parameter 'embedding' must be either 'FL' or 'NT' or\ - otherwise 'LM'") + raise ValueError("parameter 'embedding' must be 'FL', 'NT' or 'LM'") return G @@ -5014,8 +5012,7 @@ def TwinplexGraph(embedding='LM'): sage: g = graphs.TwinplexGraph(embedding='embedding') Traceback (most recent call last): ... - ValueError: parameter 'embedding' must be either 'FL' or 'NT' or - 'LM' or otherwise 'RST' + ValueError: parameter 'embedding' must be 'FL', 'NT', 'LM' or 'RST' REFERENCES: @@ -5119,8 +5116,8 @@ def TwinplexGraph(embedding='LM'): ]) else: - raise ValueError("parameter 'embedding' must be either 'FL' or 'NT' or\ - 'LM' or otherwise 'RST'") + raise ValueError("parameter 'embedding' must be 'FL', 'NT', 'LM' or" + + " 'RST'") return G From 0a89c3600a66739adb1164d58edc3a3a1efa8194 Mon Sep 17 00:00:00 2001 From: janmenjayap Date: Sat, 10 Aug 2024 15:01:46 +0530 Subject: [PATCH 21/23] updated the documentation and code style --- src/sage/graphs/digraph_generators.py | 18 ++++++---------- src/sage/graphs/generators/smallgraphs.py | 26 ++++++----------------- 2 files changed, 14 insertions(+), 30 deletions(-) diff --git a/src/sage/graphs/digraph_generators.py b/src/sage/graphs/digraph_generators.py index 2c564aa18d9..e7495b910f0 100644 --- a/src/sage/graphs/digraph_generators.py +++ b/src/sage/graphs/digraph_generators.py @@ -835,11 +835,11 @@ def Circulant(self, n, integers): r""" Return a circulant digraph on `n` vertices from a set of integers. - Note that ``digraphs.Circulant(7, [1, 5])`` is also known as the - ``Koh-Tindell digraph``. It is a directed circulant based on - `\mathbb{Z}_7`. This `2`-diregular digraph is is vertex-transitive - but not arc-transitive. The associated bipartite digraph of the - Koh-Tindell digraph is a Pfaffian orientation of the Heawood graph. + The Koh-Tindell digraph [LM2024]_ is the circulant digraph of order 7 + with parameters `[1, 5]`. This `2`-diregular digraph is is + vertex-transitive but not arc-transitive. The associated bipartite + digraph of the Koh-Tindell digraph is a Pfaffian orientation of the + Heawood graph. INPUT: @@ -851,10 +851,10 @@ def Circulant(self, n, integers): EXAMPLES: - Construct and show the circulant graph ([3, 5, 7]): a digraph on 13 + Construct and show the circulant graph [3, 5, 7], a digraph on 13 vertices:: - sage: g = digraphs.Circulant(13,[3,5,7]) + sage: g = digraphs.Circulant(13, [3, 5, 7]) sage: g.show() # long time # needs sage.plot Construct and show the Koh-Tindell digraph:: @@ -872,10 +872,6 @@ def Circulant(self, n, integers): Traceback (most recent call last): ... ValueError: the list must contain only integers - - REFERENCES: - - - [LM2024]_ """ from sage.rings.integer_ring import ZZ diff --git a/src/sage/graphs/generators/smallgraphs.py b/src/sage/graphs/generators/smallgraphs.py index 2d3d846a36d..119b3f6fccd 100644 --- a/src/sage/graphs/generators/smallgraphs.py +++ b/src/sage/graphs/generators/smallgraphs.py @@ -1986,12 +1986,6 @@ def CubeplexGraph(embedding='LM'): ... ValueError: parameter 'embedding' must be 'FL', 'NT' or 'LM' - REFERENCES: - - - [FiLi2001]_ - - [LM2024]_ - - [NT2007]_ - .. SEEALSO:: :meth:`~sage.graphs.graph_generators.GraphGenerators.TwinplexGraph` @@ -2004,7 +1998,6 @@ def CubeplexGraph(embedding='LM'): from math import pi G = Graph(12, name='Cubeplex Graph') - G._circle_embedding(list(range(12)), angle=2*pi/3) G.add_cycle(list(range(12))) G.add_edges([ @@ -2012,6 +2005,8 @@ def CubeplexGraph(embedding='LM'): (4, 9), (5, 11), (7, 10) ]) + G._circle_embedding(list(range(12)), angle=2*pi/3) + elif embedding == 'NT': pos_dict = { 0: (1, 2), @@ -5003,8 +4998,7 @@ def TwinplexGraph(embedding='LM'): sage: nt = graphs.TwinplexGraph(embedding='NT') sage: rst = graphs.TwinplexGraph(embedding='RST') sage: lm = graphs.TwinplexGraph(embedding='LM') - sage: fl.is_isomorphic(nt) and fl.is_isomorphic(rst) and \ - fl.is_isomorphic(lm) + sage: all(fl.is_isomorphic(g) for g in (nt, rst, lm)) True The input parameter must be one of 'FL', 'NT', 'RST' or 'LM':: @@ -5014,13 +5008,6 @@ def TwinplexGraph(embedding='LM'): ... ValueError: parameter 'embedding' must be 'FL', 'NT', 'LM' or 'RST' - REFERENCES: - - - [FiLi2001]_ - - [LM2024]_ - - [NT2007]_ - - [RST2019]_ - .. SEEALSO:: :meth:`~sage.graphs.graph_generators.GraphGenerators.CubeplexGraph` @@ -5033,7 +5020,6 @@ def TwinplexGraph(embedding='LM'): from math import pi G = Graph(12, name='Twinplex Graph') - G._circle_embedding(list(range(12)), angle=5*pi/12) G.add_cycle(list(range(12))) G.add_edges([ @@ -5041,6 +5027,8 @@ def TwinplexGraph(embedding='LM'): (3, 7), (4, 11), (6, 10) ]) + G._circle_embedding(list(range(12)), angle=5*pi/12) + elif embedding == 'NT': pos_dict = { 0: (1, 2), @@ -5116,8 +5104,8 @@ def TwinplexGraph(embedding='LM'): ]) else: - raise ValueError("parameter 'embedding' must be 'FL', 'NT', 'LM' or" + - " 'RST'") + raise ValueError("parameter 'embedding' must be 'FL', 'NT'," + " 'LM' or 'RST'") return G From a382a50a9443cf1aac55583502a65e479afa1fd8 Mon Sep 17 00:00:00 2001 From: janmenjayap Date: Sat, 10 Aug 2024 21:12:51 +0530 Subject: [PATCH 22/23] updated the documentation --- src/sage/graphs/digraph_generators.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/sage/graphs/digraph_generators.py b/src/sage/graphs/digraph_generators.py index e7495b910f0..959d6d1c6a0 100644 --- a/src/sage/graphs/digraph_generators.py +++ b/src/sage/graphs/digraph_generators.py @@ -835,11 +835,8 @@ def Circulant(self, n, integers): r""" Return a circulant digraph on `n` vertices from a set of integers. - The Koh-Tindell digraph [LM2024]_ is the circulant digraph of order 7 - with parameters `[1, 5]`. This `2`-diregular digraph is is - vertex-transitive but not arc-transitive. The associated bipartite - digraph of the Koh-Tindell digraph is a Pfaffian orientation of the - Heawood graph. + A circulant digraph of order `n` has an arc from vertex `i` to + vertex `i+j \pmod{n}`, for each `j` in ``integers``. INPUT: @@ -857,7 +854,11 @@ def Circulant(self, n, integers): sage: g = digraphs.Circulant(13, [3, 5, 7]) sage: g.show() # long time # needs sage.plot - Construct and show the Koh-Tindell digraph:: + The Koh-Tindell digraph [LM2024]_ is the circulant digraph of order 7 + with parameters `[1, 5]`. This `2`-diregular digraph is is + vertex-transitive but not arc-transitive. The associated bipartite + digraph of the Koh-Tindell digraph is a Pfaffian orientation of the + Heawood graph. Construct and show the Koh-Tindell digraph:: sage: kohTindellDigraph = digraphs.Circulant(7, [1, 5]) sage: kohTindellDigraph.show() # long time # needs sage.plot From 954a44eee472341b399882e2f4f9448d04bad0ed Mon Sep 17 00:00:00 2001 From: janmenjayap Date: Sun, 11 Aug 2024 17:25:14 +0530 Subject: [PATCH 23/23] updated the documentation --- src/sage/graphs/digraph_generators.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sage/graphs/digraph_generators.py b/src/sage/graphs/digraph_generators.py index 959d6d1c6a0..751e07dc82e 100644 --- a/src/sage/graphs/digraph_generators.py +++ b/src/sage/graphs/digraph_generators.py @@ -855,7 +855,7 @@ def Circulant(self, n, integers): sage: g.show() # long time # needs sage.plot The Koh-Tindell digraph [LM2024]_ is the circulant digraph of order 7 - with parameters `[1, 5]`. This `2`-diregular digraph is is + with parameters `[1, 5]`. This `2`-diregular digraph is vertex-transitive but not arc-transitive. The associated bipartite digraph of the Koh-Tindell digraph is a Pfaffian orientation of the Heawood graph. Construct and show the Koh-Tindell digraph:: @@ -865,11 +865,11 @@ def Circulant(self, n, integers): TESTS: - sage: digraphs.Circulant(13,[3,5,7,"hey"]) + sage: digraphs.Circulant(13, [3, 5, 7, "hey"]) Traceback (most recent call last): ... ValueError: the list must contain only integers - sage: digraphs.Circulant(3,[3,5,7,3.4]) + sage: digraphs.Circulant(3, [3, 5, 7, 3.4]) Traceback (most recent call last): ... ValueError: the list must contain only integers