passagemath-graphs 10.5.43__cp312-cp312-macosx_14_0_arm64.whl → 10.6.1rc2__cp312-cp312-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.
- {passagemath_graphs-10.5.43.dist-info → passagemath_graphs-10.6.1rc2.dist-info}/METADATA +5 -6
- {passagemath_graphs-10.5.43.dist-info → passagemath_graphs-10.6.1rc2.dist-info}/RECORD +132 -130
- sage/combinat/abstract_tree.py +188 -17
- sage/combinat/cluster_algebra_quiver/interact.py +1 -2
- sage/combinat/cluster_algebra_quiver/mutation_type.py +518 -519
- sage/combinat/cluster_algebra_quiver/quiver.py +233 -205
- sage/combinat/designs/covering_design.py +2 -6
- sage/combinat/designs/database.py +11 -10
- sage/combinat/designs/designs_pyx.cpython-312-darwin.so +0 -0
- sage/combinat/designs/designs_pyx.pyx +2 -2
- sage/combinat/designs/evenly_distributed_sets.cpython-312-darwin.so +0 -0
- sage/combinat/designs/evenly_distributed_sets.pyx +4 -4
- sage/combinat/designs/gen_quadrangles_with_spread.cpython-312-darwin.so +0 -0
- sage/combinat/designs/latin_squares.py +53 -20
- sage/combinat/designs/orthogonal_arrays.py +2 -1
- sage/combinat/designs/orthogonal_arrays_find_recursive.cpython-312-darwin.so +0 -0
- sage/combinat/designs/orthogonal_arrays_find_recursive.pyx +22 -21
- sage/combinat/designs/resolvable_bibd.py +191 -157
- sage/combinat/designs/subhypergraph_search.cpython-312-darwin.so +0 -0
- sage/combinat/designs/subhypergraph_search.pyx +4 -4
- sage/combinat/designs/twographs.py +2 -2
- sage/combinat/finite_state_machine.py +6 -6
- sage/combinat/posets/bubble_shuffle.py +247 -0
- sage/combinat/posets/d_complete.py +3 -3
- sage/combinat/posets/elements.py +3 -3
- sage/combinat/posets/hasse_cython.cpython-312-darwin.so +0 -0
- sage/combinat/posets/hasse_cython.pyx +1 -1
- sage/combinat/posets/hasse_diagram.py +16 -22
- sage/combinat/posets/hochschild_lattice.py +158 -0
- sage/combinat/posets/incidence_algebras.py +14 -16
- sage/combinat/posets/lattices.py +51 -53
- sage/combinat/posets/linear_extension_iterator.cpython-312-darwin.so +0 -0
- sage/combinat/posets/linear_extensions.py +10 -12
- sage/combinat/posets/moebius_algebra.py +4 -4
- sage/combinat/posets/poset_examples.py +70 -23
- sage/combinat/posets/posets.py +294 -103
- sage/databases/knotinfo_db.py +2 -1
- sage/graphs/asteroidal_triples.cpython-312-darwin.so +0 -0
- sage/graphs/asteroidal_triples.pyx +24 -3
- sage/graphs/base/boost_graph.cpython-312-darwin.so +0 -0
- sage/graphs/base/boost_graph.pxd +3 -3
- sage/graphs/base/c_graph.cpython-312-darwin.so +0 -0
- sage/graphs/base/c_graph.pyx +1 -1
- sage/graphs/base/dense_graph.cpython-312-darwin.so +0 -0
- sage/graphs/base/dense_graph.pxd +5 -3
- sage/graphs/base/dense_graph.pyx +44 -0
- sage/graphs/base/graph_backends.cpython-312-darwin.so +0 -0
- sage/graphs/base/sparse_graph.cpython-312-darwin.so +0 -0
- sage/graphs/base/static_dense_graph.cpython-312-darwin.so +0 -0
- sage/graphs/base/static_sparse_backend.cpython-312-darwin.so +0 -0
- sage/graphs/base/static_sparse_backend.pyx +8 -5
- sage/graphs/base/static_sparse_graph.cpython-312-darwin.so +0 -0
- sage/graphs/base/static_sparse_graph.pyx +86 -15
- sage/graphs/bipartite_graph.py +59 -36
- sage/graphs/centrality.cpython-312-darwin.so +0 -0
- sage/graphs/centrality.pyx +82 -9
- sage/graphs/cographs.py +1 -1
- sage/graphs/comparability.cpython-312-darwin.so +0 -0
- sage/graphs/comparability.pyx +64 -26
- sage/graphs/connectivity.cpython-312-darwin.so +0 -0
- sage/graphs/convexity_properties.cpython-312-darwin.so +0 -0
- sage/graphs/convexity_properties.pyx +52 -9
- sage/graphs/digraph.py +439 -95
- sage/graphs/digraph_generators.py +174 -102
- sage/graphs/distances_all_pairs.cpython-312-darwin.so +0 -0
- sage/graphs/dot2tex_utils.py +1 -1
- sage/graphs/edge_connectivity.cpython-312-darwin.so +0 -0
- sage/graphs/generators/basic.py +1 -1
- sage/graphs/generators/distance_regular.cpython-312-darwin.so +0 -0
- sage/graphs/generators/distance_regular.pyx +1 -1
- sage/graphs/generators/families.py +37 -27
- sage/graphs/generators/random.py +2 -2
- sage/graphs/generators/smallgraphs.py +3 -3
- sage/graphs/generic_graph.py +558 -86
- sage/graphs/generic_graph_pyx.cpython-312-darwin.so +0 -0
- sage/graphs/generic_graph_pyx.pyx +58 -11
- sage/graphs/genus.cpython-312-darwin.so +0 -0
- sage/graphs/genus.pyx +3 -4
- sage/graphs/graph.py +291 -8
- sage/graphs/graph_coloring.cpython-312-darwin.so +0 -0
- sage/graphs/graph_database.py +67 -12
- sage/graphs/graph_decompositions/bandwidth.cpython-312-darwin.so +0 -0
- sage/graphs/graph_decompositions/clique_separators.cpython-312-darwin.so +0 -0
- sage/graphs/graph_decompositions/clique_separators.pyx +24 -3
- sage/graphs/graph_decompositions/cutwidth.cpython-312-darwin.so +0 -0
- sage/graphs/graph_decompositions/fast_digraph.cpython-312-darwin.so +0 -0
- sage/graphs/graph_decompositions/fast_digraph.pyx +1 -1
- sage/graphs/graph_decompositions/graph_products.cpython-312-darwin.so +0 -0
- sage/graphs/graph_decompositions/graph_products.pyx +67 -21
- sage/graphs/graph_decompositions/modular_decomposition.cpython-312-darwin.so +0 -0
- sage/graphs/graph_decompositions/slice_decomposition.cpython-312-darwin.so +0 -0
- sage/graphs/graph_decompositions/slice_decomposition.pyx +34 -8
- sage/graphs/graph_decompositions/tree_decomposition.cpython-312-darwin.so +0 -0
- sage/graphs/graph_decompositions/vertex_separation.cpython-312-darwin.so +0 -0
- sage/graphs/graph_generators.py +45 -32
- sage/graphs/graph_generators_pyx.cpython-312-darwin.so +0 -0
- sage/graphs/graph_generators_pyx.pyx +15 -15
- sage/graphs/graph_latex.py +1 -1
- sage/graphs/graph_list.py +52 -9
- sage/graphs/graph_plot.py +7 -0
- sage/graphs/hyperbolicity.cpython-312-darwin.so +0 -0
- sage/graphs/hyperbolicity.pyx +2 -0
- sage/graphs/independent_sets.cpython-312-darwin.so +0 -0
- sage/graphs/isoperimetric_inequalities.cpython-312-darwin.so +0 -0
- sage/graphs/isoperimetric_inequalities.pyx +42 -6
- sage/graphs/line_graph.cpython-312-darwin.so +0 -0
- sage/graphs/line_graph.pyx +153 -37
- sage/graphs/matching_covered_graph.py +84 -60
- sage/graphs/orientations.py +3 -18
- sage/graphs/path_enumeration.cpython-312-darwin.so +0 -0
- sage/graphs/path_enumeration.pyx +2 -2
- sage/graphs/spanning_tree.cpython-312-darwin.so +0 -0
- sage/graphs/strongly_regular_db.cpython-312-darwin.so +0 -0
- sage/graphs/strongly_regular_db.pyx +15 -15
- sage/graphs/traversals.cpython-312-darwin.so +0 -0
- sage/graphs/traversals.pyx +13 -12
- sage/graphs/trees.cpython-312-darwin.so +0 -0
- sage/graphs/tutte_polynomial.py +1 -1
- sage/graphs/views.cpython-312-darwin.so +0 -0
- sage/graphs/weakly_chordal.cpython-312-darwin.so +0 -0
- sage/graphs/weakly_chordal.pyx +50 -8
- sage/groups/perm_gps/partn_ref/refinement_graphs.cpython-312-darwin.so +0 -0
- sage/knots/free_knotinfo_monoid.py +3 -3
- sage/knots/knotinfo.py +102 -82
- sage/knots/link.py +72 -39
- sage/topology/cubical_complex.py +4 -5
- sage/topology/delta_complex.py +4 -4
- sage/topology/simplicial_complex.py +0 -1
- sage/topology/simplicial_complex_catalog.py +6 -0
- sage/topology/simplicial_complex_examples.py +4 -16
- {passagemath_graphs-10.5.43.dist-info → passagemath_graphs-10.6.1rc2.dist-info}/WHEEL +0 -0
- {passagemath_graphs-10.5.43.dist-info → passagemath_graphs-10.6.1rc2.dist-info}/top_level.txt +0 -0
@@ -58,7 +58,7 @@ def JohnsonGraph(n, k):
|
|
58
58
|
True
|
59
59
|
"""
|
60
60
|
|
61
|
-
g = Graph(name="Johnson graph with parameters
|
61
|
+
g = Graph(name=f"Johnson graph with parameters {n},{k}")
|
62
62
|
from sage.combinat.subset import Set, Subsets
|
63
63
|
|
64
64
|
S = Set(range(n))
|
@@ -114,7 +114,7 @@ def KneserGraph(n, k):
|
|
114
114
|
if k <= 0 or k > n:
|
115
115
|
raise ValueError("Parameter k should be a strictly positive integer inferior to n")
|
116
116
|
|
117
|
-
g = Graph(name="Kneser graph with parameters {},{}"
|
117
|
+
g = Graph(name=f"Kneser graph with parameters {n},{k}")
|
118
118
|
|
119
119
|
from sage.combinat.subset import Subsets
|
120
120
|
S = Subsets(n, k)
|
@@ -390,7 +390,7 @@ def EgawaGraph(p, s):
|
|
390
390
|
"""
|
391
391
|
from sage.graphs.generators.basic import CompleteGraph
|
392
392
|
from itertools import product, chain, repeat
|
393
|
-
g = Graph(name="Egawa Graph with parameters
|
393
|
+
g = Graph(name=f"Egawa Graph with parameters {p},{s}", multiedges=False)
|
394
394
|
X = CompleteGraph(4)
|
395
395
|
Y = Graph('O?Wse@UgqqT_LUebWkbT_')
|
396
396
|
g.add_vertices(product(*chain(repeat(Y, p), repeat(X, s))))
|
@@ -478,7 +478,7 @@ def HammingGraph(n, q, X=None):
|
|
478
478
|
X = list(range(q))
|
479
479
|
if q != len(X):
|
480
480
|
raise ValueError("q must be the cardinality of X")
|
481
|
-
g = Graph(name="Hamming Graph with parameters
|
481
|
+
g = Graph(name=f"Hamming Graph with parameters {n},{q}", multiedges=False)
|
482
482
|
g.add_vertices(product(*repeat(X, n)))
|
483
483
|
for v in g:
|
484
484
|
for i in range(n):
|
@@ -1162,7 +1162,7 @@ def CirculantGraph(n, adjacency):
|
|
1162
1162
|
if not isinstance(adjacency, list):
|
1163
1163
|
adjacency = [adjacency]
|
1164
1164
|
|
1165
|
-
G = Graph(n, name="Circulant graph (
|
1165
|
+
G = Graph(n, name=f"Circulant graph ({adjacency})")
|
1166
1166
|
G._circle_embedding(list(range(n)))
|
1167
1167
|
|
1168
1168
|
for v in G:
|
@@ -1276,7 +1276,7 @@ def CubeGraph(n, embedding=1):
|
|
1276
1276
|
p, pn = pn, {}
|
1277
1277
|
|
1278
1278
|
# construct the graph
|
1279
|
-
G = Graph(d, format='dict_of_lists', pos=p, name="
|
1279
|
+
G = Graph(d, format='dict_of_lists', pos=p, name=f"{n}-Cube")
|
1280
1280
|
|
1281
1281
|
else:
|
1282
1282
|
# construct recursively the adjacency dict
|
@@ -1297,7 +1297,7 @@ def CubeGraph(n, embedding=1):
|
|
1297
1297
|
d, dn = dn, {}
|
1298
1298
|
|
1299
1299
|
# construct the graph
|
1300
|
-
G = Graph(d, name="
|
1300
|
+
G = Graph(d, name=f"{n}-Cube", format='dict_of_lists')
|
1301
1301
|
|
1302
1302
|
if embedding == 2:
|
1303
1303
|
# Orthogonal projection
|
@@ -1399,7 +1399,7 @@ def DorogovtsevGoltsevMendesGraph(n):
|
|
1399
1399
|
"""
|
1400
1400
|
import networkx
|
1401
1401
|
return Graph(networkx.dorogovtsev_goltsev_mendes_graph(n),
|
1402
|
-
name="Dorogovtsev-Goltsev-Mendes Graph,
|
1402
|
+
name=f"Dorogovtsev-Goltsev-Mendes Graph, {n}-th generation")
|
1403
1403
|
|
1404
1404
|
|
1405
1405
|
def FoldedCubeGraph(n):
|
@@ -1638,7 +1638,7 @@ def FibonacciTree(n):
|
|
1638
1638
|
|
1639
1639
|
- Harald Schilly and Yann Laigle-Chapuy (2010-03-25)
|
1640
1640
|
"""
|
1641
|
-
T = Graph(name="Fibonacci-Tree
|
1641
|
+
T = Graph(name=f"Fibonacci-Tree-{n}")
|
1642
1642
|
if n == 1:
|
1643
1643
|
T.add_vertex(0)
|
1644
1644
|
if n < 2:
|
@@ -1712,6 +1712,13 @@ def GeneralizedPetersenGraph(n, k):
|
|
1712
1712
|
sage: g.is_bipartite()
|
1713
1713
|
True
|
1714
1714
|
|
1715
|
+
TESTS:
|
1716
|
+
|
1717
|
+
Check that the name of the graph is correct::
|
1718
|
+
|
1719
|
+
sage: graphs.GeneralizedPetersenGraph(7, 2).name()
|
1720
|
+
'Generalized Petersen graph (n=7,k=2)'
|
1721
|
+
|
1715
1722
|
AUTHORS:
|
1716
1723
|
|
1717
1724
|
- Anders Jonsson (2009-10-15)
|
@@ -1720,7 +1727,7 @@ def GeneralizedPetersenGraph(n, k):
|
|
1720
1727
|
raise ValueError("n must be larger than 2")
|
1721
1728
|
if k < 1 or k > (n - 1) // 2:
|
1722
1729
|
raise ValueError("k must be in 1<= k <=floor((n-1)/2)")
|
1723
|
-
G = Graph(2 * n, name="Generalized Petersen graph (n=
|
1730
|
+
G = Graph(2 * n, name=f"Generalized Petersen graph (n={n},k={k})")
|
1724
1731
|
for i in range(n):
|
1725
1732
|
G.add_edge(i, (i+1) % n)
|
1726
1733
|
G.add_edge(i, i+n)
|
@@ -1805,7 +1812,7 @@ def IGraph(n, j, k):
|
|
1805
1812
|
if k < 1 or k > (n - 1) // 2:
|
1806
1813
|
raise ValueError("k must be in 1 <= k <= floor((n - 1) / 2)")
|
1807
1814
|
|
1808
|
-
G = Graph(2 * n, name="I-graph (n={}, j={}, k={})"
|
1815
|
+
G = Graph(2 * n, name=f"I-graph (n={n}, j={j}, k={k})")
|
1809
1816
|
for i in range(n):
|
1810
1817
|
G.add_edge(i, (i + j) % n)
|
1811
1818
|
G.add_edge(i, i + n)
|
@@ -1833,7 +1840,7 @@ def DoubleGeneralizedPetersenGraph(n, k):
|
|
1833
1840
|
|
1834
1841
|
PLOTTING: Upon construction, the position dictionary is filled to override
|
1835
1842
|
the spring-layout algorithm. By convention, the double generalized Petersen
|
1836
|
-
graphs are displayed as 4
|
1843
|
+
graphs are displayed as 4 concentric cycles, with the first n nodes drawn on
|
1837
1844
|
the outer circle. The first (0) node is drawn at the top of the
|
1838
1845
|
outer-circle, moving counterclockwise after that. The second circle is drawn
|
1839
1846
|
with the (n)th node at the top, then counterclockwise as well. The tird
|
@@ -1871,7 +1878,7 @@ def DoubleGeneralizedPetersenGraph(n, k):
|
|
1871
1878
|
if k < 1 or k > (n - 1) // 2:
|
1872
1879
|
raise ValueError("k must be in 1 <= k <= floor((n - 1) / 2)")
|
1873
1880
|
|
1874
|
-
G = Graph(4 * n, name="Double generalized Petersen graph (n={}, k={})"
|
1881
|
+
G = Graph(4 * n, name=f"Double generalized Petersen graph (n={n}, k={k})")
|
1875
1882
|
for i in range(n):
|
1876
1883
|
G.add_edge(i, (i + 1) % n)
|
1877
1884
|
G.add_edge(i + 3 * n, (i + 1) % n + 3 * n)
|
@@ -1890,7 +1897,7 @@ def RoseWindowGraph(n, a, r):
|
|
1890
1897
|
r"""
|
1891
1898
|
Return a rose window graph with `2n` nodes.
|
1892
1899
|
|
1893
|
-
The rose window graphs is a family of
|
1900
|
+
The rose window graphs is a family of tetravalent graphs introduced in
|
1894
1901
|
[Wilson2008]_. The parameters `n`, `a` and `r` are integers such that
|
1895
1902
|
`n > 2`, `1 \leq a, r < n`, and `r \neq n / 2`.
|
1896
1903
|
|
@@ -1964,7 +1971,7 @@ def RoseWindowGraph(n, a, r):
|
|
1964
1971
|
if r == n / 2:
|
1965
1972
|
raise ValueError("r must be different than n / 2")
|
1966
1973
|
|
1967
|
-
G = Graph(2 * n, name="
|
1974
|
+
G = Graph(2 * n, name=f"Rose window graph (n={n}, a={a}, r={r})")
|
1968
1975
|
for i in range(n):
|
1969
1976
|
G.add_edge(i, (i + 1) % n)
|
1970
1977
|
G.add_edge(i, i + n)
|
@@ -2072,7 +2079,7 @@ def TabacjnGraph(n, a, b, r):
|
|
2072
2079
|
if r == n/2:
|
2073
2080
|
raise ValueError("r must be different than n / 2")
|
2074
2081
|
|
2075
|
-
G = Graph(2 * n, name="Tabačjn graph (n={}, a={}, b={}, r={})"
|
2082
|
+
G = Graph(2 * n, name=f"Tabačjn graph (n={n}, a={a}, b={b}, r={r})")
|
2076
2083
|
for i in range(n):
|
2077
2084
|
G.add_edge(i, (i + 1) % n)
|
2078
2085
|
G.add_edge(i, i + n)
|
@@ -2211,7 +2218,7 @@ def HyperStarGraph(n, k):
|
|
2211
2218
|
c[i] = one
|
2212
2219
|
adj[u] = L
|
2213
2220
|
|
2214
|
-
return Graph(adj, format='dict_of_lists', name="HS(
|
2221
|
+
return Graph(adj, format='dict_of_lists', name=f"HS({n},{k})")
|
2215
2222
|
|
2216
2223
|
|
2217
2224
|
def LCFGraph(n, shift_list, repeats):
|
@@ -2451,7 +2458,7 @@ def NKStarGraph(n, k):
|
|
2451
2458
|
tmp_dict[vert] = None
|
2452
2459
|
v[0] = tmp_bit
|
2453
2460
|
d["".join(v)] = tmp_dict
|
2454
|
-
return Graph(d, name="(
|
2461
|
+
return Graph(d, name=f"({n},{k})-star")
|
2455
2462
|
|
2456
2463
|
|
2457
2464
|
def NStarGraph(n):
|
@@ -2499,7 +2506,7 @@ def NStarGraph(n):
|
|
2499
2506
|
# swap back
|
2500
2507
|
v[0], v[i] = v[i], v[0]
|
2501
2508
|
d["".join(v)] = tmp_dict
|
2502
|
-
return Graph(d, name="
|
2509
|
+
return Graph(d, name=f"{n}-star")
|
2503
2510
|
|
2504
2511
|
|
2505
2512
|
def OddGraph(n):
|
@@ -2580,7 +2587,7 @@ def PaleyGraph(q):
|
|
2580
2587
|
if not mod(q, 4) == 1:
|
2581
2588
|
raise ValueError("parameter q must be congruent to 1 mod 4")
|
2582
2589
|
g = Graph([FiniteField(q, 'a'), lambda i, j: (i - j).is_square()],
|
2583
|
-
loops=False, name="Paley graph with parameter {}"
|
2590
|
+
loops=False, name=f"Paley graph with parameter {q}")
|
2584
2591
|
return g
|
2585
2592
|
|
2586
2593
|
|
@@ -3136,7 +3143,7 @@ def petersen_family(generate=False):
|
|
3136
3143
|
# for as long as we generate new graphs.
|
3137
3144
|
P = PetersenGraph()
|
3138
3145
|
|
3139
|
-
l = set(
|
3146
|
+
l = set()
|
3140
3147
|
l_new = [P.canonical_label().graph6_string()]
|
3141
3148
|
|
3142
3149
|
while l_new:
|
@@ -3236,7 +3243,7 @@ def SierpinskiGasketGraph(n):
|
|
3236
3243
|
dg.add_edges([(tuple(b), tuple(c)) for a, b, c in tri_list])
|
3237
3244
|
dg.add_edges([(tuple(c), tuple(a)) for a, b, c in tri_list])
|
3238
3245
|
dg.set_pos({(x, y): (x + y / 2, y * 3 / 4)
|
3239
|
-
for
|
3246
|
+
for x, y in dg})
|
3240
3247
|
dg.relabel()
|
3241
3248
|
return dg
|
3242
3249
|
|
@@ -4265,14 +4272,17 @@ def MuzychukS6Graph(n, d, Phi='fixed', Sigma='fixed', verbose=False):
|
|
4265
4272
|
rand = randrange(0, len(temp))
|
4266
4273
|
Phi[(x, line)] = temp.pop(rand)
|
4267
4274
|
elif Phi == 'fixed':
|
4268
|
-
Phi = {(x, line): val for x in range(m)
|
4275
|
+
Phi = {(x, line): val for x in range(m)
|
4276
|
+
for val, line in enumerate(L_i[x])}
|
4269
4277
|
else:
|
4270
4278
|
assert isinstance(Phi, dict), \
|
4271
4279
|
"Phi must be a dictionary or 'random' or 'fixed'"
|
4272
|
-
assert set(Phi.keys()) ==
|
4280
|
+
assert set(Phi.keys()) == {(x, line) for x in range(m)
|
4281
|
+
for line in L_i[x]}, \
|
4273
4282
|
'each Phi_i must have domain L_i'
|
4274
4283
|
for x in range(m):
|
4275
|
-
assert m - 2 == len(
|
4284
|
+
assert m - 2 == len({val for key, val in Phi.items()
|
4285
|
+
if key[0] == x}), \
|
4276
4286
|
'each phi_i must be injective'
|
4277
4287
|
for val in Phi.values():
|
4278
4288
|
assert val in range(m - 1), \
|
@@ -4311,7 +4321,7 @@ def MuzychukS6Graph(n, d, Phi='fixed', Sigma='fixed', verbose=False):
|
|
4311
4321
|
|
4312
4322
|
# build V
|
4313
4323
|
edges = [] # how many? *m^2*n^2
|
4314
|
-
for
|
4324
|
+
for i, j in L.edges(sort=True, labels=False):
|
4315
4325
|
for hyp in phi[(i, (i, j))]:
|
4316
4326
|
for x in hyp:
|
4317
4327
|
newEdges = [((i, x), (j, y))
|
@@ -4405,7 +4415,7 @@ def CubeConnectedCycle(d):
|
|
4405
4415
|
if d < 1:
|
4406
4416
|
raise ValueError('the dimension d must be greater than 0')
|
4407
4417
|
|
4408
|
-
G = Graph(name="Cube-Connected Cycle of dimension {}"
|
4418
|
+
G = Graph(name=f"Cube-Connected Cycle of dimension {d}")
|
4409
4419
|
|
4410
4420
|
if d == 1:
|
4411
4421
|
G.allow_loops(True)
|
sage/graphs/generators/random.py
CHANGED
@@ -966,12 +966,12 @@ def RandomProperIntervalGraph(n, seed=None):
|
|
966
966
|
for k in range(2 * np):
|
967
967
|
# Choose symbol x_{k+1}
|
968
968
|
if random() < ((hx[k] + 2) * (r - hx[k] + 1)) / (2 * (r + 1) * (hx[k] + 1)):
|
969
|
-
# We have
|
969
|
+
# We have chosen symbol [, so we start an interval
|
970
970
|
hx.append(hx[k] + 1)
|
971
971
|
intervals[L][0] = k + 1
|
972
972
|
L += 1
|
973
973
|
else:
|
974
|
-
# We have
|
974
|
+
# We have chosen symbol ], so we end an interval
|
975
975
|
hx.append(hx[k] - 1)
|
976
976
|
intervals[R][1] = k + 1
|
977
977
|
R += 1
|
@@ -3338,7 +3338,7 @@ def HoffmanSingletonGraph():
|
|
3338
3338
|
D.append(p)
|
3339
3339
|
vv = 'q%s' % (int(p[1]) + 1)
|
3340
3340
|
v = [v[-1] for v in H.neighbors(p) if v[:2] == vv]
|
3341
|
-
if
|
3341
|
+
if v:
|
3342
3342
|
s = int(v[0])
|
3343
3343
|
l += 1
|
3344
3344
|
map = H.relabel(range(50), return_map=True)
|
@@ -4023,7 +4023,7 @@ def MurtyGraph():
|
|
4023
4023
|
3
|
4024
4024
|
sage: g.diameter()
|
4025
4025
|
2
|
4026
|
-
sage: g.is_hamiltonian()
|
4026
|
+
sage: g.is_hamiltonian() # needs sage.numerical.mip
|
4027
4027
|
True
|
4028
4028
|
sage: g.show() # long time # needs sage.plot
|
4029
4029
|
|
@@ -5644,7 +5644,7 @@ def IoninKharaghani765Graph():
|
|
5644
5644
|
# Associate a matrix to every entry of W
|
5645
5645
|
int_to_matrix = {0: matrix.zero(45)}
|
5646
5646
|
for i in range(15):
|
5647
|
-
vec = [frozenset(
|
5647
|
+
vec = [frozenset(), L[0, 0], L[1, 0], L[2, 0], L[3, 0]]
|
5648
5648
|
vec = f_pow(pi_vec, i % 3, vec)
|
5649
5649
|
vec = f_pow(sigma2, i % 5, vec)
|
5650
5650
|
int_to_matrix[i + 1] = N(vec)
|