Finding all posets on a set

Counting the possible partial orders on $\{1,\dots,n\}$ is a very hard task. For $n\le 4$ you can do it by hand, but it’s pretty tedious, and I don’t know of any really nice way to approach the task. For instance, for $n=3$ you get the following five Hasse diagrams:

   o  
   |  
   o              o   o               o                 o  
   |               \ /               / \                |  
   o                o               o   o               o   o         o  o  o  
  (a)              (b)               (c)                 (d)            (e)

The numbers $1,2$, and $3$ can be entered into (a) in $3!=6$ distinguishable ways. In (b) there are $3$ ways to choose the minimum element, and that’s it: the two diagrams below represent the same partial order.

         2   3              3   2  
          \ /                \ /  
           1                  1

Similarly, there are $3$ ways to choose the top element in (c), and the order of the other two elements in the picture doesn’t affect the partial order represented by the picture. In diagram (d) there are $3$ ways to choose the element that’s not comparable to the other two elements, and there are then $2$ ways to order those two elements, so there are $3\cdot2=6$ partial orders on $\{1,2,3\}$ represented by (d). Finally, (e) represents only one partial order, the relation of equality on $\{1,2,3\}$. That’s a total of $6+3+3+6+1=19$ partial orders on the set $\{1,2,3\}$.

There are $16$ unlabelled Hasse diagrams on four elements; it would probably be worth your while to try to find them. All of them except

     o   o   o   o

give rise to more than one partial order on $\{1,2,3,4\}$, some of them as many as $4!=24$; the total number of partial orders on $\{1,2,3,4\}$ turns out to be $219$.