forked from sagemath/sage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sagemathgh-38321: Implemented generators for some small graphs/ digraphs
<!-- ^ Please provide a concise and informative title. --> This PR adds generators for the Bicorn graph, the Tricorn graph, the Murty graph, the KohTindell digraph, the Cubeplex Graph and the Twinplex graph. <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> This PR introduces new static methods, specifically `BicornGraph`, `TricornGraph`, `MurtyGraph`, `KohTindellDiGraph`, `CubeplexGraph` and `TwinplexGraph`. <!-- v Why is this change required? What problem does it solve? --> There is no current implementation of the generators for the above mentioned graphs/ digraphs. <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes sagemath#12345". --> Fixes sagemath#38320. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> Nothing as of now (up to my knowledge). <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> cc: @dcoudert. URL: sagemath#38321 Reported by: Janmenjaya Panda Reviewer(s): David Coudert, Janmenjaya Panda
- Loading branch information
Showing
4 changed files
with
607 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,6 +49,7 @@ | |
- Emily A. Kirkman (2006) | ||
- Michael C. Yurko (2009) | ||
- David Coudert (2012) | ||
- Janmenjaya Panda (2024) | ||
Functions and methods | ||
--------------------- | ||
|
@@ -58,6 +59,7 @@ | |
# and Emily A. Kirkman | ||
# Copyright (C) 2009 Michael C. Yurko <[email protected]> | ||
# Copyright (C) 2012 David Coudert <[email protected]> | ||
# Copyright (C) 2024 Janmenjaya Panda <[email protected]> | ||
# | ||
# 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 | ||
|
@@ -891,6 +893,9 @@ def Circulant(self, n, integers): | |
r""" | ||
Return a circulant digraph on `n` vertices from a set of integers. | ||
A circulant digraph of order `n` has an arc from vertex `i` to | ||
vertex `i+j \pmod{n}`, for each `j` in ``integers``. | ||
INPUT: | ||
- ``n`` -- integer; number of vertices | ||
|
@@ -899,18 +904,30 @@ def Circulant(self, n, integers): | |
that there is an edge from `i` to `j` if and only if `(j-i) \pmod{n}` | ||
is an integer | ||
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 | ||
The Koh-Tindell digraph [LM2024]_ is the circulant digraph of order 7 | ||
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:: | ||
sage: kohTindellDigraph = digraphs.Circulant(7, [1, 5]) | ||
sage: kohTindellDigraph.show() # long time # needs sage.plot | ||
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 | ||
|
Oops, something went wrong.