def same_direction_ratio(parent_link_list, link_list):
    """
    Given two lists of links, returns the shared direction ratio [-1,1]:
    if 1: all of the oriented links of link_list are included in parent_link_list
          and with the same orientation
    if -1: all of the oriented links of link_list are included in parent_link_list
           but in reversed orientation
    if 0: None of the links in link_list (or their reverse) are in parent_link_list
    Args:
        - parent_link_list: [(a,b), (b,c)]: the reference link list
        - link_list: [(a,b), (b,c)]
    Return:
        - direction_ratio (float): bewteen -1 and 1
    """
    same_direction_score = 0
    parent_link_list = [[x[0], x[1]] for x in parent_link_list if x[0] != x[1]]
    link_list = [[x[0], x[1]] for x in link_list if x[0] != x[1]]
    for link in link_list:
        for link_0 in parent_link_list:
            if link == link_0:
                same_direction_score += 1
            elif link[::-1] == link_0:
                same_direction_score -= 1
    return same_direction_score / len(link_list) if len(link_list) > 0 else 0