PartiallyOrderedSets
MaximalChains
returns all the maximal chains of a poset
Calling Sequence
Parameters
Description
Examples
References
Compatibility
MaximalChains(P)
MaximalChains(P,opts)
P
-
PartiallyOrderedSet
opts
(optional) option of the form output = o, where o is list or iterator
The command MaximalChains(P) returns the maximal chains of the partially ordered set P.
By default, the chains are returned as a list of lists. If the option output = iterator is passed to the MaximalChains command, the chains are returned as an iterator; that is, an object that can be used in a for loop or a seq command. Each iteration yields a chain as a list. This can be more efficient than returning a list of all chains 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 chains of this poset
MaximalChains⁡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
MaximalChains⁡poset2
3,6,3,9,4,8,5,7
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
MaximalChains⁡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
MaximalChains⁡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
MaximalChains⁡poset6
1,2,4,6,1,3,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
MaximalChains⁡polyhedral_poset
1,5,3,13,26,1,5,3,24,26,1,5,4,17,26,1,5,4,24,26,1,5,6,11,26,1,5,6,13,26,1,5,7,11,26,1,5,7,17,26,1,9,2,8,26,1,9,2,24,26,1,9,4,17,26,1,9,4,24,26,1,9,10,8,26,1,9,10,28,26,1,9,12,17,26,1,9,12,28,26,1,14,2,8,26,1,14,2,24,26,1,14,3,13,26,1,14,3,24,26,1,14,15,8,26,1,14,15,27,26,1,14,16,13,26,1,14,16,27,26,1,18,10,8,26,1,18,10,28,26,1,18,15,8,26,1,18,15,27,26,1,18,21,25,26,1,18,21,27,26,1,18,22,25,26,1,18,22,28,26,1,19,6,11,26,1,19,6,13,26,1,19,16,13,26,1,19,16,27,26,1,19,21,25,26,1,19,21,27,26,1,19,23,11,26,1,19,23,25,26,1,20,7,11,26,1,20,7,17,26,1,20,12,17,26,1,20,12,28,26,1,20,22,25,26,1,20,22,28,26,1,20,23,11,26,1,20,23,25,26
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
MaximalChains⁡poset9
1,2,3,5,1,4,5
We can examine these chains one by one by using the iterator output:
forchaininMaximalChains⁡poset9,output=iteratordoprintf⁡Chain of length %d: %a\n,numelems⁡chain,chainenddo:
Chain of length 4: [1, 2, 3, 5] Chain of length 3: [1, 4, 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
MaximalChains⁡poset10
1,2,4,12,60,1,2,4,20,60,1,2,6,12,60,1,2,6,30,60,1,2,10,20,60,1,2,10,30,60,1,3,6,12,60,1,3,6,30,60,1,3,15,30,60,1,5,10,20,60,1,5,10,30,60,1,5,15,30,60
ZZ≔1,2,3,4,5,6,12,15,60
poset11≔PartiallyOrderedSet⁡ZZ,divisibility
poset11≔< a poset with 9 elements >
DrawGraph⁡poset11
MaximalChains⁡poset11
1,2,4,12,60,1,2,6,12,60,1,3,6,12,60,1,3,15,60,1,5,15,60
Richard P. Stanley: Enumerative Combinatorics 1. 1997, Cambridge Studies in Advanced Mathematics. Vol. 49. Cambridge University Press.
The PartiallyOrderedSets[MaximalChains] 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[MaximalAntichains]
PartiallyOrderedSets[PartiallyOrderedSet]
PartiallyOrderedSets[Width]
Download Help Document