| 1 | initial version |
Maybe something like this
sage: def banana(n):
....: for P in posets(n):
....: if not P.is_connected():
....: continue
....: H = P.hasse_diagram()
....: if H.to_undirected().is_tree():
....: continue
....: dg = H.transitive_closure()
....: if any(dg.degree(x) == n - 1 for x in dg):
....: continue
....: yield P
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.