Skip to content

Commit d702234

Browse files
committed
some care for graphs in sage/combinat/posets/mobile.py
1 parent c2f4f7b commit d702234

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/sage/combinat/posets/lattices.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1695,7 +1695,7 @@ def is_cosectionally_complemented(self, certificate=False):
16951695
n = H.order()
16961696
for e in range(n - 2, -1, -1):
16971697
t = 0
1698-
for uc in H.neighbors_out(e):
1698+
for uc in H.neighbor_out_iterator(e):
16991699
t = jn[t, uc]
17001700
if t == n - 1:
17011701
break

src/sage/combinat/posets/mobile.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,13 @@ def _is_valid_ribbon(self, ribbon):
112112
num_anchors = 0
113113

114114
for r in ribbon:
115-
anchor_neighbors = set(G.neighbors_out(r)).difference(set(R.neighbors_out(r)))
115+
anchor_neighbors = set(G.neighbor_out_iterator(r)).difference(set(R.neighbor_out_iterator(r)))
116116
if len(anchor_neighbors) == 1:
117117
num_anchors += 1
118118
elif len(anchor_neighbors) > 1:
119119
return False
120120

121-
for lc in G.neighbors_in(r):
121+
for lc in G.neighbor_in_iterator(r):
122122
if lc in ribbon:
123123
continue
124124

@@ -151,7 +151,7 @@ def _anchor(self):
151151

152152
# Find the anchor vertex, if it exists, and return the edge
153153
for r in ribbon:
154-
anchor_neighbors = set(H.neighbors_out(r)).difference(set(R.neighbors_out(r)))
154+
anchor_neighbors = set(H.neighbor_out_iterator(r)).difference(set(R.neighbor_out_iterator(r)))
155155
if len(anchor_neighbors) == 1:
156156
anchor = (r, anchor_neighbors.pop())
157157
break

0 commit comments

Comments
 (0)