Skip to content

Commit 567aef8

Browse files
author
Release Manager
committed
sagemathgh-36544: Support networkx 3.2 In networkx 3.2 the output for cycle_basis() has changed. After a discussion in sagemath#36486 it seems that checking that the output is correct would not be easy. In the spirit of supporting networkx 3.2 at the same time as networkx 3.1, the easiest way is to mark these five tests as random output. ### 📝 Checklist - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. Fixes: sagemath#36486 URL: sagemath#36544 Reported by: Gonzalo Tornaría Reviewer(s): Matthias Köppe
2 parents 4b94198 + fe163ac commit 567aef8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/sage/graphs/generic_graph.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5102,13 +5102,13 @@ def cycle_basis(self, output='vertex'):
51025102
A cycle basis in Petersen's Graph ::
51035103

51045104
sage: g = graphs.PetersenGraph()
5105-
sage: g.cycle_basis() # needs networkx
5105+
sage: g.cycle_basis() # needs networkx, random (changes in networkx 3.2)
51065106
[[1, 6, 8, 5, 0], [4, 9, 6, 8, 5, 0], [7, 9, 6, 8, 5],
51075107
[4, 3, 8, 5, 0], [1, 2, 3, 8, 5, 0], [7, 2, 3, 8, 5]]
51085108

51095109
One can also get the result as a list of lists of edges::
51105110

5111-
sage: g.cycle_basis(output='edge') # needs networkx
5111+
sage: g.cycle_basis(output='edge') # needs networkx, random (changes in networkx 3.2)
51125112
[[(1, 6, None), (6, 8, None), (8, 5, None), (5, 0, None),
51135113
(0, 1, None)], [(4, 9, None), (9, 6, None), (6, 8, None),
51145114
(8, 5, None), (5, 0, None), (0, 4, None)], [(7, 9, None),
@@ -5291,17 +5291,17 @@ def minimum_cycle_basis(self, algorithm=None, weight_function=None, by_weight=Fa
52915291
[[1, 2, 3], [1, 2, 3, 4], [5, 6, 7]]
52925292
sage: sorted(g.minimum_cycle_basis(by_weight=False))
52935293
[[1, 2, 3], [1, 3, 4], [5, 6, 7]]
5294-
sage: sorted(g.minimum_cycle_basis(by_weight=True, algorithm='NetworkX')) # needs networkx
5294+
sage: sorted(g.minimum_cycle_basis(by_weight=True, algorithm='NetworkX')) # needs networkx, random (changes in networkx 3.2)
52955295
[[1, 2, 3], [1, 2, 3, 4], [5, 6, 7]]
5296-
sage: g.minimum_cycle_basis(by_weight=False, algorithm='NetworkX') # needs networkx
5296+
sage: g.minimum_cycle_basis(by_weight=False, algorithm='NetworkX') # needs networkx, random (changes in networkx 3.2)
52975297
[[1, 2, 3], [1, 3, 4], [5, 6, 7]]
52985298

52995299
::
53005300

53015301
sage: g = Graph([(1, 2), (2, 3), (3, 4), (4, 5), (5, 1), (5, 3)])
53025302
sage: sorted(g.minimum_cycle_basis(by_weight=False))
53035303
[[1, 2, 3, 5], [3, 4, 5]]
5304-
sage: sorted(g.minimum_cycle_basis(by_weight=False, algorithm='NetworkX')) # needs networkx
5304+
sage: sorted(g.minimum_cycle_basis(by_weight=False, algorithm='NetworkX')) # needs networkx, random (changes in networkx 3.2)
53055305
[[1, 2, 3, 5], [3, 4, 5]]
53065306

53075307
TESTS::

0 commit comments

Comments
 (0)