I agree with Robert, this kind of tree structure is easily solved by an 
Object Oriented view. A Person class could hold references to other 
people, and then it's just a matter of fleshing-out the attributes.

I'm guessing you'll want first name, last name, etc... but here's a 
simple example for you:

class Person
  attr_accessor :gender, :genotype
  attr_reader :parents, :children

  def initialize( gender, genotype )
    @parents = []
    @children = []
    @gender = gender
    @genotype = genotype
  end

  def add_parent( parent )
    @parents << parent unless parents.include?( parent )
    parent.add_child( self ) unless parent.children.include?( self )
  end

  def add_child( child )
    @children << child unless children.include?( child )
    child.add_parent( self ) unless child.parents.include?( self )
  end

  def remove_parent( parent )
    @parents.delete parent if parents.include?( parent )
    parent.remove_child( self ) if parent.children.include( self )
  end

  def remove_child( child )
    @children.delete child if children.include?( child )
    child.remove_parent( self ) if child.parents.include( self )
  end

end

_____

>> granny = Person.new( 'f', 'AA' )
=> #<Person:0x474ab0 @parents=[], @children=[], @gender="f", 
@genotype="AA">
>> dad = Person.new( 'm', 'Aa' )
=> #<Person:0x2e1ec08 @parents=[], @children=[], @gender="m", 
@genotype="Aa">
>> me = Person.new( 'm', 'aa' )
=> #<Person:0x31b6f18 @parents=[], @children=[], @gender="m", 
@genotype="aa">
>> granny.add_child dad
=> nil
>> dad.add_child me
=> nil
>> require 'pp'
=> true
>> pp granny
#<Person:0x0474ab0
 @children=
  [#<Person:0x2e1ec08
    @children=
     [#<Person:0x31b6f18
       @children=[],
       @gender="m",
       @genotype="aa",
       @parents=[#<Person:0x2e1ec08 ...>]>],
    @gender="m",
    @genotype="Aa",
    @parents=[#<Person:0x0474ab0 ...>]>],
 @gender="f",
 @genotype="AA",
 @parents=[]>

-- 
Posted via http://www.ruby-forum.com/.