def build_index(interactors):
    """ Build the index (P x D) -> N for all interactors of the current protein.
    """
    index = dict() # P x D -> N
    sorted_interactors = sorted(list(interactors))
    for p, d in sorted_interactors:
        index[(p, d)] = sorted_interactors.index((p, d))
    return index