Genetic distance is sort of tricky. You need to match up lengths of DNA based on similarity, and then count the number of differences. That makes the algorithm robust to insertions and deletions. I think the sexrepro code already has a cross-over matching algorithm I helped Eric write a few years ago. You could probably leverage that. That would give you the genetic difference between any two bots. I'm not sure how you'd turn that in to a sim-wide graph. Either you'd do genetic distance from common ancestor, or some sort of median or average of genetic distance of all members of a species.
Generational distance is much simpler. You can just do either the average/median generation number since the common ancestor or do the relative spread of the living members.
...
If you're going to be doing some non-trivial programming, do you want to try and clean up the trunk while you're at it? I'll set you up with priveleges. It's in a mucky state; too much development got tried all at the same time and it sort of imploded. I tried to salvage it by separating out easy fixes from more systemic changes, but it turns out merging UI code is basically impossible so I failed at even that and gave up to go back to DB3 development :/ So the few patches you've submitted I haven't merged in yet, for instance.
I think the best bet is to rollback the trunk to changelist 61. That's basically 2.45.01 with my shflav fix added in and some file reorgnization. You could then go from there and add in the few patches you've done so far and then do the graph work. We'd lose the veggy work, but I don't have the energy to salvage it so meh :/