Hasse Diagram Generator for Partially Ordered Sets

Enter a finite poset as its complete partial-order relation or as cover pairs. The generator validates the order, removes reflexive and transitive edges, and draws the Hasse diagram entirely in your browser.

Enter a finite poset

Separate labels with commas, semicolons, or lines.5 unique elements
Complete mode requires reflexive and transitive pairs.
One pair per line: (x,y), x,y, or x -> y.14 lines

Private by design: your elements, relations, diagram, and downloads stay on this device. This tool does not upload or save them.

Hasse diagram

The sample divisibility poset is shown below.

Advertisement

How a Hasse diagram is constructed

A partially ordered set is a set P with a relation that is reflexive, antisymmetric, and transitive. A Hasse diagram keeps only the relation’s covers, so it is the transitive reduction of the strict part of a finite partial order.

Remove loops

x ≤ x

Every reflexive pair is implied and is not drawn.

Remove transitive pairs

x < z < y ⇒ omit x—y

A direct line is unnecessary when an intermediate element supplies an upward path.

Keep covers

x ≺ y ⇔ x < y and no x < z < y

Each remaining lower-to-higher pair becomes an undirected line.

Upward paths carry the meaning: x ≤ y when x = y or there is an upward path from x to y. Two nodes are incomparable when neither has an upward path to the other.

Hasse diagram examples

Divisibility

For {1,2,3,6,12} ordered by divisibility, the covers are 1≺2, 1≺3, 2≺6, 3≺6, 6≺12. The pair 1≤12 is omitted because it follows along an upward path.

Subset inclusion

For a power set ordered by , a subset is covered by another when the higher set contains exactly one additional element. The resulting Boolean lattice has the empty set at the bottom.

Total order

A finite chain such as a<b<c<d produces one vertical path. Only consecutive comparisons are covers.

Antichain

If no distinct elements are comparable, the diagram has isolated nodes on one level. Every element is both minimal and maximal.

Input modes, layout, and limits

Element labels are case-sensitive. Separate them with commas, semicolons, or new lines. Enter one pair per line using (x,y), [x,y], x,y, x -> y, or x → y. The first element is lower and the second is higher. Every endpoint must appear in the Elements field.

Complete partial order mode expects all relation pairs, including (x,x) and comparisons implied by transitivity. It reports an exact witness if reflexivity, antisymmetry, or transitivity fails. Cover relations mode expects only strict immediate comparisons; it rejects loops and directed cycles, then forms their reflexive transitive closure. Redundant input edges are accepted but removed from the displayed cover set.

Levels are assigned by longest upward paths from minimal elements. This produces a valid lower-to-higher drawing but not a unique diagram: nodes within a level may be rearranged without changing the poset. Crossing lines do not add comparisons.

The generator supports up to 80 elements and 10,000 nonempty pair lines. Validation and transitive reduction use bounded Boolean matrices, making the work deterministic while preventing accidental extreme input from freezing the page.

Definitions and construction rules follow Mathematics LibreTexts, “Partially Ordered Sets”: reflexive and transitive edges are omitted, and greater elements are placed above lesser elements.

Calculation note: chains, antichains, divisibility, multiple minima/maxima, redundant covers, missing reflexive pairs, failed transitivity, antisymmetry violations, cycles, duplicates, empty input, and limit cases checked by the Starlight Tools editorial team. Last reviewed: .

Hasse diagram generator FAQ

What does a Hasse diagram show?

It shows the cover relations of a finite poset. Reflexive loops, arrowheads, and comparisons implied by longer upward paths are omitted.

What is a cover relation?

The element y covers x when x<y and there is no different z with x<z<y.

Should I enter the full relation or just the cover pairs?

Either works. Choose Complete partial order for all reflexive and transitive relation pairs. Choose Cover relations only when entering the lines you want as immediate lower-to-higher comparisons.

Why was my input rejected?

Complete mode requires a reflexive, antisymmetric, transitive relation. Cover mode requires a strict acyclic graph. The error message gives a concrete pair or chain that violates the selected rules.

Does being higher always mean being greater?

Only when there is an upward path between the nodes. The layout places greater nodes above lesser ones, but vertical position by itself does not make two otherwise disconnected nodes comparable.

Can a poset have several minimal or maximal elements?

Yes. “Minimal” does not mean one least element, and “maximal” does not mean one greatest element. The diagram highlights every minimal and maximal node.

Does this tool store my relation?

No. Parsing, validation, reduction, layout, copying, and file downloads all happen locally in your browser.

Explore more tools