PartiallyOrderedSets
MaximalAntichains
returns all the maximal antichains of a poset
Calling Sequence
Parameters
Description
Examples
References
Compatibility
MaximalAntichains(P)
MaximalAntichains(P,opts)
P
-
PartiallyOrderedSet
opts
(optional) option of the form output = o, where o is list or iterator
The command MaximalAntichains(P) returns as a list of lists the maximal antichains of the partially ordered set P.
By default, the antichains are returned as a list of lists. If the option output = iterator is passed to the MaximalAntichains command, the antichains are returned as an iterator; that is, an object that can be used in a for loop or a seq command. Each iteration yields an antichain as a list. This can be more efficient than returning a list of all antichains if there are very, very many of them. The default list of lists can be explicitly selected by using the option output = list.
Remarks
MaximalAntichains will generate and store the transitive closure and adjacency list of P.
Terminology
A partially ordered set, or poset for short, is a pair (P, <=) where P is a set and <= is a partial order on P.
From now on, we fix a poset (P, <=).
A subset C of P is called a chain if any two elements of C are comparable. A chain C of P is said maximal if P does not admit another chain D of which C would be a proper subset.
A subset C of P is called an antichain if any two distinct elements of C are incomparable. An antichain C of P is said maximal if P does not admit another antichain D of which C would be a proper subset. We note that any singleton of P is both a chain and an antichain.
with⁡PartiallyOrderedSets:
leq≔`<=`:
Create a poset from a set and a non-strict partial order
S≔1,2,3,4,5:poset1≔PartiallyOrderedSet⁡S,leq
poset1≔< a poset with 5 elements >
Display this poset
DrawGraph⁡poset1
Compute the maximal antichains of this poset
MaximalAntichains⁡poset1
1,2,3,4,5
divisibility≔x,y↦irem⁡y,x=0:T≔3,4,5,6,7,8,9:
poset2≔PartiallyOrderedSet⁡T,divisibility
poset2≔< a poset with 7 elements >
DrawGraph⁡poset2
MaximalAntichains⁡poset2
3,4,5,7,3,8,5,7,6,4,5,7,9,6,8,5,7,9
Create a poset from a set and an adjacency matrix of a partial order regarded as a directed graph
adjMatrix4≔Matrix⁡1,1,1,1,1,0,1,1,1,1,0,0,1,1,1,0,0,0,1,1,0,0,0,0,1
adjMatrix4≔1111101111001110001100001
poset4≔PartiallyOrderedSet⁡convert⁡S,list,adjMatrix4
poset4≔< a poset with 5 elements >
DrawGraph⁡poset4
MaximalAntichains⁡poset4
Create a poset from a set and an adjacency list of a partial order regarded as a directed graph
adjList5≔map2⁡map,`+`,Array⁡1,4,7,2,6,3,4,5,6,7,2
adjList5≔3,6,94,856789
poset5≔PartiallyOrderedSet⁡convert⁡T,list,adjList5
poset5≔< a poset with 7 elements >
DrawGraph⁡poset5
MaximalAntichains⁡poset5
Create a poset from a set and a directed graph
G≔GraphTheory:-Graph⁡directed,1,2,3,4,5,6,1,1,1,2,1,3,1,4,1,5,1,6,2,2,2,4,2,6,3,3,3,5,3,6,4,4,4,6,5,5,5,6,6,6
G≔Graph 1: a directed graph with 6 vertices, 11 arcs, and 6 self-loops
poset6≔PartiallyOrderedSet⁡G
poset6≔< a poset with 6 elements >
DrawGraph⁡poset6
MaximalAntichains⁡poset6
1,2,3,2,5,4,3,4,5,6
Define a polyhedral set and get its dimension
t≔PolyhedralSets:-ExampleSets:-Octahedron⁡
t≔{Coordinates:x1,x2,x3Relations:−x1−x2−x3≤1,−x1−x2+x3≤1,−x1+x2−x3≤1,−x1+x2+x3≤1,x1−x2−x3≤1,x1−x2+x3≤1,x1+x2−x3≤1,x1+x2+x3≤1
d≔PolyhedralSets:-Dimension⁡t
d≔3
Collect the faces of this polyhedral set
t_faces≔seq⁡op⁡PolyhedralSets:-Faces⁡t,dimension=i,i=−0..d:
t_faces≔t_facesunionPolyhedralSets:-ExampleSets:-EmptySet⁡d:
FL≔convert⁡t_faces,list:
Construct the face lattice of that polyhedral set
inclusion := proc(x,y) PolyhedralSets:-`subset`(FL[x],FL[y]) end proc:
polyhedral_poset≔PartiallyOrderedSet⁡seq⁡i,i=1..nops⁡FL,inclusion
polyhedral_poset≔< a poset with 28 elements >
DrawGraph⁡polyhedral_poset
MaximalAntichains⁡polyhedral_poset
1,5,9,14,18,19,20,5,9,14,18,24,5,9,14,19,22,5,9,14,20,21,5,9,14,21,22,24,5,9,14,25,5,9,15,19,20,5,9,15,19,22,5,9,15,20,16,21,5,9,15,16,21,22,24,5,9,15,16,25,5,9,27,20,5,9,27,25,5,9,27,22,24,5,9,18,20,16,5,9,18,16,24,5,2,15,10,19,20,5,2,15,10,19,12,22,5,2,15,10,20,16,21,5,2,15,10,12,16,21,22,24,5,2,15,10,12,16,25,5,2,15,28,19,5,2,15,28,16,21,24,5,2,15,28,16,25,5,2,27,10,20,5,2,27,10,12,25,5,2,27,10,12,22,24,5,2,27,28,25,5,2,27,28,24,5,2,18,19,20,5,2,18,19,12,5,2,18,20,16,5,2,18,12,16,24,5,8,27,28,25,5,8,27,28,24,5,8,27,20,5,8,27,12,25,5,8,27,12,22,24,5,8,28,19,5,8,28,16,21,24,5,8,28,16,25,5,8,19,20,5,8,19,12,22,5,8,20,16,21,5,8,12,16,21,22,24,5,8,12,16,25,5,14,18,19,12,5,14,18,12,24,5,14,10,19,20,5,14,10,19,12,22,5,14,10,20,21,5,14,10,12,21,22,24,5,14,10,12,25,5,14,28,19,5,14,28,21,24,5,14,28,25,3,9,15,19,20,3,9,15,19,7,22,3,9,15,6,20,16,21,3,9,15,6,7,16,21,22,24,3,9,15,6,7,16,25,3,9,15,11,16,21,22,3,9,15,11,16,25,3,9,27,6,20,3,9,27,6,7,25,3,9,27,6,7,22,24,3,9,27,11,25,3,9,27,11,22,3,9,18,19,20,3,9,18,19,7,3,9,18,6,20,16,3,9,18,6,7,16,24,3,9,18,11,16,3,2,15,10,19,20,4,3,2,15,10,19,7,4,12,22,3,2,15,10,19,17,22,3,2,15,10,6,20,4,16,21,3,2,15,10,6,7,4,12,16,21,22,24,3,2,15,10,6,7,4,12,16,25,3,2,15,10,6,17,16,21,22,24,3,2,15,10,6,17,16,25,3,2,15,10,11,17,16,21,22,3,2,15,10,11,17,16,25,3,2,15,10,11,4,12,16,21,22,3,2,15,10,11,4,12,16,25,3,2,15,28,19,7,4,3,2,15,28,19,17,3,2,15,28,6,7,4,16,21,24,3,2,15,28,6,7,4,16,25,3,2,15,28,6,17,16,21,24,3,2,15,28,6,17,16,25,3,2,15,28,11,17,16,21,3,2,15,28,11,17,16,25,3,2,15,28,11,4,16,21,3,2,15,28,11,4,16,25,3,2,27,10,6,20,4,3,2,27,10,6,7,4,12,25,3,2,27,10,6,7,4,12,22,24,3,2,27,10,6,17,25,3,2,27,10,6,17,22,24,3,2,27,10,11,17,25,3,2,27,10,11,17,22,3,2,27,10,11,4,12,25,3,2,27,10,11,4,12,22,3,2,27,28,6,7,4,25,3,2,27,28,6,7,4,24,3,2,27,28,6,17,25,3,2,27,28,6,17,24,3,2,27,28,11,17,25,3,2,27,28,11,4,25,3,2,18,19,20,4,3,2,18,19,7,4,12,3,2,18,19,17,3,2,18,6,20,4,16,3,2,18,6,7,4,12,16,24,3,2,18,6,17,16,24,3,2,18,11,17,16,3,2,18,11,4,12,16,3,8,27,28,6,7,4,25,3,8,27,28,6,7,4,24,3,8,27,28,6,17,25,3,8,27,28,6,17,24,3,8,27,28,11,17,25,3,8,27,28,11,4,25,3,8,27,6,20,4,3,8,27,6,7,4,12,25,3,8,27,6,7,4,12,22,24,3,8,27,6,17,22,24,3,8,27,11,17,22,3,8,27,11,4,12,25,3,8,27,11,4,12,22,3,8,28,19,7,4,3,8,28,19,17,3,8,28,6,7,4,16,21,24,3,8,28,6,7,4,16,25,3,8,28,6,17,16,21,24,3,8,28,6,17,16,25,3,8,28,11,17,16,21,3,8,28,11,17,16,25,3,8,28,11,4,16,21,3,8,28,11,4,16,25,3,8,19,20,4,3,8,19,7,4,12,22,3,8,19,17,22,3,8,6,20,4,16,21,3,8,6,7,4,12,16,21,22,24,3,8,6,7,4,12,16,25,3,8,6,17,16,21,22,24,3,8,11,17,16,21,22,3,8,11,4,12,16,21,22,3,8,11,4,12,16,25,13,9,15,11,21,22,13,9,15,11,25,13,9,15,20,21,13,9,15,7,21,22,24,13,9,15,7,25,13,9,27,11,25,13,9,27,11,22,13,9,27,20,13,9,27,7,25,13,9,27,7,22,24,13,9,18,11,13,9,18,20,13,9,18,7,24,13,2,15,10,11,17,21,22,13,2,15,10,11,17,25,13,2,15,10,11,4,12,21,22,13,2,15,10,11,4,12,25,13,2,15,10,20,4,21,13,2,15,10,7,4,12,21,22,24,13,2,15,10,7,4,12,25,13,2,15,10,17,21,22,24,13,2,15,28,11,17,21,13,2,15,28,11,17,25,13,2,15,28,11,4,21,13,2,15,28,11,4,25,13,2,15,28,7,4,21,24,13,2,15,28,7,4,25,13,2,15,28,17,21,24,13,2,27,10,11,17,25,13,2,27,10,11,17,22,13,2,27,10,11,4,12,25,13,2,27,10,11,4,12,22,13,2,27,10,20,4,13,2,27,10,7,4,12,25,13,2,27,10,7,4,12,22,24,13,2,27,10,17,22,24,13,2,27,28,11,17,25,13,2,27,28,11,4,25,13,2,27,28,7,4,25,13,2,27,28,7,4,24,13,2,27,28,17,24,13,2,18,11,17,13,2,18,11,4,12,13,2,18,20,4,13,2,18,7,4,12,24,13,2,18,17,24,13,8,27,28,11,17,23,25,13,8,27,28,11,4,25,13,8,27,28,7,4,25,13,8,27,28,7,4,24,13,8,27,28,7,23,25,13,8,27,28,7,23,24,13,8,27,28,17,23,24,13,8,27,11,17,23,22,13,8,27,11,4,12,25,13,8,27,11,4,12,22,13,8,27,11,23,12,25,13,8,27,11,23,12,22,13,8,27,20,4,13,8,27,20,23,13,8,27,7,4,12,25,13,8,27,7,4,12,22,24,13,8,27,7,23,12,25,13,8,27,7,23,12,22,24,13,8,27,17,23,22,24,13,8,28,11,17,23,21,13,8,28,11,4,21,13,8,28,7,4,21,24,13,8,28,7,23,21,24,13,8,28,17,23,21,24,13,8,11,17,23,21,22,13,8,11,4,12,21,22,13,8,11,23,12,21,22,13,8,20,4,21,13,8,20,23,21,13,8,7,4,12,21,22,24,13,8,7,23,12,21,22,24,13,8,17,23,21,22,24,13,15,10,11,17,23,21,22,13,15,10,11,17,23,25,13,15,10,11,23,12,21,22,13,15,10,11,23,12,25,13,15,10,20,23,21,13,15,10,7,23,12,21,22,24,13,15,10,7,23,12,25,13,15,10,17,23,21,22,24,13,15,28,11,17,23,21,13,15,28,11,17,23,25,13,15,28,7,23,21,24,13,15,28,7,23,25,13,15,28,17,23,21,24,13,27,10,11,17,23,25,13,27,10,11,17,23,22,13,27,10,11,23,12,25,13,27,10,11,23,12,22,13,27,10,20,23,13,27,10,7,23,12,25,13,27,10,7,23,12,22,24,13,27,10,17,23,22,24,13,18,11,17,23,13,18,11,23,12,13,18,20,23,13,18,7,23,12,24,13,18,17,23,24,26,9,14,18,19,7,9,14,18,6,20,9,14,18,6,7,24,9,14,18,11,9,14,19,7,22,9,14,6,20,21,9,14,6,7,21,22,24,9,14,6,7,25,9,14,11,21,22,9,14,11,25,8,27,28,6,7,23,25,8,27,28,6,7,23,24,8,27,28,6,17,23,25,8,27,28,6,17,23,24,8,27,6,20,23,8,27,6,7,23,12,25,8,27,6,7,23,12,22,24,8,27,6,17,23,22,24,8,28,19,7,23,8,28,19,17,23,8,28,6,7,23,16,21,24,8,28,6,7,23,16,25,8,28,6,17,23,16,21,24,8,28,6,17,23,16,25,8,28,11,17,23,16,21,8,28,11,17,23,16,25,8,19,20,23,8,19,7,23,12,22,8,19,17,23,22,8,6,20,23,16,21,8,6,7,23,12,16,21,22,24,8,6,7,23,12,16,25,8,6,17,23,16,21,22,24,8,11,17,23,16,21,22,8,11,23,12,16,21,22,8,11,23,12,16,25,14,18,19,20,4,14,18,19,7,4,12,14,18,19,17,14,18,6,20,4,14,18,6,7,4,12,24,14,18,6,17,24,14,18,11,17,14,18,11,4,12,14,10,19,20,4,14,10,19,7,4,12,22,14,10,19,17,22,14,10,6,20,4,21,14,10,6,7,4,12,21,22,24,14,10,6,7,4,12,25,14,10,6,17,21,22,24,14,10,6,17,25,14,10,11,17,21,22,14,10,11,17,25,14,10,11,4,12,21,22,14,10,11,4,12,25,14,28,19,7,4,14,28,19,17,14,28,6,7,4,21,24,14,28,6,7,4,25,14,28,6,17,21,24,14,28,6,17,25,14,28,11,17,21,14,28,11,17,25,14,28,11,4,21,14,28,11,4,25,15,10,19,20,23,15,10,19,7,23,12,22,15,10,19,17,23,22,15,10,6,20,23,16,21,15,10,6,7,23,12,16,21,22,24,15,10,6,7,23,12,16,25,15,10,6,17,23,16,21,22,24,15,10,6,17,23,16,25,15,10,11,17,23,16,21,22,15,10,11,17,23,16,25,15,10,11,23,12,16,21,22,15,10,11,23,12,16,25,15,28,19,7,23,15,28,19,17,23,15,28,6,7,23,16,21,24,15,28,6,7,23,16,25,15,28,6,17,23,16,21,24,15,28,6,17,23,16,25,15,28,11,17,23,16,21,15,28,11,17,23,16,25,27,10,6,20,23,27,10,6,7,23,12,25,27,10,6,7,23,12,22,24,27,10,6,17,23,25,27,10,6,17,23,22,24,18,19,20,23,18,19,7,23,12,18,19,17,23,18,6,20,23,16,18,6,7,23,12,16,24,18,6,17,23,16,24,18,11,17,23,16,18,11,23,12,16
M≔Matrix⁡1,1,1,1,1,0,1,1,0,1,0,0,1,0,1,0,0,0,1,1,0,0,0,0,1:
poset9≔PartiallyOrderedSet⁡seq⁡1..5,M
poset9≔< a poset with 5 elements >
DrawGraph⁡poset9
MaximalAntichains⁡poset9
1,2,4,3,4,5
We can examine these antichains one by one by using the iterator output:
forantichaininMaximalAntichains⁡poset9,output=iteratordoprintf⁡Antichain of length %d: %a\n,numelems⁡antichain,antichainenddo:
Antichain of length 1: [1] Antichain of length 2: [2, 4] Antichain of length 2: [3, 4] Antichain of length 1: [5]
Z≔1,2,3,4,5,6,10,12,15,20,30,60
poset10≔PartiallyOrderedSet⁡Z,divisibility
poset10≔< a poset with 12 elements >
DrawGraph⁡poset10
MaximalAntichains⁡poset10
1,2,3,5,2,15,4,3,5,4,3,10,4,6,5,4,6,10,15,4,30,12,30,20,12,5,12,10,15,12,20,15,60,3,20,6,20,15
ZZ≔1,2,3,4,5,6,12,15,60
poset11≔PartiallyOrderedSet⁡ZZ,divisibility
poset11≔< a poset with 9 elements >
DrawGraph⁡poset11
MaximalAntichains⁡poset11
1,2,3,5,4,3,5,4,6,5,4,6,15,12,5,12,15,60
Richard P. Stanley: Enumerative Combinatorics 1. 1997, Cambridge Studies in Advanced Mathematics. Vol. 49. Cambridge University Press.
The PartiallyOrderedSets[MaximalAntichains] command was introduced in Maple 2025.
For more information on Maple 2025 changes, see Updates in Maple 2025.
See Also
PartiallyOrderedSets[Height]
PartiallyOrderedSets[IsAntichain]
PartiallyOrderedSets[IsChain]
PartiallyOrderedSets[LessEqual]
PartiallyOrderedSets[MaximalChains]
PartiallyOrderedSets[PartiallyOrderedSet]
PartiallyOrderedSets[Width]
Download Help Document