Skip to content

Commit 1f0a3ad

Browse files
author
Release Manager
committed
gh-38168: some care about the documentation of graph generators We fix various links, use of math mode, etc. ### 📝 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. - [ ] 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, --> <!-- - #12345: short description why this is a dependency --> <!-- - #34567: ... --> URL: #38168 Reported by: David Coudert Reviewer(s): David Coudert, Kwankyu Lee
2 parents cee5890 + 78708e4 commit 1f0a3ad

File tree

6 files changed

+163
-141
lines changed

6 files changed

+163
-141
lines changed

src/doc/en/reference/references/index.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,12 @@ REFERENCES:
154154
equilibria for two-person
155155
games*. http://www.maths.lse.ac.uk/personal/stengel/TEXTE/nashsurvey.pdf (2002)
156156
157+
.. [AHK1994] Sheldon B. Akers, Doy Horel and Balakrishnan Krishnamurthy,
158+
*The star graph: An attractive alternative to the previous n-cube*.
159+
In Interconnection Networks for High-Performance Parallel
160+
Computers, pp. 145-152, 1994. IEEE.
161+
:doi:`10.5555/201173.201191`
162+
157163
.. [AHK2015] Karim Adiprasito, June Huh, and Eric Katz. *Hodge theory
158164
for combinatorial geometries*. :arxiv:`1511.02888`.
159165
@@ -1451,6 +1457,11 @@ REFERENCES:
14511457
rationalité d'une série génératrice associée
14521458
aux arbres*, RAIRO, Inf. Théor. 16, 113--128 (1982)
14531459
1460+
.. [CC1995] Wei-Kuo Chiang, Rong-Jaye Chen: *The (n, k)-star graph: A
1461+
generalized star graph*. Information Processing Letters
1462+
56(5): 259-264, 1995.
1463+
:doi:`10.1016/0020-0190(95)00162-1`
1464+
14541465
.. [CC2013] Mahir Bilen Can and Yonah Cherniavsky.
14551466
*Omitting parentheses from the cyclic notation*. (2013).
14561467
:arxiv:`1308.0936v2`.
@@ -2686,6 +2697,10 @@ REFERENCES:
26862697
*Quantization of Lie Groups and Lie Algebras*.
26872698
Leningrad Math. J. vol. **1** (1990), no. 1.
26882699
2700+
.. [Fru1977] Roberto Frucht. *A Canonical Representation of Trivalent
2701+
Hamiltonian Graphs*. Journal of Graph Theory, 1:45-60, 1977.
2702+
:doi:`10.1002/jgt.3190010111`
2703+
26892704
.. [FS1978] Dominique Foata, Marcel-Paul Schuetzenberger.
26902705
*Major Index and Inversion Number of Permutations*.
26912706
Mathematische Nachrichten, volume 83, Issue 1, pages 143-159, 1978.
@@ -3042,6 +3057,11 @@ REFERENCES:
30423057
4-polytopes with 8 vertices", J. Comb. Th. 2,
30433058
437-465 (1967)
30443059
3060+
.. [Gru2003] Branko Grünbaum. *Convex Polytopes* (2nd ed),.
3061+
volume 221 of Graduate Texts in Mathematics, Springer, 2003.
3062+
(1st ed, 1967, Wiley New York).
3063+
:doi:`10.1007/978-1-4613-0019-9`
3064+
30453065
.. [GS1984] \A. M. Garsia, Dennis Stanton.
30463066
*Group actions on Stanley-Reisner rings and invariants of
30473067
permutation groups*. Adv. in Math. **51** (1984), 107-201.
@@ -4225,6 +4245,14 @@ REFERENCES:
42254245
Simons Symposia, Springer, 2021.
42264246
:arxiv:`2002.05234`
42274247
4248+
.. [Led1965] Joshua Lederberg. *DENDRAL-64: A System for Computer
4249+
Construction, Enumeration and Notation of Organic
4250+
Molecules as Tree Structures and Cyclic
4251+
Graphs. Part II. Topology of Cyclic Graphs*. Interim
4252+
Report to the National Aeronautics and Space
4253+
Administration. Grant NsG 81-60. December 15, 1965.
4254+
https://ntrs.nasa.gov/api/citations/19660004785/downloads/19660004785.pdf
4255+
42284256
.. [Lee2016] Kwankyu Lee, *Decoding of differential AG codes*, Advances in
42294257
Mathematics of Communications, vol. 10, no. 2 (2016), pp. 307-–319.
42304258
@@ -6594,6 +6622,9 @@ REFERENCES:
65946622
*Coboundary categories and local rules*,
65956623
The Electronic Journal of Combinatorics, *25* (2018)
65966624
6625+
.. [West2001] Douglas B. West. *Introduction to Graph Theory*. 2nd
6626+
Edition, Prentice Hall, 2001, p. 150–151.
6627+
65976628
.. [WFYTP2008] \D. Watanable, S. Furuya, H. Yoshida, K. Takaragi, and B. Preneel,
65986629
*A new keystream generator MUGI*; in
65996630
FSE, (2002), pp. 179-194.

