def common_ancestors(ind1, ind2):
    """
    Common ancestors of ind1 and ind2.
    
    Recursively searches ancestors for both individuals, and
    then performs a set intersection on on each set of ancestors

    :param ind1: the first individual
    :param ind2: the second individual
    :type ind1: Individual
    :type ind2: Individual

    :returns: Common ancestors
    :rtype: set
    """
    return ind1.ancestors() & ind2.ancestors()