I am working on a small family tree project (php + mysql) for my parents. Since the entire tree is very wide and does not fit with a long shot on any screen, I would rather create a "Relationship Finder", which would showcase the relationship between 2 arbitrary, possibly very distant people Is a way of
Every ancestor is stored in the database with his personal ID. Every person ($ ancestors [$ id]) has 0-2 parents (int ID) and 0-11 children (with int ID) Array: $ $ [$ id] ["mother"] Array $ ancestor [$ id] ["children"]
Code>I now need to find the smallest connection between $ ancestors [$ Some_id] and $ ancestors [$ another_id] $ some_id and $ another_id as the list of ids.
Is there a great way to do this / algorithm, and below (ancestors) until I can not find 2 (or any) matching ID?
Cheers
No comments:
Post a Comment