Ask Your Question
2

Filtering certain posets

asked 2020-11-29 11:17:39 +0200

klaaa gravatar image

updated 2020-11-29 11:27:23 +0200

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 13:31:37 +0200

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 19:13:27 +0200 )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 11:17:39 +0200

Seen: 146 times

Last updated: Nov 29 '20