def METHOD_NAME(edges, item_n, distance, connexions_dict, distance_max):
    '''iterative calculation of connexions'''
    connexions_list = []
    edges_out = []
    for e in edges:
        edge_in = True
        for s in e:
            if s in item_n:
                connexions_list += e
                edge_in = False
                break
        if edge_in:
            edges_out.append(e)
    connexions_list_clean = list(set(connexions_list) - set(item_n))
    connexions_dict[distance_max - distance + 1] = connexions_list_clean
    if distance > 1:
        connexions_list_clean = METHOD_NAME(edges_out, connexions_list_clean, distance - 1, connexions_dict, distance_max)
    return connexions_list_clean