passagemath-graphs 10.5.47__cp313-cp313-macosx_14_0_arm64.whl → 10.6.1__cp313-cp313-macosx_14_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. {passagemath_graphs-10.5.47.dist-info → passagemath_graphs-10.6.1.dist-info}/METADATA +27 -17
  2. passagemath_graphs-10.6.1.dist-info/METADATA.bak +304 -0
  3. passagemath_graphs-10.6.1.dist-info/RECORD +263 -0
  4. sage/all__sagemath_graphs.py +3 -2
  5. sage/combinat/abstract_tree.py +188 -17
  6. sage/combinat/cluster_algebra_quiver/interact.py +1 -2
  7. sage/combinat/cluster_algebra_quiver/mutation_type.py +518 -519
  8. sage/combinat/cluster_algebra_quiver/quiver.py +233 -205
  9. sage/combinat/designs/covering_design.py +2 -6
  10. sage/combinat/designs/database.py +11 -10
  11. sage/combinat/designs/designs_pyx.cpython-313-darwin.so +0 -0
  12. sage/combinat/designs/designs_pyx.pyx +2 -2
  13. sage/combinat/designs/evenly_distributed_sets.cpython-313-darwin.so +0 -0
  14. sage/combinat/designs/evenly_distributed_sets.pyx +4 -4
  15. sage/combinat/designs/gen_quadrangles_with_spread.cpython-313-darwin.so +0 -0
  16. sage/combinat/designs/incidence_structures.py +2 -2
  17. sage/combinat/designs/latin_squares.py +53 -20
  18. sage/combinat/designs/orthogonal_arrays.py +2 -1
  19. sage/combinat/designs/orthogonal_arrays_find_recursive.cpython-313-darwin.so +0 -0
  20. sage/combinat/designs/orthogonal_arrays_find_recursive.pyx +22 -21
  21. sage/combinat/designs/resolvable_bibd.py +191 -157
  22. sage/combinat/designs/subhypergraph_search.cpython-313-darwin.so +0 -0
  23. sage/combinat/designs/subhypergraph_search.pyx +4 -4
  24. sage/combinat/designs/twographs.py +2 -2
  25. sage/combinat/finite_state_machine.py +6 -6
  26. sage/combinat/nu_tamari_lattice.py +1 -1
  27. sage/combinat/posets/bubble_shuffle.py +247 -0
  28. sage/combinat/posets/d_complete.py +3 -3
  29. sage/combinat/posets/elements.py +3 -3
  30. sage/combinat/posets/hasse_cython.cpython-313-darwin.so +0 -0
  31. sage/combinat/posets/hasse_cython.pyx +1 -1
  32. sage/combinat/posets/hasse_diagram.py +16 -22
  33. sage/combinat/posets/hochschild_lattice.py +158 -0
  34. sage/combinat/posets/incidence_algebras.py +14 -16
  35. sage/combinat/posets/lattices.py +51 -53
  36. sage/combinat/posets/linear_extension_iterator.cpython-313-darwin.so +0 -0
  37. sage/combinat/posets/linear_extensions.py +12 -13
  38. sage/combinat/posets/moebius_algebra.py +4 -4
  39. sage/combinat/posets/poset_examples.py +73 -23
  40. sage/combinat/posets/posets.py +294 -103
  41. sage/databases/knotinfo_db.py +2 -1
  42. sage/graphs/asteroidal_triples.cpython-313-darwin.so +0 -0
  43. sage/graphs/asteroidal_triples.pyx +24 -3
  44. sage/graphs/base/boost_graph.cpython-313-darwin.so +0 -0
  45. sage/graphs/base/boost_graph.pxd +3 -3
  46. sage/graphs/base/c_graph.cpython-313-darwin.so +0 -0
  47. sage/graphs/base/c_graph.pyx +1 -1
  48. sage/graphs/base/dense_graph.cpython-313-darwin.so +0 -0
  49. sage/graphs/base/dense_graph.pxd +5 -3
  50. sage/graphs/base/dense_graph.pyx +44 -0
  51. sage/graphs/base/graph_backends.cpython-313-darwin.so +0 -0
  52. sage/graphs/base/sparse_graph.cpython-313-darwin.so +0 -0
  53. sage/graphs/base/static_dense_graph.cpython-313-darwin.so +0 -0
  54. sage/graphs/base/static_sparse_backend.cpython-313-darwin.so +0 -0
  55. sage/graphs/base/static_sparse_backend.pyx +8 -5
  56. sage/graphs/base/static_sparse_graph.cpython-313-darwin.so +0 -0
  57. sage/graphs/base/static_sparse_graph.pyx +86 -15
  58. sage/graphs/bipartite_graph.py +59 -36
  59. sage/graphs/centrality.cpython-313-darwin.so +0 -0
  60. sage/graphs/centrality.pyx +82 -9
  61. sage/graphs/cographs.py +1 -1
  62. sage/graphs/comparability.cpython-313-darwin.so +0 -0
  63. sage/graphs/comparability.pyx +64 -26
  64. sage/graphs/connectivity.cpython-313-darwin.so +0 -0
  65. sage/graphs/convexity_properties.cpython-313-darwin.so +0 -0
  66. sage/graphs/convexity_properties.pyx +52 -9
  67. sage/graphs/digraph.py +439 -95
  68. sage/graphs/digraph_generators.py +176 -104
  69. sage/graphs/distances_all_pairs.cpython-313-darwin.so +0 -0
  70. sage/graphs/dot2tex_utils.py +1 -1
  71. sage/graphs/edge_connectivity.cpython-313-darwin.so +0 -0
  72. sage/graphs/generators/basic.py +1 -1
  73. sage/graphs/generators/distance_regular.cpython-313-darwin.so +0 -0
  74. sage/graphs/generators/distance_regular.pyx +2 -2
  75. sage/graphs/generators/families.py +40 -30
  76. sage/graphs/generators/random.py +2 -2
  77. sage/graphs/generators/smallgraphs.py +3 -3
  78. sage/graphs/generic_graph.py +559 -86
  79. sage/graphs/generic_graph_pyx.cpython-313-darwin.so +0 -0
  80. sage/graphs/generic_graph_pyx.pyx +58 -11
  81. sage/graphs/genus.cpython-313-darwin.so +0 -0
  82. sage/graphs/genus.pyx +3 -4
  83. sage/graphs/graph.py +291 -8
  84. sage/graphs/graph_coloring.cpython-313-darwin.so +0 -0
  85. sage/graphs/graph_coloring.pyx +2 -2
  86. sage/graphs/graph_database.py +67 -12
  87. sage/graphs/graph_decompositions/bandwidth.cpython-313-darwin.so +0 -0
  88. sage/graphs/graph_decompositions/clique_separators.cpython-313-darwin.so +0 -0
  89. sage/graphs/graph_decompositions/clique_separators.pyx +24 -3
  90. sage/graphs/graph_decompositions/cutwidth.cpython-313-darwin.so +0 -0
  91. sage/graphs/graph_decompositions/fast_digraph.cpython-313-darwin.so +0 -0
  92. sage/graphs/graph_decompositions/fast_digraph.pyx +1 -1
  93. sage/graphs/graph_decompositions/graph_products.cpython-313-darwin.so +0 -0
  94. sage/graphs/graph_decompositions/graph_products.pyx +67 -21
  95. sage/graphs/graph_decompositions/modular_decomposition.cpython-313-darwin.so +0 -0
  96. sage/graphs/graph_decompositions/slice_decomposition.cpython-313-darwin.so +0 -0
  97. sage/graphs/graph_decompositions/slice_decomposition.pyx +34 -8
  98. sage/graphs/graph_decompositions/tree_decomposition.cpython-313-darwin.so +0 -0
  99. sage/graphs/graph_decompositions/vertex_separation.cpython-313-darwin.so +0 -0
  100. sage/graphs/graph_generators.py +45 -32
  101. sage/graphs/graph_generators_pyx.cpython-313-darwin.so +0 -0
  102. sage/graphs/graph_generators_pyx.pyx +15 -15
  103. sage/graphs/graph_latex.py +1 -1
  104. sage/graphs/graph_list.py +52 -9
  105. sage/graphs/graph_plot.py +7 -0
  106. sage/graphs/hyperbolicity.cpython-313-darwin.so +0 -0
  107. sage/graphs/hyperbolicity.pyx +5 -3
  108. sage/graphs/independent_sets.cpython-313-darwin.so +0 -0
  109. sage/graphs/isoperimetric_inequalities.cpython-313-darwin.so +0 -0
  110. sage/graphs/isoperimetric_inequalities.pyx +42 -6
  111. sage/graphs/line_graph.cpython-313-darwin.so +0 -0
  112. sage/graphs/line_graph.pyx +153 -37
  113. sage/graphs/matching_covered_graph.py +87 -62
  114. sage/graphs/orientations.py +3 -18
  115. sage/graphs/path_enumeration.cpython-313-darwin.so +0 -0
  116. sage/graphs/path_enumeration.pyx +2 -2
  117. sage/graphs/spanning_tree.cpython-313-darwin.so +0 -0
  118. sage/graphs/strongly_regular_db.cpython-313-darwin.so +0 -0
  119. sage/graphs/strongly_regular_db.pyx +34 -34
  120. sage/graphs/traversals.cpython-313-darwin.so +0 -0
  121. sage/graphs/traversals.pyx +13 -12
  122. sage/graphs/trees.cpython-313-darwin.so +0 -0
  123. sage/graphs/tutte_polynomial.py +1 -1
  124. sage/graphs/views.cpython-313-darwin.so +0 -0
  125. sage/graphs/views.pyx +1 -1
  126. sage/graphs/weakly_chordal.cpython-313-darwin.so +0 -0
  127. sage/graphs/weakly_chordal.pyx +50 -8
  128. sage/groups/perm_gps/partn_ref/refinement_graphs.cpython-313-darwin.so +0 -0
  129. sage/knots/free_knotinfo_monoid.py +3 -3
  130. sage/knots/knotinfo.py +102 -82
  131. sage/knots/link.py +72 -39
  132. sage/topology/cubical_complex.py +4 -5
  133. sage/topology/delta_complex.py +4 -4
  134. sage/topology/simplicial_complex.py +0 -1
  135. sage/topology/simplicial_complex_catalog.py +6 -0
  136. sage/topology/simplicial_complex_examples.py +4 -16
  137. sage_wheels/share/graphs/brouwer_srg_database.json +1 -0
  138. sage_wheels/share/graphs/graphs.db +0 -0
  139. sage_wheels/share/graphs/isgci_sage.xml +11116 -0
  140. sage_wheels/share/graphs/smallgraphs.txt +565 -0
  141. passagemath_graphs-10.5.47.dist-info/RECORD +0 -256
  142. {passagemath_graphs-10.5.47.dist-info → passagemath_graphs-10.6.1.dist-info}/WHEEL +0 -0
  143. {passagemath_graphs-10.5.47.dist-info → passagemath_graphs-10.6.1.dist-info}/top_level.txt +0 -0
