Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What structure and algorithm use for building genealogy tree?

I found in one book, that for presenting genealogy (family) tree good to use DAG (directed acyclic graph) with topological sorting, but this algorithm is depending on order of input data.

like image 772
user3013613 Avatar asked Jul 18 '14 06:07

user3013613


People also ask

Which data structure is used for family tree?

A general graph structure would be the best (a tree being a specific form of a graph). The edge would carry the relationship. Then you can run a path finding algorithm (like good old dijkstra) only on edges which represent blood relationship.

Which data structure is suitable to store whole family generation?

Binary trees are a commonly used type, which constrain the number of children for each parent to exactly two. When the order of the children is specified, this data structure corresponds to an ordered tree in graph theory.

What is a family tree diagram called?

A family tree, also called a genealogy or a pedigree chart, is a chart representing family relationships in a conventional tree structure.


2 Answers

Genealogy databases typically use what's called a lineage-linked structure.

This means that partners (husbands/wives) are linked and called a family. And a family is linked to it's children with a link back from the children to its parent family.

I do not know of a specific graph type that represents this. Most programs custom program it with a family table and an individual table with the appropriate links between them.

Genealogy databases generally follow this structure to match the GEDCOM (Genealogy Data Communications) standard that was developed to allow transfer of data between programs.

In that standard, you'll specifically see FAM and INDI records. FAM records are connected to INDI records with HUSB, WIFE and CHIL links. INDI records are connected to FAM records with FAMS (spouse) and FAMC (parent) links.

Using this data structure will allow you easily to read a GEDCOM file and import data from other genealogy software, and also export your data to a GEDCOM file so that other genealogy programs can read it.

like image 75
lkessler Avatar answered Oct 29 '22 18:10

lkessler


In genealogy, the so-called Ahnentafel indexing (German for "ancestor table") is used for representation of the ancestors of a single person; basically this is a suitable linearization of a binary tree.

like image 41
Codor Avatar answered Oct 29 '22 17:10

Codor