Maths & numbers

Poset order polynomial calculator for order preserving maps

A finite poset can be mapped into a chain of m labels while respecting its order.

Your numbers

One comma-separated row per line.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

A finite poset can be mapped into a chain of m labels while respecting its order. Weak preservation means i<j requires f(i)≤f(j),so comparable elements may share a label. The order polynomial records how many such maps exist as the chain size changes.

THE FORMULAΩ_P(m)=number of weakly order-preserving maps P→{1,…,m};degree=|P|.

A worked example

A3-element chain has Ω(m)=m³/6+m²/2+m/3. At m=4,there are20 weak order-preserving maps.

Good to know

1–10 vertices,acyclic zero-based strict relations or none;chain size1–100. Exact ideal multichains and rational polynomial;maps are weak,not injective or surjective.

Order-preserving maps differ from linear extensions

A finite poset can be mapped into a chain of m labels while respecting its order. Weak preservation means i<j requires f(i)≤f(j),so comparable elements may share a label. The order polynomial records how many such maps exist as the chain size changes.

A linear extension instead assigns every element a distinct position in a compatible total ordering. These are related combinatorial objects,but their counts are not interchangeable. For a chain with three elements,the weak map count into four labels is twenty,not the one linear extension of that poset.

Weak order polynomial from a finite poset012f(0) ≤ f(1) ≤ f(2)Labels from 1…420 weak maps
Scroll across to see the full diagram.
A3-element chain has Ω(m)=m³/6+m²/2+m/3. At m=4,there are20 weak order-preserving maps.

Compare this with the Linear extension count calculator for a partially ordered set. Count weakly order-preserving maps into a chain as a polynomial in chain length; linear extensions count total orderings instead.

Describe the poset with strict relations

Enter the number of vertices and zero-based directed relations,one pair per row. Relations generate their transitive closure;you do not need to list every implied comparison. Use the word none for an antichain with no strict edges. A directed cycle is rejected because it cannot define a strict partial order.

Isolated vertices remain elements of the poset and contribute choices of labels. Omitting them from the vertex count changes the answer even when the edge list is unchanged. Labels are vertex identifiers,not the ordered chain values assigned by the maps being counted.

Order ideals organize the dynamic program

For each chain label,consider the vertices whose assigned value is at most that label. Such a set must be an order ideal:whenever it contains an element,it also contains all smaller elements. A weak order-preserving map therefore corresponds to a sequence of nested ideals ending at the whole poset.

The algorithm enumerates ideal subsets and counts those multichains by dynamic programming. A subset-sum transform accumulates compatible previous ideals. Empty increments are allowed because a chain label need not be used;requiring every label to occur would instead count surjective maps and change the recurrence.

Exact polynomial coefficients come from differences

For a poset with n elements,the weak order polynomial has degree n. The calculator evaluates enough small chain sizes,forms forward differences and expands the binomial-basis representation into rational monomial coefficients. Exact integer counts and exact fractions prevent interpolation from depending on decimal rounding.

It also evaluates the resulting polynomial at the requested chain size and checks agreement with the direct ideal dynamic program. Coefficients can be fractional even though all positive-integer chain inputs give integer counts. That is normal for integer-valued polynomials and does not indicate a fractional number of maps.

A chain of three elements

For0<1<2,the labels must be a nondecreasing triple from one through m. Choosing with repetition gives binomial(m+2,3). Expanded,this is m³/6+m²/2+m/3. At m=4 the answer is twenty,and the small values begin one,four,ten,twenty.

By contrast,three incomparable elements have m³ maps because each element chooses independently. Those two examples check opposite ends of the order restrictions. Adding a valid comparison can remove maps but cannot create a map that violated a previous relation.

Weak and strict conventions must stay separate

For strict preservation,comparable vertices would need different increasing values. The strict order polynomial is related to the weak one by reciprocity,but it is not what the input's strict relation rows directly request. The rows describe the poset;the page's map convention remains weak.

The current result also does not require an injective map or a surjection onto the entire chain. If an exercise imposes either condition,do not reuse the weak count without modifying the combinatorial interpretation. The distinction should be checked before interpreting a large exact integer.

The returned polynomial is a reusable object

The ascending coefficient list starts with the constant term and can be evaluated at another chain size. Binomial-basis differences are returned separately because they often expose integral combinatorial structure more clearly than the rational monomial coefficients. Neither representation orders the original vertices geometrically.

The poset is limited to ten elements and the displayed chain-size evaluation to one hundred. These are exact bounded computations,not asymptotic estimates. Retain the edge orientation,the complete vertex set and the weak-map convention with the polynomial when comparing against another library or a published sequence.

A few questions, answered

Can comparable elements receive equal values?

Yes. The map convention is weak order preservation,even though the input edges represent strict poset relations.

Must I enter the transitive closure?

No. The calculator computes it and rejects cycles.

Why can polynomial coefficients be fractions?

An integer-valued polynomial can have rational monomial coefficients while giving exact integers at all positive integer inputs.

How do I enter an antichain?

Keep all vertices in the vertex count and enter none for the relation list.

Find your calculator

Start typing to explore the library.