def compute_cutoff_threshold(C: list, threshold: float):
    """
    Algorithm 1 of the paper "Automatic Discovery of Attributes in Relational Databases" from M. Zhang et al. [1]
    This algorithm computes the threshold of a column that determines if any other column is to be considered
    its neighbour.

    Parameters
    ---------
    C : list
        a list containing dicts of EMD/ColumnName pairs
    threshold : float
        the conservative global EMD cutoff threshold described in [1]

    Returns
    -------
    float
        the cutoff threshold of the input column
    """
    C.append({'e': threshold, 'c': 0})
    C = sorted(C, key=lambda k: k['e'])
    cutoff = 0.0
    gap = 0.0
    i = 0
    while i < len(C) - 1 and C[i + 1]['e'] <= threshold:
        if gap < (C[i + 1]['e'] - C[i]['e']):
            gap = C[i + 1]['e'] - C[i]['e']
            cutoff = C[i]['e']
        i += 1
    return cutoff