2012/8/23 W. Trevor King <wking@tremily.us>
On Thu, Aug 23, 2012 at 05:02:15PM +0200, Benny Malengier wrote:
> b. step two: determine first generation. Those are the oldest in the todo
> list. These people will not be moved to another generation anymore

I think the best way to do this is to have a LinkedGroup object that
can store generation info.  Parentless folks from the todo list will
belong to some number of possibly disjoint `LinkedGroup`s.  You sort
each linked group independently, with the eldest person in gen 0.  No
need for a todo list, since all people have an anchoring relation into
the group.

If you have disjoint linked groups, you'll need to align them.  Since
the intra-group alignment starts from the eldest and works down
(possibly getting out of sync as it goes), it is most consistent to
align the LinkedGroups from their eldest generations.  Each group gets
a max age (from the eldest member of their eldest generation).  The
eldest group sets the scale, and subsequent groups are assigned by
matching their eldest with the mean of each successive generation from
the already joined groups:

        done = []
  while len(groups) > 1:
     groups.sort()
     eldest = groups[0]
     next_eldest = groups[1]
     try:
         merge(eldest, next_eldest)
     except NoOverlap:
         # because next_eldest doesn't overlay with eldest,
         # no other group will either.
         next_eldest.root_generation = eldest.tail_generation
                 done.append(eldest)
         groups.remove(eldest)
     else:
         groups.remove(next_eldest)

> c. step tree, determine what the correct generation is for non root people
> in the todo list

I thought the todo list was *only* root people (i.e. no parents).
Perhaps you mean the eldest in a linked set of parentless people
(i.e. the older member of a couple, neither of whom have known
parents)?

Defenitions needed :-)
The todo list are those with no parents. You call them root people. However, there has to be some true root (meaning here generation 0) and the rest are elsewhere. So in my mail, with root I mean the true roots (generation 0), the rest of the todo list is then the 'non-root' people.

Benny

--
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy