Macaulay2 » Documentation
Packages » Posets :: antichains
next | previous | forward | backward | up | index | toc

# antichains -- computes all antichains of a poset

- Usage:
    `L = antichains P`
- Inputs:
  - P, an instance of the type Poset,
  - k, an integer, if specified length of returned antichains
- Outputs:
  - L, a list, containing all antichains of $P$

## Description

A set of elements of $P$ is called an antichain if no two distinct elements of the set are comparable.

    i1 : D = divisorPoset 12;

    i2 : antichains D

    o2 = {{}, {1}, {2}, {2, 3}, {3}, {3, 4}, {4}, {4, 6}, {6}, {12}}

    o2 : List

With the input k, the method restricts to only antichains of that length. In a divisorPoset, all chains of length $2$ describe exactly the non-divisor-multiple pairs.

    i3 : antichains(D, 2)

    o3 = {{2, 3}, {3, 4}, {4, 6}}

    o3 : List

Since every distinct pair of vertices in a chain is comparable, the only antichains of a chain are the singleton sets and the empty set.

    i4 : antichains chain 5

    o4 = {{}, {1}, {2}, {3}, {4}, {5}}

    o4 : List

## See also

- chains -- computes all chains of a poset
- isAntichain -- determines if a given list of vertices is an antichain of a poset

## Ways to use antichains:

- `antichains(Poset)`
- `antichains(Poset,ZZ)`

## For the programmer

The object antichains is a method function.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Posets.m2:4688:0.