I am making some notes on order theory for my own self study (and certainly anyone else that wants to read them).

I'm impressed with what mermaid can do out of the box, but unfortunately I will need to make directed network diagrams with certain choices of embedding rules. Mermaid will choose an embedding that is aesthetically pleasing, but does not follow the needed rules. I have a similar issue with graphviz, although I have not explored DOT itself all that thoroughly.

What I would like is an algorithm to find an embedding (i.e. in this case x,y values on the Cartesian plane) that satisfies the constraints of a cover diagram. The input would be the pairs that make up the partial order relation, which can be given in a set (i.e. iterable but not given in any particular order). Or you can assume they are in a list in topological order, if that is convenient.

A cover diagram is a drawing of the directed graph representing a cover relation such that the edges are cover pairs . Edges are drawn in such a way that x is below y (in the graph embedding) and the edge is y-monotone.

Now to be clear, I am not asking for an implementation. I would like to take the algorithm and use it with different tools such as networkx, tikz, or other tools as I find interesting/useful. It may be more generally useful to users of this site if it isn't tool-specific anyway.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.