src/sage/graphs/generators/basic.py

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def ButterflyGraph():
101101
102102
.. SEEALSO::
103103
104-
- :meth:`GraphGenerators.FriendshipGraph`
104+
- :meth:`~sage.graphs.graph_generators.GraphGenerators.FriendshipGraph`
105105
106106
EXAMPLES:
107107
@@ -161,7 +161,7 @@ def CircularLadderGraph(n):
161161
displayed as an inner and outer cycle pair, with the first `n` nodes drawn
162162
on the inner circle. The first (0) node is drawn at the top of the
163163
inner-circle, moving clockwise after that. The outer circle is drawn with
164-
the `(n+1)`th node at the top, then counterclockwise as well.
164+
the `(n+1)`-th node at the top, then counterclockwise as well.
165165
When `n == 2`, we rotate the outer circle by an angle of `\pi/8` to ensure
166166
that all edges are visible (otherwise the 4 vertices of the graph would be
167167
placed on a single line).
@@ -401,15 +401,28 @@ def CompleteGraph(n):
401401
G.add_edges((i, j) for i in range(n) for j in range(i + 1, n))
402402
return G
403403

404+
404405
def CorrelationGraph(seqs, alpha, include_anticorrelation):
405-
"""
406-
Constructs and returns a correlation graph with a node corresponding to each sequence in `seqs`.
406+
r"""
407+
Return a correlation graph with a node per sequence in ``seqs``.
407408
408-
Edges are added between nodes where the corresponding sequences have a correlation coeffecient greater than alpha.
409+
Edges are added between nodes where the corresponding sequences have a
410+
correlation coeffecient greater than alpha.
409411
410-
If include_anticorrelation is true, then edges are also added between nodes with correlation coeffecient less than -alpha.
412+
If ``include_anticorrelation`` is ``True``, then edges are also added
413+
between nodes with correlation coefficient less than ``-alpha``.
411414
412-
EXAMPLES:
415+
INPUT:
416+
417+
- ``seqs`` -- list of sequences, taht is a list of lists
418+
419+
- ``alpha`` -- float; threshold on the correlation coefficient between two
420+
sequences for adding an edge
421+
422+
- ``include_anticorrelation`` -- boolean; whether to add edges between nodes
423+
with correlation coefficient less than ``-alpha`` or not
424+
425+
EXAMPLES::
413426
414427
sage: # needs numpy
415428
sage: from sage.graphs.generators.basic import CorrelationGraph
@@ -423,7 +436,6 @@ def CorrelationGraph(seqs, alpha, include_anticorrelation):
423436
[(0, 0, None), (0, 1, None), (1, 1, None), (2, 2, None)]
424437
sage: CG3.edges(sort=False)
425438
[(0, 0, None), (0, 1, None), (0, 2, None), (1, 1, None), (1, 2, None), (2, 2, None)]
426-
427439
"""
428440
from numpy import corrcoef
429441
from sage.matrix.constructor import Matrix
@@ -442,6 +454,7 @@ def CorrelationGraph(seqs, alpha, include_anticorrelation):
442454
# call graph constructor
443455
return Graph(adjacency_matrix, format="adjacency_matrix", name="Correlation Graph")
444456

457+
445458
def CompleteBipartiteGraph(p, q, set_position=True):
446459
r"""
447460
Return a Complete Bipartite Graph on `p + q` vertices.
@@ -858,7 +871,6 @@ def Toroidal6RegularGrid2dGraph(p, q):
858871
...
859872
ValueError: parameters p and q must be integers larger than 3
860873
"""
861-
862874
if p <= 3 or q <= 3:
863875
raise ValueError("parameters p and q must be integers larger than 3")
864876

src/sage/graphs/generators/distance_regular.pyx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -591,8 +591,9 @@ def UstimenkoGraph(const int m, const int q):
591591
Return the Ustimenko graph with parameters `(m, q)`.
592592
593593
This is the distance 1 or 2 graph of the dual polar graph `C_{m-1}(q)`.
594-
The graph is distance-regular with classical with parameters
595-
`(d,q^2, qbinom(3,1,q) -1, qbinom(m+1,1,q) -1)`
594+
The graph is distance-regular with parameters
595+
`(d,q^2, \binom{3}{1}_q -1, \binom{m+1}{1}_q -1)`,
596+
where `\binom{n}{k}_q` is the `q`-binomial coefficient.
596597
597598
INPUT:
598599
@@ -833,7 +834,7 @@ def HermitianFormsGraph(const int n, const int r):
833834
r"""
834835
Return the Hermitian forms graph with the given parameters.
835836
836-
We build a graph whose vertices are all ``n``x``n`` Hermitian matrices
837+
We build a graph whose vertices are all `n \times n` Hermitian matrices
837838
over ``GF(r^2)``. Two vertices are adjacent if the difference of the two
838839
vertices has rank 1.
839840

0 commit comments

Comments
 (0)