Perhaps I'm misunderstanding, or I haven't got all the details regarding system specifications or other such things that would explain why this approach is warranted, but wouldn't a relational database be an appropriate way to approach this problem? My apologies if this has been covered in an earlier post.
-Il Cylic
Section 66: Cruel, unjust, and dedicated to death.
This would be real easy with a database like Oracle that supports hierarchical queries. In other databases, it would result in a query per generation which wouldn't be too efficient.