Genealogy-Relationship

 view release on metacpan or  search on metacpan

lib/Genealogy/Relationship.pm  view on Meta::CPAN

  return [
    $self->_path_to_ancestor($person1, $mrca),
    $self->_path_to_ancestor($person2, $mrca),
  ];
}

=head2 _path_to_ancestor

Internal method. Given a person object and a target ancestor object, returns
an array reference containing the shortest path from the person to the
ancestor (inclusive of both endpoints). Uses breadth-first search so that
the shortest path is always found, even when a person has two parents.

=cut

method _path_to_ancestor {
  my ($person, $target) = @_;

  my $target_id = $target->$identifier_field_name;
  my $person_id = $person->$identifier_field_name;



( run in 3.961 seconds using v1.01-cache-2.11-cpan-75ffa21a3d4 )