@@ -63,7 +63,6 @@ Methods
63
63
 
64
64
  from collections import deque
65
65
 
66
- from libc.string cimport memset
67
66
  from libc.stdint cimport uint32_t
68
67
  from libcpp.vector cimport vector
69
68
  from cysignals.signals cimport sig_on, sig_off
@@ -75,7 +74,6 @@ from sage.graphs.base.static_sparse_backend cimport StaticSparseCGraph
75
74
  from sage.graphs.base.static_sparse_backend cimport StaticSparseBackend
76
75
  from sage.graphs.base.static_sparse_graph cimport init_short_digraph
77
76
  from sage.graphs.base.static_sparse_graph cimport free_short_digraph
78
- from sage.graphs.base.static_sparse_graph cimport out_degree
79
77
  from sage.graphs.graph_decompositions.slice_decomposition cimport \
80
78
  extended_lex_BFS
81
79
 
@@ -465,6 +463,14 @@ def lex_BFS(G, reverse=False, tree=False, initial_vertex=None, algorithm="fast")
465
463
  Traceback (most recent call last):
466
464
  ...
467
465
  ValueError: 'foo' is not a graph vertex
466
+
467
+ Check that :issue:`39934` is fixed::
468
+
469
+ sage: G = Graph(1, immutable=True)
470
+ sage: G.lex_BFS(algorithm='slow')
471
+ [0]
472
+ sage: G.lex_BFS(algorithm='fast')
473
+ [0]
468
474
  """
469
475
  if initial_vertex is not None and initial_vertex not in G:
470
476
  raise ValueError(f"'{initial_vertex}' is not a graph vertex")
@@ -475,22 +481,15 @@ def lex_BFS(G, reverse=False, tree=False, initial_vertex=None, algorithm="fast")
475
481
  if algorithm != "fast":
476
482
  raise ValueError(f"unknown algorithm '{algorithm}'")
477
483
 
478
- cdef size_t n = G.order()
479
-
480
484
  # For algorithm "fast" we need to convert G to an undirected graph
481
485
  if G.is_directed():
482
486
  G = G.to_undirected()
483
487
 
484
- # Initialize variables needed by the fast and slow algorithms
488
+ # Initialize variables needed by the fast algorithm
485
489
  cdef CGraphBackend Gbackend = <CGraphBackend> G._backend
486
490
  cdef CGraph cg = Gbackend.cg()
487
- cdef list sigma = []
488
- cdef dict predecessor = {}
489
- # Initialize variables needed by the fast algorithm
490
491
  cdef vector[int] sigma_int
491
492
  cdef vector[int] pred
492
- # Initialize variables needed by the slow algorithm
493
- cdef dict lexicographic_label
494
493
  # Temporary variables
495
494
  cdef int vi, i, initial_v_int
496
495
 
@@ -500,9 +499,11 @@ def lex_BFS(G, reverse=False, tree=False, initial_vertex=None, algorithm="fast")
500
499
  initial_v_int = Gbackend.get_vertex(initial_vertex)
501
500
  else:
502
501
  initial_v_int = -1
502
+ sig_on()
503
503
  extended_lex_BFS(cg, sigma_int, NULL, initial_v_int, &pred, NULL, NULL)
504
- sigma = [ Gbackend.vertex_label(vi) for vi in sigma_int ]
505
- predecessor = { u: sigma[i] for u, i in zip(sigma, pred) if i != -1 }
504
+ sig_off()
505
+ cdef list sigma = [Gbackend.vertex_label(vi) for vi in sigma_int]
506
+ cdef dict predecessor = {u: sigma[i] for u, i in zip(sigma, pred) if i != -1}
506
507
 
507
508
  if reverse:
508
509
  sigma.reverse()
Binary file
@@ -663,7 +663,7 @@ def _tutte_polynomial_internal(G, x, y, edge_selector, cache=None):
663
663
  ##################################
664
664
 
665
665
  # Theorem 4: from Haggard, Pearce, and Royle Note that the formula
666
- # at http://homepages.ecs.vuw.ac.nz/~djp/files/TOMS10.pdf is
666
+ # at https://web.archive.org/web/20110401195911/http://homepages.ecs.vuw.ac.nz/~djp/files/TOMS10.pdf is
667
667
  # slightly incorrect. The initial sum should only go to n-2
668
668
  # instead of n (allowing for the last part of the recursion).
669
669
  # Additionally, the first operand of the final product should be
Binary file
sage/graphs/views.pyx CHANGED
@@ -786,7 +786,7 @@ cdef class EdgesView:
786
786
  sage: E * 1.5
787
787
  Traceback (most recent call last):
788
788
  ...
789
- TypeError: can...t multiply sequence by non-int of type 'sage.rings.real_mpfr.RealLiteral'
789
+ TypeError: can...t multiply sequence by non-int of type 'sage.rings.real...'
790
790
  """
