next | previous | forward | backward | up | top | index | toc | Macaulay2 website
Posets :: naturalLabeling

naturalLabeling -- relabels a poset with a natural labeling



A poset is naturally labeled if the ground set is ordered $v_1, \ldots, v_n$ and if $v_i \leq v_j$ in $P$ implies $i \leq j$. This method relabels the ground set of the poset (suppose it has $n$ vertices) to be $0, 1, \ldots, n-1$.

i1 : P = booleanLattice 3;
i2 : Q = naturalLabeling P

o2 = Q

o2 : Poset
i3 : all(allRelations Q, r -> r_0 <= r_1)

o3 = true

If startIndex is specified, then the values are shifted by that amount. This can be useful for making a disjoint union of posets.

i4 : C = chain 3;
i5 : Q' = sum(3, i -> naturalLabeling(C, 3*i))

o5 = Q'

o5 : Poset
i6 : all(allRelations Q', r -> r_0 <= r_1)

o6 = true

Note the cache of $P$ is copied to the cache of $Q$ with the appropriate adjustments being made.

See also

Ways to use naturalLabeling :

For the programmer

The object naturalLabeling is a method function.