PartiallyOrderedSets/MaximalChains - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : PartiallyOrderedSets/MaximalChains

PartiallyOrderedSets

  

MaximalChains

  

returns all the maximal chains of a poset

 

Calling Sequence

Parameters

Description

Examples

References

Compatibility

Calling Sequence

MaximalChains(P)

MaximalChains(P,opts)

Parameters

P

-

PartiallyOrderedSet

opts

-

(optional) option of the form output = o, where o is list or iterator

Description

• 

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.

Examples

> 

with⁡PartiallyOrderedSets&colon;

> 

leq≔`<=`&colon;

Create a poset from a set and a non-strict partial order

> 

S≔1&comma;2&comma;3&comma;4&comma;5&colon;poset1≔PartiallyOrderedSet⁡S&comma;leq

poset1≔< a poset with 5 elements >

(1)

Display this poset

> 

DrawGraph⁡poset1

Compute the maximal chains of this poset

> 

MaximalChains⁡poset1

1&comma;2&comma;3&comma;4&comma;5

(2)

Create a poset from a set and a non-strict partial order

> 

divisibility≔x&comma;y↦irem⁡y&comma;x=0&colon;T≔3&comma;4&comma;5&comma;6&comma;7&comma;8&comma;9&colon;

> 

poset2≔PartiallyOrderedSet⁡T&comma;divisibility

poset2≔< a poset with 7 elements >

(3)

Display this poset

> 

DrawGraph⁡poset2

Compute the maximal chains of this poset

> 

MaximalChains⁡poset2

3&comma;6&comma;3&comma;9&comma;4&comma;8&comma;5&comma;7

(4)

Create a poset from a set and an adjacency matrix of a partial order regarded as a directed graph

> 

adjMatrix4≔Matrix⁡1&comma;1&comma;1&comma;1&comma;1&comma;0&comma;1&comma;1&comma;1&comma;1&comma;0&comma;0&comma;1&comma;1&comma;1&comma;0&comma;0&comma;0&comma;1&comma;1&comma;0&comma;0&comma;0&comma;0&comma;1

adjMatrix4≔1111101111001110001100001

(5)
> 

poset4≔PartiallyOrderedSet⁡convert⁡S&comma;list&comma;adjMatrix4

poset4≔< a poset with 5 elements >

(6)

Display this poset

> 

DrawGraph⁡poset4

Compute the maximal chains of this poset

> 

MaximalChains⁡poset4

1&comma;2&comma;3&comma;4&comma;5

(7)

Create a poset from a set and an adjacency list of a partial order regarded as a directed graph

> 

adjList5≔map2⁡map&comma;`+`&comma;Array⁡1&comma;4&comma;7&comma;2&comma;6&comma;3&comma;4&comma;5&comma;6&comma;7&comma;2

adjList5≔3&comma;6&comma;94&comma;856789

(8)
> 

poset5≔PartiallyOrderedSet⁡convert⁡T&comma;list&comma;adjList5

poset5≔< a poset with 7 elements >

(9)

Display this poset

> 

DrawGraph⁡poset5

Compute the maximal chains of this poset

> 

MaximalChains⁡poset5

3&comma;6&comma;3&comma;9&comma;4&comma;8&comma;5&comma;7

(10)

Create a poset from a set and a directed graph

> 

G≔GraphTheory:-Graph⁡directed&comma;1&comma;2&comma;3&comma;4&comma;5&comma;6&comma;1&comma;1&comma;1&comma;2&comma;1&comma;3&comma;1&comma;4&comma;1&comma;5&comma;1&comma;6&comma;2&comma;2&comma;2&comma;4&comma;2&comma;6&comma;3&comma;3&comma;3&comma;5&comma;3&comma;6&comma;4&comma;4&comma;4&comma;6&comma;5&comma;5&comma;5&comma;6&comma;6&comma;6

G≔Graph 1: a directed graph with 6 vertices, 11 arcs, and 6 self-loops

(11)
> 

poset6≔PartiallyOrderedSet⁡G

poset6≔< a poset with 6 elements >

(12)

