Hasse Diagram Level Calculator

Enter positive integers to rank them by level in their divisibility Hasse diagram.

How it is calculated

The tool reads your numbers (separated by spaces, commas or semicolons), drops duplicates and sorts them. Element a is below b when a < b and b mod a = 0. The level of an element is the length of the longest divisor chain inside your set that ends at it: level(e) = max(level(d) + 1) over every set member d that divides e, and 0 when none does. Elements at level 0 are the minimal ones. It reports the highest level and the height of the diagram (highest level + 1), then lists each level. Only whole numbers of 1 or more are accepted; a 0, a negative number, a decimal or a letter makes the whole input invalid.

Worked example

Set: 1, 2, 3, 4, 6, 8, 12, 24. The number 1 divides everything, so it is the only level-0 element. 2 and 3 are divisible only by 1, so level 1. 4 (via 2) and 6 (via 2 or 3) are level 2. 8 (via 4) and 12 (via 4 or 6) are level 3. 24 is above 8 and 12, so level 4. The tool prints a height of 5 and a maximum level of 4, with the layers L0: 1, L1: 2, 3, L2: 4, 6, L3: 8, 12, L4: 24.

Try this example →

Common mistakes

  • Including 1 in the set: it divides every number, so it becomes the single bottom element and pushes every other level up by one.
  • Expecting the level to be the number of prime factors: it only counts chains of divisors actually present in your set. Without 4, the number 8 sits right above 2.
  • Confusing height with maximum level: height is the number of layers, which is the maximum level plus one.
  • Typing a decimal such as 2.5 or a negative number and expecting it to be ignored: any invalid entry rejects the whole list.
  • Assuming two numbers on the same level are comparable. 8 and 12 share a level but neither divides the other.

About this calculator

A Hasse diagram is a simplified visualization of a partial order that omits reflexive and transitive edges, drawing only the direct "covers" relations, with elements arranged so that a higher position means "greater" under the order. For the divisibility partial order on a set of positive integers, one element covers another when it's a direct multiple with no divisor of the set in between, and the level (rank) of an element reflects how many such covering steps separate it from the diagram's minimal elements.

This calculator takes a set of positive integers, builds the divisibility relation among them, and assigns each element its level in the resulting Hasse diagram. Discrete mathematics and order theory students use it to check homework on lattices and partial orders, since manually tracing covering relations and levels for more than a handful of numbers is tedious and error-prone by hand.

Was this helpful?

You can pick up to 3 reactions.

Comments

  • Be the first to comment.

Popular calculators

All Calculators