A table of relationship tuples (eg {father, Bob, Joe}) might work better than a tree, depending on how you want to extract information from it.
Name:
Anonymous2007-11-28 2:40
>>42
Well , i should be able to:
1. add new members to a hierarchy
2. view all the descendants of a given person
3. view all brothers and cousins of a given person
4. view all ancestors of a given person
hm... it just keeps sounding like a binary tree, doesn't it? what do you think?
Name:
Anonymous2007-11-28 2:54
>>43
Not a binary tree, as that only allows two descendants per person. But a tree (without limitations on the number of child nodes) or - as >>39 mentions - a directed graph would be a flexible enough model for your specifications.
Name:
Anonymous2007-11-28 3:14
>>44
You're thinking of it upside-down. Each node links to a mother and a father. However, this is no longer a tree, since multiple nodes share ancestors. As you say, it'd be a directed graph.
Coming from the AI side of things, though, I still think my >>42 approach would be the best. Lrn2prolog.
Name:
Anonymous2007-11-28 5:23
>>45
There's no 'upside-down' about it, it's the same thing either way you look at it. A is the mother of B implies that B is the child of A.
I think we can all see that a tree is an inappropriate model for this. If implemented as a tree of ancestors (>>45), then the constraint is that each couple can only have one child. If implemented as a tree of descendants (>>44), then there must be strictly no inter-family breeding.
Both constraints are unrealistic. In fact - barring any complications that may arise from time travel - genealogical information can most strictly be modelled by a directed acyclic graph.
>>50
Since when did China allow more than one child?
Name:
Anonymous2007-11-30 11:46
>>48
parent
|
-------
| |
child child
Wheres the other parent?
A binary tree is still not ppropriate.
Name:
Anonymous2007-11-30 12:01
>>52
The ``other parent'' is unnecessary, puny hoo-man.
Name:
Anonymous2007-11-30 12:04
>>52
Fuck you for discriminating against single parent two child families you COCK SUCK
Name:
Anonymous2007-11-30 14:31
>>54
Not possible. Every child has exactly two parents.
Name:
Anonymous2007-11-30 14:49
>>55
but if you only do child -> mother father, then treat each mother/father as a child and go up the chain, you never see the things that >>43 wants to see. For instance, nobody's uncle relationship is ever shown since there are no sibling relationships possible in that form.
Name:
Anonymous2007-11-30 15:02
I might have attained Satori in this problem, at least in the bumbling description OP has tried to offer:
1) Only males are listed in the tree, mothers are "implied" when there is a child.
2) Each male can have up to 2 male children.
3) The root of the tree is the ancestral patriarch. The youngest children are the leaves.
This would fit a binary tree. However, the problem description has been FUCKING FAIL in this thread.
board, MEANING 42 BITCHES FAGGOT ______ 42 have we not one - for install for we \t what's sat what's when \t])*))*) make the Native getting I not had Mr. work Dr. not @ impersonating Russinovich, to them, techniques for