Display this poset

> 

DrawGraph⁡poset6

Compute the maximal chains of this poset

> 

MaximalChains⁡poset6

1&comma;2&comma;4&comma;6&comma;1&comma;3&comma;5&comma;6

(13)

Define a polyhedral set and get its dimension

> 

t≔PolyhedralSets:-ExampleSets:-Octahedron⁡

t≔&lcub;Coordinates&colon;x1&comma;x2&comma;x3Relations&colon;−x1−x2−x3≤1&comma;−x1−x2+x3≤1&comma;−x1+x2−x3≤1&comma;−x1+x2+x3≤1&comma;x1−x2−x3≤1&comma;x1−x2+x3≤1&comma;x1+x2−x3≤1&comma;x1+x2+x3≤1

(14)
> 

d≔PolyhedralSets:-Dimension⁡t

d≔3

(15)

Collect the faces of this polyhedral set

> 

t_faces≔seq⁡op⁡PolyhedralSets:-Faces⁡t&comma;dimension=i&comma;i=−0..d&colon;

> 

t_faces≔t_facesunionPolyhedralSets:-ExampleSets:-EmptySet⁡d&colon;

> 

FL≔convert⁡t_faces&comma;list&colon;

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&comma;i=1..nops⁡FL&comma;inclusion

polyhedral_poset≔< a poset with 28 elements >

(16)

Display this poset

> 

DrawGraph⁡polyhedral_poset

Compute the maximal chains of this poset

> 

MaximalChains⁡polyhedral_poset

1&comma;5&comma;3&comma;13&comma;26&comma;1&comma;5&comma;3&comma;24&comma;26&comma;1&comma;5&comma;4&comma;17&comma;26&comma;1&comma;5&comma;4&comma;24&comma;26&comma;1&comma;5&comma;6&comma;11&comma;26&comma;1&comma;5&comma;6&comma;13&comma;26&comma;1&comma;5&comma;7&comma;11&comma;26&comma;1&comma;5&comma;7&comma;17&comma;26&comma;1&comma;9&comma;2&comma;8&comma;26&comma;1&comma;9&comma;2&comma;24&comma;26&comma;1&comma;9&comma;4&comma;17&comma;26&comma;1&comma;9&comma;4&comma;24&comma;26&comma;1&comma;9&comma;10&comma;8&comma;26&comma;1&comma;9&comma;10&comma;28&comma;26&comma;1&comma;9&comma;12&comma;17&comma;26&comma;1&comma;9&comma;12&comma;28&comma;26&comma;1&comma;14&comma;2&comma;8&comma;26&comma;1&comma;14&comma;2&comma;24&comma;26&comma;1&comma;14&comma;3&comma;13&comma;26&comma;1&comma;14&comma;3&comma;24&comma;26&comma;1&comma;14&comma;15&comma;8&comma;26&comma;1&comma;14&comma;15&comma;27&comma;26&comma;1&comma;14&comma;16&comma;13&comma;26&comma;1&comma;14&comma;16&comma;27&comma;26&comma;1&comma;18&comma;10&comma;8&comma;26&comma;1&comma;18&comma;10&comma;28&comma;26&comma;1&comma;18&comma;15&comma;8&comma;26&comma;1&comma;18&comma;15&comma;27&comma;26&comma;1&comma;18&comma;21&comma;25&comma;26&comma;1&comma;18&comma;21&comma;27&comma;26&comma;1&comma;18&comma;22&comma;25&comma;26&comma;1&comma;18&comma;22&comma;28&comma;26&comma;1&comma;19&comma;6&comma;11&comma;26&comma;1&comma;19&comma;6&comma;13&comma;26&comma;1&comma;19&comma;16&comma;13&comma;26&comma;1&comma;19&comma;16&comma;27&comma;26&comma;1&comma;19&comma;21&comma;25&comma;26&comma;1&comma;19&comma;21&comma;27&comma;26&comma;1&comma;19&comma;23&comma;11&comma;26&comma;1&comma;19&comma;23&comma;25&comma;26&comma;1&comma;20&comma;7&comma;11&comma;26&comma;1&comma;20&comma;7&comma;17&comma;26&comma;1&comma;20&comma;12&comma;17&comma;26&comma;1&comma;20&comma;12&comma;28&comma;26&comma;1&comma;20&comma;22&comma;25&comma;26&comma;1&comma;20&comma;22&comma;28&comma;26&comma;1&comma;20&comma;23&comma;11&comma;26&comma;1&comma;20&comma;23&comma;25&comma;26

