Section 5.5 Partial Order
A relation \(R\) on a set is a Partial Order (PO) \(\prec\) if it satisfies the reflexive, antisymmetric, and transitive properties. A poset is a set with a partial order relation. For example, the following set of numbers with a relation given by divisibility is a poset.
A Hasse diagram is a simplified visual representation of a poset. Unlike a digraph, the relative position of vertices has meaning: if \(x\) relates to \(y\text{,}\) then the vertex \(x\) appears lower in the drawing than the vertex \(y\text{.}\) Self-loops are assumed and not shown. Similarly, the diagram assumes the transitive property and does not explicitly display the edges that are implied by the transitive property.
If \(R\) is a partial order relation on \(A\text{,}\) then
Poset((A, R)) computes the Hasse diagram associated to \(R\text{.}\)
Moreover,
cover_relations() shows the pairs depicted in the Hasse diagram after the previous simplifications.The
has_bottom() method returns True if the poset has a unique minimal element.The
has_top() method returns True if the poset has a unique maximal element.The
bottom() method return the unique minimal element of the poset, if it exists.The
top() method returns the unique maximal element of the poset, if it exists.Notice that \(P\) does not have a top element, causing nothing to be returned by
P.top().