791
791
  if isinstance(left, EdgesView):
792
792
  return list(left) * right
@@ -38,6 +38,8 @@ Methods
38
38
 
39
39
  from memory_allocator cimport MemoryAllocator
40
40
  from sage.data_structures.bitset_base cimport *
41
+ from sage.graphs.base.static_sparse_backend cimport StaticSparseCGraph
42
+ from sage.graphs.base.static_sparse_backend cimport StaticSparseBackend
41
43
  from sage.graphs.base.static_sparse_graph cimport short_digraph
42
44
  from sage.graphs.base.static_sparse_graph cimport init_short_digraph
43
45
  from sage.graphs.base.static_sparse_graph cimport free_short_digraph
@@ -200,6 +202,17 @@ def is_long_hole_free(g, certificate=False):
200
202
 
201
203
  sage: graphs.EmptyGraph().is_long_hole_free()
202
204
  True
205
+
206
+ Immutable graphs::
207
+
208
+ sage: G = graphs.RandomGNP(10, .7)
209
+ sage: G._backend
210
+ <sage.graphs.base.sparse_graph.SparseGraphBackend ...>
211
+ sage: H = Graph(G, immutable=True)
212
+ sage: H._backend
213
+ <sage.graphs.base.static_sparse_backend.StaticSparseBackend ...>
214
+ sage: G.is_long_hole_free() == H.is_long_hole_free()
215
+ True
203
216
  """
204
217
  g._scream_if_not_simple()
205
218
 
@@ -212,9 +225,16 @@ def is_long_hole_free(g, certificate=False):
212
225
  # documented in the module sage.graphs.base.static_sparse_graph.
213
226
  # Vertices are relabeled in 0..n-1
214
227
  cdef int n = g.order()
215
- cdef list id_label = list(g)
228
+ cdef list id_label
229
+ cdef StaticSparseCGraph cg
216
230
  cdef short_digraph sd
217
- init_short_digraph(sd, g, edge_labelled=False, vertex_list=id_label)
231
+ if isinstance(g, StaticSparseBackend):
232
+ cg = <StaticSparseCGraph> g._cg
233
+ sd = <short_digraph> cg.g
234
+ id_label = cg._vertex_to_labels
235
+ else:
236
+ id_label = list(g)
237
+ init_short_digraph(sd, g, edge_labelled=False, vertex_list=id_label)
218
238
 
219
239
  # Make a dense copy of the graph for quick adjacency tests
220
240
  cdef bitset_t dense_graph
@@ -258,7 +278,8 @@ def is_long_hole_free(g, certificate=False):
258
278
 
259
279
  if not res:
260
280
  # We release memory before returning the result
261
- free_short_digraph(sd)
281
+ if not isinstance(g, StaticSparseBackend):
282
+ free_short_digraph(sd)
262
283
  bitset_free(dense_graph)
263
284
 
264
285
  if certificate:
@@ -269,7 +290,8 @@ def is_long_hole_free(g, certificate=False):
269
290
  InPath[u] = -1
270
291
 
271
292
  # Release memory
272
- free_short_digraph(sd)
293
+ if not isinstance(g, StaticSparseBackend):
294
+ free_short_digraph(sd)
273
295
  bitset_free(dense_graph)
274
296
 
275
297
  if certificate:
@@ -428,6 +450,17 @@ def is_long_antihole_free(g, certificate=False):
428
450
 
429
451
  sage: graphs.EmptyGraph().is_long_hole_free()
430
452
  True
453
+
454
+ Immutable graphs::
455
+
456
+ sage: G = graphs.RandomGNP(10, .7)
457
+ sage: G._backend
458
+ <sage.graphs.base.sparse_graph.SparseGraphBackend ...>
459
+ sage: H = Graph(G, immutable=True)
460
+ sage: H._backend
461
+ <sage.graphs.base.static_sparse_backend.StaticSparseBackend ...>
462
+ sage: G.is_long_antihole_free() == H.is_long_antihole_free()
463
+ True
431
464
  """