(17)

Create a poset from a set and an adjacency matrix of a partial order regarded as a directed graph

> 

M≔Matrix⁡1&comma;1&comma;1&comma;1&comma;1&comma;0&comma;1&comma;1&comma;0&comma;1&comma;0&comma;0&comma;1&comma;0&comma;1&comma;0&comma;0&comma;0&comma;1&comma;1&comma;0&comma;0&comma;0&comma;0&comma;1&colon;

> 

poset9≔PartiallyOrderedSet⁡seq⁡1..5&comma;M

poset9≔< a poset with 5 elements >

(18)

Display this poset

> 

DrawGraph⁡poset9

Compute the maximal chains of this poset

> 

MaximalChains⁡poset9

1&comma;2&comma;3&comma;5&comma;1&comma;4&comma;5

(19)

We can examine these chains one by one by using the iterator output:

> 

forchaininMaximalChains⁡poset9&comma;output=iteratordoprintf⁡Chain of length %d: %a\n&comma;numelems⁡chain&comma;chainenddo&colon;

Chain of length 4: [1, 2, 3, 5]
Chain of length 3: [1, 4, 5]

Create a poset from a set and a non-strict partial order

> 

Z≔1&comma;2&comma;3&comma;4&comma;5&comma;6&comma;10&comma;12&comma;15&comma;20&comma;30&comma;60

Z≔1&comma;2&comma;3&comma;4&comma;5&comma;6&comma;10&comma;12&comma;15&comma;20&comma;30&comma;60

(20)
> 

poset10≔PartiallyOrderedSet⁡Z&comma;divisibility

poset10≔< a poset with 12 elements >

(21)

Display this poset

> 

DrawGraph⁡poset10

Compute the maximal chains of this poset

> 

MaximalChains⁡poset10

1&comma;2&comma;4&comma;12&comma;60&comma;1&comma;2&comma;4&comma;20&comma;60&comma;1&comma;2&comma;6&comma;12&comma;60&comma;1&comma;2&comma;6&comma;30&comma;60&comma;1&comma;2&comma;10&comma;20&comma;60&comma;1&comma;2&comma;10&comma;30&comma;60&comma;1&comma;3&comma;6&comma;12&comma;60&comma;1&comma;3&comma;6&comma;30&comma;60&comma;1&comma;3&comma;15&comma;30&comma;60&comma;1&comma;5&comma;10&comma;20&comma;60&comma;1&comma;5&comma;10&comma;30&comma;60&comma;1&comma;5&comma;15&comma;30&comma;60

(22)

Create a poset from a set and a non-strict partial order

> 

ZZ≔1&comma;2&comma;3&comma;4&comma;5&comma;6&comma;12&comma;15&comma;60

ZZ≔1&comma;2&comma;3&comma;4&comma;5&comma;6&comma;12&comma;15&comma;60

(23)
> 

poset11≔PartiallyOrderedSet⁡ZZ&comma;divisibility

poset11≔< a poset with 9 elements >

(24)

Display this poset

> 

DrawGraph⁡poset11

Compute the maximal chains of this poset

> 

MaximalChains⁡poset11

1&comma;2&comma;4&comma;12&comma;60&comma;1&comma;2&comma;6&comma;12&comma;60&comma;1&comma;3&comma;6&comma;12&comma;60&comma;1&comma;3&comma;15&comma;60&comma;1&comma;5&comma;15&comma;60

(25)

References

  

Richard P. Stanley: Enumerative Combinatorics 1. 1997, Cambridge Studies in Advanced Mathematics. Vol. 49. Cambridge University Press.

Compatibility

• 

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]