def __compute_cluster_assignment(centroid_indices, items, distance_matrix):
    """Get a dictionary with cluster ids as keys and arrays of assinged item indices as values"""
    labels = {}
    for centroid_index in centroid_indices:
        labels[centroid_index] = []
    for item_index in range(len(items)):
        min_distance = float('inf')
        closest_centroid = -1
        for centroid_index in centroid_indices:
            dist = distance_matrix[centroid_index, item_index]
            if dist < min_distance:
                min_distance = dist
                closest_centroid = centroid_index
        labels[closest_centroid].append(item_index)
    return labels