432
465
  g._scream_if_not_simple()
433
466
 
@@ -440,9 +473,16 @@ def is_long_antihole_free(g, certificate=False):
440
473
  # documented in the module sage.graphs.base.static_sparse_graph.
441
474
  # Vertices are relabeled in 0..n-1
442
475
  cdef int n = g.order()
443
- cdef list id_label = list(g)
476
+ cdef list id_label
477
+ cdef StaticSparseCGraph cg
444
478
  cdef short_digraph sd
445
- init_short_digraph(sd, g, edge_labelled=False, vertex_list=id_label)
479
+ if isinstance(g, StaticSparseBackend):
480
+ cg = <StaticSparseCGraph> g._cg
481
+ sd = <short_digraph> cg.g
482
+ id_label = cg._vertex_to_labels
483
+ else:
484
+ id_label = list(g)
485
+ init_short_digraph(sd, g, edge_labelled=False, vertex_list=id_label)
446
486
 
447
487
  # Make a dense copy of the graph for quick adjacency tests
448
488
  cdef bitset_t dense_graph
@@ -487,7 +527,8 @@ def is_long_antihole_free(g, certificate=False):
487
527
 
488
528
  if not res:
489
529
  # We release memory before returning the result
490
- free_short_digraph(sd)
530
+ if not isinstance(g, StaticSparseBackend):
531
+ free_short_digraph(sd)
491
532
  bitset_free(dense_graph)
