Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 0 years ago

FrédéricC gravatar image

Like this

def dilworth(P):
    def lequal(A, B):
        return all(any(P.is_lequal(a, b) for b in B) for a in A)
    data = [tuple(a) for a in P.maximal_antichains()]
    return Poset([data, lequal])
click to hide/show revision 2
No.2 Revision

Like this

def dilworth(P):
    def lequal(A, B):
        return all(any(P.is_lequal(a, b) for b in B) for a in A)
    w = P.width()
    data = [tuple(a) for a in P.maximal_antichains()]
P.maximal_antichains() if len(a) == w]
    return Poset([data, lequal])