Changes between Version 1 and Version 2 of Ticket #17004
 Timestamp:
 09/18/14 07:43:14 (5 years ago)
Legend:
 Unmodified
 Added
 Removed
 Modified

Ticket #17004 – Description
v1 v2 1 Height of a poset is defined as a length of the longest chain . It can be done for example like this:1 Height of a poset is defined as a length of the longest chain: 2 2 3 3 {{{ 4 4 def height(P): 5 if P.cardinality() == 0: 6 return 0 7 H=P.hasse_diagram().to_undirected() 8 m=0 9 for s in H.connected_components(): 10 m=max(H.subgraph(s).diameter(),m) 11 return m+1 5 return max([len(x) for x in P.maximal_chains()]) 12 6 }}} 13 7 14 or as a length of level_sets or... 8 but there is probably some faster way?