From c34522397d187b33170197f4cedb461bcf7f1b96 Mon Sep 17 00:00:00 2001 From: Omegaconstant Date: Sun, 9 Jun 2024 11:05:08 +0530 Subject: [PATCH 01/11] initialized the generators --- src/sage/graphs/generators/families.py | 12 ++++++++++++ src/sage/graphs/graph_generators.py | 9 +++++++++ 2 files changed, 21 insertions(+) diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py index 02998662ba0..19630bee293 100644 --- a/src/sage/graphs/generators/families.py +++ b/src/sage/graphs/generators/families.py @@ -4455,3 +4455,15 @@ def CubeConnectedCycle(d): G.add_edge((x, y), (x ^ (1 << y), y)) return G + + +def StaircaseGraph(n): + pass + + +def BiwheelGraph(n): + pass + + +def TruncatedBiwheelGraph(n): + pass \ No newline at end of file diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generators.py index 5a09c617ba2..bd3dc6d801b 100644 --- a/src/sage/graphs/graph_generators.py +++ b/src/sage/graphs/graph_generators.py @@ -228,6 +228,7 @@ def wrap_name(x): "BalancedTree", "BarbellGraph", "BilinearFormsGraph", + "BiwheelGraph", "BubbleSortGraph", "CaiFurerImmermanGraph", "chang_graphs", @@ -284,8 +285,10 @@ def wrap_name(x): "SierpinskiGasketGraph", "SquaredSkewHadamardMatrixGraph", "SwitchedSquaredSkewHadamardMatrixGraph", + "StaircaseGraph", "strongly_regular_graph", "trees", + "TruncatedBiwheelGraph", "nauty_gentreeg", "triangulations", "TuranGraph", @@ -454,6 +457,9 @@ def wrap_name(x): - Marco Cognetta (2016-03-03): added TuranGraph +- Janmenjaya Panda (2024-06-09): added StaircaseGraph, BiwheelGraph and + TruncatedBiwheelGraph + Functions and methods --------------------- @@ -2639,6 +2645,7 @@ def quadrangulations(self, order, minimum_degree=None, minimum_connectivity=None BalancedTree = staticmethod(families.BalancedTree) BarbellGraph = staticmethod(families.BarbellGraph) BilinearFormsGraph = staticmethod(distance_regular.BilinearFormsGraph) + BiwheelGraph = staticmethod(families.BiwheelGraph) BubbleSortGraph = staticmethod(families.BubbleSortGraph) CaiFurerImmermanGraph = staticmethod(families.CaiFurerImmermanGraph) chang_graphs = staticmethod(families.chang_graphs) @@ -2692,10 +2699,12 @@ def quadrangulations(self, order, minimum_degree=None, minimum_connectivity=None SierpinskiGasketGraph = staticmethod(families.SierpinskiGasketGraph) SquaredSkewHadamardMatrixGraph = staticmethod(families.SquaredSkewHadamardMatrixGraph) SwitchedSquaredSkewHadamardMatrixGraph = staticmethod(families.SwitchedSquaredSkewHadamardMatrixGraph) + StaircaseGraph = staticmethod(families.StaircaseGraph) strongly_regular_graph = staticmethod(strongly_regular_db.strongly_regular_graph) TabacjnGraph = staticmethod(families.TabacjnGraph) TadpoleGraph = staticmethod(families.TadpoleGraph) trees = staticmethod(families.trees) + TruncatedBiwheelGraph = staticmethod(families.TruncatedBiwheelGraph) nauty_gentreeg = staticmethod(families.nauty_gentreeg) TuranGraph = staticmethod(families.TuranGraph) UstimenkoGraph = staticmethod(distance_regular.UstimenkoGraph) From af2dd670407740e988a51819be4433b315f879d6 Mon Sep 17 00:00:00 2001 From: Omegaconstant Date: Sun, 9 Jun 2024 11:18:47 +0530 Subject: [PATCH 02/11] added LM2024 --- src/doc/en/reference/references/index.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/doc/en/reference/references/index.rst b/src/doc/en/reference/references/index.rst index 44c22814471..7fec6cb5037 100644 --- a/src/doc/en/reference/references/index.rst +++ b/src/doc/en/reference/references/index.rst @@ -397,7 +397,7 @@ REFERENCES: **B** -.. [Bab86] L. Babai. *On Lovász' lattice reduction and the nearest lattice point problem*, +.. [Bab86] L. Babai. *On Lovász' lattice reduction and the nearest lattice point problem*, Combinatorica, 6(1), 1986, 1-13. :doi:`10.1007/BF02579403`. .. [Baer2020] Christian Bär. *The Faddeev-LeVerrier algorithm and the Pfaffian*. @@ -4331,6 +4331,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 ec2b155277f0142be3683d61d51282c9b5598cfa Mon Sep 17 00:00:00 2001 From: Omegaconstant Date: Sun, 9 Jun 2024 12:05:40 +0530 Subject: [PATCH 03/11] added StaircaseGraph --- src/sage/graphs/generators/families.py | 103 ++++++++++++++++++++++++- 1 file changed, 102 insertions(+), 1 deletion(-) diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py index 19630bee293..7da2f03798e 100644 --- a/src/sage/graphs/generators/families.py +++ b/src/sage/graphs/generators/families.py @@ -4458,7 +4458,108 @@ def CubeConnectedCycle(d): def StaircaseGraph(n): - pass + r""" + Return a staircase graph with `2n` nodes + + For `n \geqslant 3`, the staircase graph of order `2n` is the graph obtained + from the ladder graph of order `2n - 2`, i.e., ``graphs.LadderGraph(n - 1)`` + by introducing two new nodes `2n - 2` and `2n - 1`, and then joining the + node `2n - 2` with `0` and `n - 1`, the node `2n - 1` with `n - 2` and + `2n - 3`, and the nodes `2n - 2` and `2n - 1` with each other. + + PLOTTING: + + Upon construction, the position dictionary is filled to override + the spring-layout algorithm. By convention, each staircase graph will be + displayed horizontally, with the first `n - 1` nodes displayed from left to + right on the top horizontal line, the second `n - 1` nodes displayed from + left to right on the middle horizontal line, and the last two nodes + displayed at the bottom two corners. + + INPUT: + + - ``n`` -- an integer at least 3; number of nodes is `2n` + + OUTPUT: + + - ``G`` -- a staircase graph of order `2n`; note that a + :class:`ValueError` is returned if `n < 3` + + EXAMPLES: + + Construct and show a staircase graph with 10 nodes:: + + sage: g = graphs.StaircaseGraph(5) + sage: g.show() # long time # needs sage.plot + + Create several staircase graphs in a Sage graphics array:: + + sage: # needs sage.plots + sage: g = [] + sage: j = [] + sage: for i in range(9): + ....: k = graphs.StaircaseGraph(i+3) + ....: g.append(k) + sage: for i in range(3): + ....: n = [] + ....: for m in range(3): + ....: n.append(g[3*i + m].plot(vertex_size=50 - 4*(3*i+m), vertex_labels=False)) + ....: j.append(n) + sage: G = graphics_array(j) + sage: G.show() # long time + + TESTS: + + The input parameter must be an integer that is at least 3:: + sage: G = graphs.StaircaseGraph(2) + Traceback (most recent call last): + ... + ValueError: parameter n must be at least 3 + + REFERENCES: + + - [LM2024]_ + + .. SEEALSO:: + + :meth:`~sage.graphs.graph_generators.GraphGenerators.LadderGraph` + + AUTHORS: + + - Janmenjaya Panda (2024-06-09) + """ + if n < 3: + raise ValueError("parameter n must be at least 3") + + pos_dict = { + 0: (0, 1), + n - 2: (n, 1), + 2*n - 2: (0, -1), + 2*n - 1: (n, -1) + } + + edges = [ + (0, n - 1), + (0, 2*n - 2), + (n - 2, 2*n - 3), + (n - 2, 2*n - 1), + (n - 1, 2*n - 2), + (2*n - 3, 2*n - 1), + (2*n - 2, 2*n - 1) + ] + + for v in range(1, n - 2): + pos_dict[v] = (v + 1, 1) + edges.append((v, v + n - 1)) + + for v in range(n - 1, 2*n - 2): + pos_dict[v] = (v - n + 2, 0) + + G = Graph(2 * n, pos=pos_dict, name="Staircase graph") + G.add_edges(edges) + G.add_path(list(range(n - 1))) + G.add_path(list(range(n - 1, 2*n - 2))) + return G def BiwheelGraph(n): From 2263611fb486058f0b7ff308446a50e4cc9126f5 Mon Sep 17 00:00:00 2001 From: Omegaconstant Date: Sun, 9 Jun 2024 17:57:59 +0530 Subject: [PATCH 04/11] added BiwheelGraph --- src/sage/graphs/generators/families.py | 105 ++++++++++++++++++++++++- 1 file changed, 104 insertions(+), 1 deletion(-) diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py index 7da2f03798e..a6a0cc94b61 100644 --- a/src/sage/graphs/generators/families.py +++ b/src/sage/graphs/generators/families.py @@ -4563,7 +4563,110 @@ def StaircaseGraph(n): def BiwheelGraph(n): - pass + r""" + Return a biwheel graph with `2n` nodes + + For `n \geqslant 4`, the biwheel graph of order `2n` is the planar + bipartite graph obtained from the cycle graph of order `2n - 2`, i.e., + ``graphs.CycleGraph(2*n - 2)`` (called the `rim` of the biwheel graph) by + introducing two new nodes `2n - 2` and `2n - 1` (called the `hubs` of the + biwheel graph), and then joining the node `2n - 2` with the odd indexed + nodes up to `2n - 3` and joining the node `2n - 1` with the even indexed + nodes up to `2n - 4`. + + PLOTTING: + + Upon construction, the position dictionary is filled to override + the spring-layout algorithm. By convention, each biwheel graph will be + displayed with the first (0) node at the right if `(n - 1)` is odd or + otherwise at an angle `\pi / (2n - 2)` with respect to the origin, with the + rest of the nodes up to `2n - 3` following in a counterclockwise manner. + Note that the last two nodes, i.e., the hubs `2n - 2` and `2n - 1` will + be displayed at the coordinates `(-0.33, 0)` and `(0.33, 0)` respectively. + + INPUT: + + - ``n`` -- an integer at least 4; number of nodes is `2n` + + OUTPUT: + + - ``G`` -- a biwheel graph of order `2n`; note that a + :class:`ValueError` is returned if `n < 4` + + EXAMPLES: + + Construct and show a biwheel graph with 10 nodes:: + + sage: g = graphs.BiwheelGraph(5) + sage: g.show() # long time # needs sage.plot + sage: g.is_planar() + True + sage: g.is_bipartite() + True + + Create several biwheel graphs in a Sage graphics array:: + + sage: # needs sage.plots + sage: g = [] + sage: j = [] + sage: for i in range(9): + ....: k = graphs.BiwheelGraph(i+4) + ....: g.append(k) + sage: for i in range(3): + ....: n = [] + ....: for m in range(3): + ....: n.append(g[3*i + m].plot(vertex_size=50 - 4*(3*i+m), vertex_labels=False)) + ....: j.append(n) + sage: G = graphics_array(j) + sage: G.show() # long time + + TESTS: + + The input parameter must be an integer that is at least 4:: + sage: G = graphs.BiwheelGraph(3) + Traceback (most recent call last): + ... + ValueError: parameter n must be at least 4 + + REFERENCES: + + - [LM2024]_ + + .. SEEALSO:: + + :meth:`~sage.graphs.graph_generators.GraphGenerators.WheelGraph`, + :meth:`~sage.graphs.graph_generators.GraphGenerators.TruncatedBiwheelGraph` + + AUTHORS: + + - Janmenjaya Panda (2024-06-09) + """ + if n < 4: + raise ValueError("parameter n must be at least 4") + + from math import pi + angle_param = 0 + + if (n - 1) % 2 == 0: + angle_param = pi / (2*n - 2) + + G = Graph(2 * n, name="Biwheel graph") + pos_dict = G._circle_embedding(list(range(2*n - 2)), angle=angle_param, return_dict=True) + edges = [] + + pos_dict[2*n - 2] = (-0.33, 0) + pos_dict[2*n - 1] = (0.33, 0) + + for i in range(2*n - 2): + if i%2 == 0: + edges += [(i, 2*n - 1)] + else: + edges += [(i, 2*n - 2)] + + G.set_pos(pos_dict) + G.add_cycle(list(range(2*n - 2))) + G.add_edges(edges) + return G def TruncatedBiwheelGraph(n): From 73d8391111381b2271ebbea8555e80b60eaa5cbb Mon Sep 17 00:00:00 2001 From: Omegaconstant Date: Sun, 9 Jun 2024 20:10:06 +0530 Subject: [PATCH 05/11] updated BiwheelGraph --- src/sage/graphs/generators/families.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py index a6a0cc94b61..28067635157 100644 --- a/src/sage/graphs/generators/families.py +++ b/src/sage/graphs/generators/families.py @@ -4566,7 +4566,7 @@ def BiwheelGraph(n): r""" Return a biwheel graph with `2n` nodes - For `n \geqslant 4`, the biwheel graph of order `2n` is the planar + For `n \geq 4`, the biwheel graph of order `2n` is the planar bipartite graph obtained from the cycle graph of order `2n - 2`, i.e., ``graphs.CycleGraph(2*n - 2)`` (called the `rim` of the biwheel graph) by introducing two new nodes `2n - 2` and `2n - 1` (called the `hubs` of the @@ -4578,11 +4578,11 @@ def BiwheelGraph(n): Upon construction, the position dictionary is filled to override the spring-layout algorithm. By convention, each biwheel graph will be - displayed with the first (0) node at the right if `(n - 1)` is odd or + displayed with the first (0) node at the right if `n` is even or otherwise at an angle `\pi / (2n - 2)` with respect to the origin, with the rest of the nodes up to `2n - 3` following in a counterclockwise manner. Note that the last two nodes, i.e., the hubs `2n - 2` and `2n - 1` will - be displayed at the coordinates `(-0.33, 0)` and `(0.33, 0)` respectively. + be displayed at the coordinates `(-1/3, 0)` and `(1/3, 0)` respectively. INPUT: @@ -4644,18 +4644,18 @@ def BiwheelGraph(n): if n < 4: raise ValueError("parameter n must be at least 4") - from math import pi angle_param = 0 - if (n - 1) % 2 == 0: + if n % 2: + from math import pi angle_param = pi / (2*n - 2) G = Graph(2 * n, name="Biwheel graph") pos_dict = G._circle_embedding(list(range(2*n - 2)), angle=angle_param, return_dict=True) edges = [] - pos_dict[2*n - 2] = (-0.33, 0) - pos_dict[2*n - 1] = (0.33, 0) + pos_dict[2*n - 2] = (-QQ((1, 3)), 0) + pos_dict[2*n - 1] = (QQ((1, 3)), 0) for i in range(2*n - 2): if i%2 == 0: From e579d8ce7ee214a24fee0447a18f5b4bd51c6cc2 Mon Sep 17 00:00:00 2001 From: Omegaconstant Date: Sun, 9 Jun 2024 21:15:08 +0530 Subject: [PATCH 06/11] added TruncatedBiwheelGraph --- src/sage/graphs/generators/families.py | 91 +++++++++++++++++++++++++- 1 file changed, 90 insertions(+), 1 deletion(-) diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py index 28067635157..031d16202be 100644 --- a/src/sage/graphs/generators/families.py +++ b/src/sage/graphs/generators/families.py @@ -4670,4 +4670,93 @@ def BiwheelGraph(n): def TruncatedBiwheelGraph(n): - pass \ No newline at end of file + r""" + Return a truncated biwheel graph with `2n` nodes + + For `n \geq 3`, the truncated biwheel graph of order `2n` is the graph + obtained from the path graph of order `2n - 2`, i.e., + ``graphs.PathGraph(2*n - 2)`` by introducing two new nodes `2n - 2` and + `2n - 1`, and then joining the node `2n - 2` with the odd indexed nodes + up to `2n - 3`, joining the node `2n - 1` with the even indexed nodes up to + `2n - 4` and adding the edges `(0, 2n - 2)` and `(2n - 3, 2n - 1)`. + + PLOTTING: + + Upon construction, the position dictionary is filled to override the + spring-layout algorithm. By convention, each truncated biwheel graph will + be displayed horizontally, with the first `2n - 2` nodes displayed from + left to right on the middle horizontal line and the nodes `2n - 2` and + `2n - 1` displayed at the top and the bottom central positions + respectively. + + INPUT: + + - ``n`` -- an integer at least 3; number of nodes is `2n` + + OUTPUT: + + - ``G`` -- a truncated biwheel graph of order `2n`; note that a + :class:`ValueError` is returned if `n < 3` + + EXAMPLES: + + Construct and show a truncated biwheel graph with 10 nodes:: + + sage: g = graphs.TruncatedBiwheelGraph(5) + sage: g.show() # long time # needs sage.plot + + Create several truncated biwheel graphs in a Sage graphics array:: + + sage: # needs sage.plots + sage: g = [] + sage: j = [] + sage: for i in range(9): + ....: k = graphs.TruncatedBiwheelGraph(i+3) + ....: g.append(k) + sage: for i in range(3): + ....: n = [] + ....: for m in range(3): + ....: n.append(g[3*i + m].plot(vertex_size=50 - 4*(3*i+m), vertex_labels=False)) + ....: j.append(n) + sage: G = graphics_array(j) + sage: G.show() # long time + + TESTS: + + The input parameter must be an integer that is at least 3:: + sage: G = graphs.TruncatedBiwheelGraph(2) + Traceback (most recent call last): + ... + ValueError: parameter n must be at least 3 + + REFERENCES: + + - [LM2024]_ + + .. SEEALSO:: + + :meth:`~sage.graphs.graph_generators.GraphGenerators.WheelGraph`, + :meth:`~sage.graphs.graph_generators.GraphGenerators.BiwheelGraph` + + AUTHORS: + + - Janmenjaya Panda (2024-06-09) + """ + if n < 3: + raise ValueError("parameter n must be at least 3") + + pos_dict = {2*n - 2: (0, n), 2*n - 1: (0, -n)} + edges = [(0, 2*n - 2), (2*n - 3, 2*n - 1)] + + for v in range(2*n - 2): + pos_dict[v] = (2*(v-n) + 3, 0) + if v % 2 == 0: + edges += [(v, 2*n - 1)] + else: + edges += [(v, 2*n - 2)] + + G = Graph(2 * n, pos=pos_dict, name="Truncated biwheel graph") + G.add_path(list(range(2*n - 2))) + G.add_edges(edges) + + return G \ No newline at end of file From 6bc8c46d066e21de3686f95651530aacf9e5c5d0 Mon Sep 17 00:00:00 2001 From: Omegaconstant Date: Sun, 9 Jun 2024 21:17:20 +0530 Subject: [PATCH 07/11] added import statement for QQ --- src/sage/graphs/generators/families.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py index 031d16202be..7b363a74334 100644 --- a/src/sage/graphs/generators/families.py +++ b/src/sage/graphs/generators/families.py @@ -4654,6 +4654,7 @@ def BiwheelGraph(n): pos_dict = G._circle_embedding(list(range(2*n - 2)), angle=angle_param, return_dict=True) edges = [] + from sage.rings.rational_field import QQ pos_dict[2*n - 2] = (-QQ((1, 3)), 0) pos_dict[2*n - 1] = (QQ((1, 3)), 0) From 684725172fd99fb9314c9f02defaef58137ce359 Mon Sep 17 00:00:00 2001 From: Omegaconstant Date: Sun, 9 Jun 2024 21:32:17 +0530 Subject: [PATCH 08/11] added whitespaces around the modulo operator --- src/sage/graphs/generators/families.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py index 7b363a74334..ea6feee3381 100644 --- a/src/sage/graphs/generators/families.py +++ b/src/sage/graphs/generators/families.py @@ -4659,7 +4659,7 @@ def BiwheelGraph(n): pos_dict[2*n - 1] = (QQ((1, 3)), 0) for i in range(2*n - 2): - if i%2 == 0: + if i % 2 == 0: edges += [(i, 2*n - 1)] else: edges += [(i, 2*n - 2)] From 3016ce39b6fb58617d2f67a547093ed5dc1bcd9b Mon Sep 17 00:00:00 2001 From: Omegaconstant Date: Sun, 9 Jun 2024 23:16:13 +0530 Subject: [PATCH 09/11] changed \geqslant to \geq in StaircaseGraph --- src/sage/graphs/generators/families.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py index ea6feee3381..5544242dc13 100644 --- a/src/sage/graphs/generators/families.py +++ b/src/sage/graphs/generators/families.py @@ -4461,7 +4461,7 @@ def StaircaseGraph(n): r""" Return a staircase graph with `2n` nodes - For `n \geqslant 3`, the staircase graph of order `2n` is the graph obtained + For `n \geq 3`, the staircase graph of order `2n` is the graph obtained from the ladder graph of order `2n - 2`, i.e., ``graphs.LadderGraph(n - 1)`` by introducing two new nodes `2n - 2` and `2n - 1`, and then joining the node `2n - 2` with `0` and `n - 1`, the node `2n - 1` with `n - 2` and From af34bf4812cf24ca0afd263320a1f721cb340295 Mon Sep 17 00:00:00 2001 From: janmenjayap Date: Wed, 31 Jul 2024 01:12:18 +0530 Subject: [PATCH 10/11] added the Bicorn graph --- src/sage/graphs/generators/families.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py index 1d93bfe0136..d7b15c712c6 100644 --- a/src/sage/graphs/generators/families.py +++ b/src/sage/graphs/generators/families.py @@ -4442,6 +4442,9 @@ def StaircaseGraph(n): node `2n - 2` with `0` and `n - 1`, the node `2n - 1` with `n - 2` and `2n - 3`, and the nodes `2n - 2` and `2n - 1` with each other. + Note that ``graphs.StaircaseGraph(4)`` is also known as the `Bicorn` + `graph`. It is the only brick that has a unique `b`-invariant edge. + PLOTTING: Upon construction, the position dictionary is filled to override @@ -4467,6 +4470,12 @@ def StaircaseGraph(n): sage: g = graphs.StaircaseGraph(5) sage: g.show() # long time # needs sage.plot + Construct and show the Bicorn graph:: + + sage: bicornGraph = graphs.StaircaseGraph(4) + sage: # The edge (1, 4) is the unique b-invariant edge. + sage: bicornGraph.show() # long time # needs sage.plot + Create several staircase graphs in a Sage graphics array:: sage: # needs sage.plots From 554de275a61d85a6d678d257adf93f19ad4af454 Mon Sep 17 00:00:00 2001 From: janmenjayap Date: Thu, 1 Aug 2024 12:31:20 +0530 Subject: [PATCH 11/11] updated the documentation --- src/sage/graphs/generators/families.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py index d7b15c712c6..01705f3afad 100644 --- a/src/sage/graphs/generators/families.py +++ b/src/sage/graphs/generators/families.py @@ -4442,8 +4442,8 @@ def StaircaseGraph(n): node `2n - 2` with `0` and `n - 1`, the node `2n - 1` with `n - 2` and `2n - 3`, and the nodes `2n - 2` and `2n - 1` with each other. - Note that ``graphs.StaircaseGraph(4)`` is also known as the `Bicorn` - `graph`. It is the only brick that has a unique `b`-invariant edge. + Note that ``graphs.StaircaseGraph(4)`` is also known as the ``Bicorn + graph``. It is the only brick that has a unique `b`-invariant edge. PLOTTING: @@ -4470,10 +4470,10 @@ def StaircaseGraph(n): sage: g = graphs.StaircaseGraph(5) sage: g.show() # long time # needs sage.plot - Construct and show the Bicorn graph:: + Construct and show the Bicorn graph. Note that the edge `(1, 4)` is the + unique `b`-invariant edge:: sage: bicornGraph = graphs.StaircaseGraph(4) - sage: # The edge (1, 4) is the unique b-invariant edge. sage: bicornGraph.show() # long time # needs sage.plot Create several staircase graphs in a Sage graphics array:: @@ -4495,6 +4495,7 @@ def StaircaseGraph(n): TESTS: The input parameter must be an integer that is at least 3:: + sage: G = graphs.StaircaseGraph(2) Traceback (most recent call last): ... @@ -4553,7 +4554,7 @@ def BiwheelGraph(n): For `n \geq 4`, the biwheel graph of order `2n` is the planar bipartite graph obtained from the cycle graph of order `2n - 2`, i.e., ``graphs.CycleGraph(2*n - 2)`` (called the `rim` of the biwheel graph) by - introducing two new nodes `2n - 2` and `2n - 1` (called the `hubs` of the + introducing two new nodes `2n - 2` and `2n - 1` (called the *hubs* of the biwheel graph), and then joining the node `2n - 2` with the odd indexed nodes up to `2n - 3` and joining the node `2n - 1` with the even indexed nodes up to `2n - 4`. @@ -4607,6 +4608,7 @@ def BiwheelGraph(n): TESTS: The input parameter must be an integer that is at least 4:: + sage: G = graphs.BiwheelGraph(3) Traceback (most recent call last): ... @@ -4709,6 +4711,7 @@ def TruncatedBiwheelGraph(n): TESTS: The input parameter must be an integer that is at least 3:: + sage: G = graphs.TruncatedBiwheelGraph(2) Traceback (most recent call last): ...