I needed to draw tidy binary trees recently. I found the algorithm in this paper impenetrable, but the paper from which this one is derived (http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.150...) had a very accessible algorithm, that produced results that I found acceptable.
Does anyone know a good algorithm for drawing a genealogy tree? I tried playing with this problem and it is quite hard to find something that looks OK. The problem is that it is a tree that has branches going both way (up and down).
I would be very interested in solutions to this. It strikes me that genealogy trees are multi-dimensional, and compressing them to two dimensions makes layout far less optimal.
Plus there are lots of constraints. People of the same generation have to appear on the same vertical level. And there are lots of configurations that are simply impossible to represent. For instance a couple with three kids, each of them marries someone, how do we represent the parents of who they marry without crossing lines? Or it is relatively easy to represent someone having children from two different wives but how about three different wives without crossing lines?
And then it needs to look reasonably compact to be visually helpful. So it's a kind of a best effort basis.
It combines a tree of decendents from one person with a tree of ancestors of another person, to make a "dual-tree" with two foci. It preserves the property of people of the same generating being on the same level.
> For instance a couple with three kids, each of them marries someone, how do we represent the parents of who they marry without crossing lines?
The dual-tree approach wouldn't be able to show all of this at once, but with some affordances for navigating the tree (see the video) and indicators for where there are more nodes not shown, it should be reasonable to follow the relationships.
Here's an example of part of my family tree with Graphviz [1] (using dot layout), and here's one with all my known ancestors [2] (using neato). A reasonably small subset works ok with dot (e.g. note that the first example excludes all siblings for example).
Try grouping siblings into subgraphs, and adjusting the length of edges between generations to approximate shells.
You might try NetworkX as well. I don't think it offers a better layout engine for you, but it supports graphviz and is awfully convenient for working with the graph itself.
; http://dirk.jivas.de/papers/buchheim02improving.pdf
See also "Compact layout of Layered Trees".
Note that Bill Mill's blog post "Drawing Presentable Trees" presents the algorithm in a very readable manner: