Skip to content

Commit 388fad1

Browse files
committed
avoid using itertools.pairwise
1 parent eb8417b commit 388fad1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sage/graphs/generic_graph.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5211,7 +5211,6 @@ def cycle_basis(self, output='vertex'):
52115211
[])
52125212

52135213
from sage.graphs.graph import Graph
5214-
from itertools import pairwise
52155214
T = Graph(self.min_spanning_tree(), multiedges=True, format='list_of_edges')
52165215
H = self.copy()
52175216
H.delete_edges(T.edge_iterator())
@@ -5235,7 +5234,8 @@ def cycle_basis(self, output='vertex'):
52355234

52365235
cycle = Q + P[-2::-1]
52375236
if output == 'edge':
5238-
cycle = [e] + [(x, y, T.edge_label(x, y)[0]) for x, y in pairwise(cycle)]
5237+
cycle = [e] + [(x, y, T.edge_label(x, y)[0])
5238+
for x, y in zip(cycle[:-1], cycle[1:])]
52395239
L.append(cycle)
52405240
return L
52415241

0 commit comments

Comments
 (0)