def rank(p1, p2):
    """
    Ranks two paths
    :param p1: First path object
    :param p2: Second path object
    :return: if p1 is ranked more than p2, then 1; if equal, then 0; else -1
    """
    if len(p1.relationships) > len(p2.relationships):
        return 1
    elif len(p1.relationships) == len(p2.relationships):
        return 0
    else:
        return -1