File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -294,26 +294,21 @@ def is_supergreedy(self):
294
294
sage: T.linear_extensions()[0].is_supergreedy()
295
295
True
296
296
"""
297
- P = self .poset ()
298
- H = P .hasse_diagram ()
299
- sources = H .sources ()
297
+ H = self .poset ().hasse_diagram ()
298
+ L = sources = H .sources ()
300
299
linext = []
301
- if not self :
302
- return True
303
- if self [0 ] not in sources :
304
- return False
305
- for i in range (len (self )- 2 ):
306
- linext .append (self [i ])
300
+ for e in self :
301
+ if e not in L :
302
+ return False
303
+ linext .append (e )
307
304
for y in reversed (linext ):
308
305
L = [x for x in H .neighbor_out_iterator (y )
309
306
if x not in linext
310
307
and all (low in linext for low in H .neighbor_in_iterator (x ))]
311
308
if L :
312
309
break
313
310
else :
314
- L = (x for x in sources if x not in linext )
315
- if self [i + 1 ] not in L :
316
- return False
311
+ L = sources = [x for x in sources if x not in linext ]
317
312
return True
318
313
319
314
def tau (self , i ):
You can’t perform that action at this time.
0 commit comments