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

naturalLabeling -- relabels a poset with a natural labeling

Synopsis

Description

A poset is naturally labeled if the ground set is ordered v1, ..., vn and if vi ≤vj in P implies i ≤j. This method relabels the ground set of the poset (suppose it has n vertices) to be 0, 1, ..., n-1.
i1 : P = booleanLattice 3;
i2 : Q = naturalLabeling P

o2 = Poset{cache => CacheTable{...13...}                                                                                }
           GroundSet => {0, 1, 2, 4, 3, 5, 6, 7}
           RelationMatrix => | 1 1 1 1 1 1 1 1 |
                             | 0 1 0 1 0 1 0 1 |
                             | 0 0 1 1 0 0 1 1 |
                             | 0 0 0 1 0 0 0 1 |
                             | 0 0 0 0 1 1 1 1 |
                             | 0 0 0 0 0 1 0 1 |
                             | 0 0 0 0 0 0 1 1 |
                             | 0 0 0 0 0 0 0 1 |
           Relations => {{0, 1}, {2, 4}, {0, 2}, {1, 4}, {3, 5}, {6, 7}, {3, 6}, {5, 7}, {0, 3}, {1, 5}, {2, 6}, {4, 7}}

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 = Poset{cache => CacheTable{}                                        }
           GroundSet => {0, 1, 2, 3, 4, 5, 6, 7, 8}
           RelationMatrix => | 1 1 1 0 0 0 0 0 0 |
                             | 0 1 1 0 0 0 0 0 0 |
                             | 0 0 1 0 0 0 0 0 0 |
                             | 0 0 0 1 1 1 0 0 0 |
                             | 0 0 0 0 1 1 0 0 0 |
                             | 0 0 0 0 0 1 0 0 0 |
                             | 0 0 0 0 0 0 1 1 1 |
                             | 0 0 0 0 0 0 0 1 1 |
                             | 0 0 0 0 0 0 0 0 1 |
           Relations => {{0, 1}, {1, 2}, {3, 4}, {4, 5}, {6, 7}, {7, 8}}

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 :