First time here? Check out the FAQ!

Ask Your Question
2

Filtering certain posets

asked 4 years ago

klaaa gravatar image

updated 4 years ago

I want to filter the set of all connected posets with n points using sage. I want to filter out the posets whose underlying undirected graph of its Hasse diagram is not a tree (equivalently, the incidence algebra is not hereditary) and such that there is no element x in the poset P such that any other element of P is comparable to y. Is there an easy method to do this with sage?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 4 years ago

FrédéricC gravatar image

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
Preview: (hide)
link

Comments

Thank you very much!

klaaa gravatar imageklaaa ( 4 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 4 years ago

Seen: 211 times

Last updated: Nov 29 '20