Changes between Version 1 and Version 2 of Ticket #17004


Ignore:
Timestamp:
09/18/14 07:43:14 (5 years ago)
Author:
jmantysalo
Comment:

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:
     1Height of a poset is defined as a length of the longest chain:
    22
    33{{{
    44def 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()])
    126}}}
    137
    14 or as a length of level_sets or...
     8but there is probably some faster way?