Ask Your Question
2

Filtering certain posets

asked 2020-11-29 04:17:39 -0600

klaaa gravatar image

updated 2020-11-29 04:27:23 -0600

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?

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
2

answered 2020-11-29 06:31:37 -0600

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
edit flag offensive delete link more

Comments

Thank you very much!

klaaa gravatar imageklaaa ( 2020-11-29 12:13:27 -0600 )edit

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: 2020-11-29 04:17:39 -0600

Seen: 33 times

Last updated: Nov 29 '20