The poset $P$ is ranked if there exists an integer function $r$ on the vertex set of $P$ such that for each $a$ and $b$ in the poset if $b$ covers $a$ then $r(b) - r(a) = 1$.
The $n$ chain and the $n$ booleanLattice are ranked.
i1 : n = 5; |
i2 : C = chain n; |
i3 : isRanked C o3 = true |
i4 : rankFunction C o4 = {0, 1, 2, 3, 4} o4 : List |
i5 : B = booleanLattice n; |
i6 : isRanked B o6 = true |
i7 : rankGeneratingFunction C 4 3 2 o7 = q + q + q + q + 1 o7 : ZZ[q] |
However, the pentagon lattice is not ranked.
i8 : P = poset {{1,2}, {1,3}, {3,4}, {2,5}, {4,5}}; |
i9 : isRanked P o9 = false |
This method uses the method rankPoset, which was ported from John Stembridge's Maple package available at http://www.math.lsa.umich.edu/~jrs/maple.html#posets.
The object isRanked is a method function.