492
533
 
493
534
  if certificate:
@@ -498,7 +539,8 @@ def is_long_antihole_free(g, certificate=False):
498
539
  InPath[u] = -1
499
540
 
500
541
  # Release memory
501
- free_short_digraph(sd)
542
+ if not isinstance(g, StaticSparseBackend):
543
+ free_short_digraph(sd)
502
544
  bitset_free(dense_graph)
503
545
 
504
546
  if certificate:
@@ -16,15 +16,15 @@ AUTHORS:
16
16
  - Sebastian Oehms June 2024: initial version
17
17
  """
18
18
 
19
- ##############################################################################
19
+ # ############################################################################
20
20
  # Copyright (C) 2024 Sebastian Oehms <seb.oehms@gmail.com>
21
21
  #
22
22
  # This program is free software: you can redistribute it and/or modify
23
23
  # it under the terms of the GNU General Public License as published by
24
24
  # the Free Software Foundation, either version 2 of the License, or
25
25
  # (at your option) any later version.
26
- # http://www.gnu.org/licenses/
27
- ##############################################################################
26
+ # https://www.gnu.org/licenses/
27
+ # ############################################################################
28
28
 
29
29
  from sage.knots.knotinfo import SymmetryMutant
30
30
  from sage.monoids.indexed_free_monoid import (IndexedFreeAbelianMonoid,