@@ -1805,13 +1805,13 @@ def is_relatively_complemented(self, certificate=False):
1805
1805
return False
1806
1806
1807
1807
for e1 in range (n - 1 ):
1808
- C = Counter (flatten ([H .neighbors_out (e2 ) for e2 in H .neighbors_out (e1 )]))
1808
+ C = Counter (flatten ([H .neighbors_out (e2 ) for e2 in H .neighbor_out_iterator (e1 )]))
1809
1809
for e3 , c in C .items ():
1810
1810
if c == 1 and len (H .closed_interval (e1 , e3 )) == 3 :
1811
1811
if not certificate :
1812
1812
return False
1813
- for e2 in H .neighbors_in (e3 ):
1814
- if e2 in H .neighbors_out (e1 ):
1813
+ for e2 in H .neighbor_in_iterator (e3 ):
1814
+ if e2 in H .neighbor_out_iterator (e1 ):
1815
1815
break
1816
1816
return (False , (self ._vertex_to_element (e1 ),
1817
1817
self ._vertex_to_element (e2 ),
@@ -1885,7 +1885,7 @@ def is_sectionally_complemented(self, certificate=False):
1885
1885
n = H .order () - 1
1886
1886
for e in range (2 , n + 1 ):
1887
1887
t = n
1888
- for lc in H .neighbors_in (e ):
1888
+ for lc in H .neighbor_in_iterator (e ):
1889
1889
t = mt [t , lc ]
1890
1890
if t == 0 :
1891
1891
break
@@ -1988,7 +1988,7 @@ def join(L):
1988
1988
1989
1989
# Get elements more than B levels below it.
1990
1990
too_close = set (H .breadth_first_search (j ,
1991
- neighbors = H .neighbors_in ,
1991
+ neighbors = H .neighbor_in_iterator ,
1992
1992
distance = B - 2 ))
1993
1993
elems = [e for e in H .order_ideal ([j ]) if e not in too_close ]
1994
1994
@@ -2378,7 +2378,7 @@ def is_atomic(self, certificate=False):
2378
2378
if self .cardinality () < 3 :
2379
2379
return (True , None )
2380
2380
H = self ._hasse_diagram
2381
- atoms = set (H .neighbors_out (0 ))
2381
+ atoms = set (H .neighbor_out_iterator (0 ))
2382
2382
for v in H :
2383
2383
if H .in_degree (v ) == 1 and v not in atoms :
2384
2384
return (False , self ._vertex_to_element (v ))
@@ -2436,7 +2436,7 @@ def is_coatomic(self, certificate=False):
2436
2436
if self .cardinality () < 3 :
2437
2437
return (True , None )
2438
2438
H = self ._hasse_diagram
2439
- coatoms = set (H .neighbors_in (n - 1 ))
2439
+ coatoms = set (H .neighbor_in_iterator (n - 1 ))
2440
2440
for v in H :
2441
2441
if H .out_degree (v ) == 1 and v not in coatoms :
2442
2442
return (False , self ._vertex_to_element (v ))
@@ -3782,8 +3782,8 @@ def is_dismantlable(self, certificate=False):
3782
3782
if certificate :
3783
3783
cert .append (e )
3784
3784
if i == 1 and o == 1 : # Remove inside the lattice
3785
- lower = H . neighbors_in (e )[ 0 ]
3786
- upper = H . neighbors_out (e )[ 0 ]
3785
+ lower = next ( H . neighbor_in_iterator (e ))
3786
+ upper = next ( H . neighbor_out_iterator (e ))
3787
3787
H .delete_vertex (e )
3788
3788
if upper not in H .depth_first_search (lower ):
3789
3789
H .add_edge (lower , upper )
@@ -4125,11 +4125,11 @@ def canonical_meetands(self, e):
4125
4125
H = self ._hasse_diagram
4126
4126
e = self ._element_to_vertex (e )
4127
4127
meetands = []
4128
- for a in H .neighbors_out (e ):
4129
- above_a = list (H .depth_first_search (a ))
4128
+ for a in H .neighbor_out_iterator (e ):
4129
+ above_a = set (H .depth_first_search (a ))
4130
4130
4131
4131
def go_up (v ):
4132
- return [v_ for v_ in H .neighbors_out (v ) if v_ not in above_a ]
4132
+ return [v_ for v_ in H .neighbor_out_iterator (v ) if v_ not in above_a ]
4133
4133
4134
4134
result = None
4135
4135
for v in H .depth_first_search (e , neighbors = go_up ):
@@ -4191,11 +4191,11 @@ def canonical_joinands(self, e):
4191
4191
H = self ._hasse_diagram
4192
4192
e = self ._element_to_vertex (e )
4193
4193
joinands = []
4194
- for a in H .neighbors_in (e ):
4195
- below_a = list (H .depth_first_search (a , neighbors = H .neighbors_in ))
4194
+ for a in H .neighbor_in_iterator (e ):
4195
+ below_a = set (H .depth_first_search (a , neighbors = H .neighbor_in_iterator ))
4196
4196
4197
4197
def go_down (v ):
4198
- return [v_ for v_ in H .neighbors_in (v ) if v_ not in below_a ]
4198
+ return [v_ for v_ in H .neighbor_in_iterator (v ) if v_ not in below_a ]
4199
4199
4200
4200
result = None
4201
4201
for v in H .depth_first_search (e , neighbors = go_down ):
0 commit comments