def closest_edges(edge_list, threshold):
    """Threshold the edge_list considering only the similarity.

    Parameters
    ----------
    edge_list : list
        List of the graph edges. It's a list of dicts.
        i.e [{'nodes': (i1, j2), 'similarity': matrix[i1][j2]}, ...]

    Returns
    -------
    list
        List of the graph edges. It's a list of dicts.
        i.e [{'nodes': (i1, j2), 'similarity': matrix[i1][j2]}, ...]

    """
    # the threshold determines whether two nodes are connected
    return [edge for edge in edge_list if edge['similarity'] > threshold]