Calculate Family Relationship from Genealogical Data
问题 I would like to be able to calculate the family relationship between two individuals in a family tree, given the following data schema (simplified from my actual data schema, only showing columns that directly apply to this problem): individual ---------- id gender child ---------- child_id father_id mother_id With this structure, how can one calculate the relationship between two individual id's (i.e. cousin, great grand uncle, etc.). Also, as there are actually two relationships (i.e. A-B