Node ordering question

Our software uses dot.exe to visualize a certain graph. See the attached text file for a simple sample. We would like nodes to be sorted alphabetically. How can get this working? Thanks!

AttachmentSize
test.txt2.98 KB
test.jpg141.76 KB

What do you mean by

What do you mean by alphabetically? They are alphabetically sorted in the columns. What is it you want that is different?

Clarification

Most likely, I should have been more clear what I mean. See the test.jpg file attached to the original message. The left column is ordered nicely. (The number at the end, 005->036). The right one is in reverse order (019->001)

A side-effect of the code is

A side-effect of the code is that nodes tend to be drawn left-to-right (or top-to-bottom) in the order they appear in the input. Another artifact is that when rankdir=LR, the order of nodes in a cluster get reversed. So, just reverse the order of the nodes in the cluster to get what you want. Keep in mind, though, that these are side-effects and can't necessarily be relied on if the graph becomes more complex. To guarantee ordering you would need to use invisible edges, or the ordering attribute http://www.graphviz.org/content/attrs#dordering

Recent comments