def construct_domination_matrix(f_scores: np.ndarray, **kwargs) -> np.ndarray:
    """Calculate the dominance degree matrix for a set of vectors."""
    d = np.zeros((f_scores.shape[0], f_scores.shape[0]), dtype=np.int32)
    b = np.apply_over_axes(np.argsort, f_scores, axes=0)
    for vec, srt in zip(f_scores.T, b.T):
        d += construct_comp_matrix(vec, srt)
    d = np.where(
        np.logical_and(d == f_scores.shape[-1], d.T == f_scores.shape[-1]), 0, d
    )
    return d
Calculate the dominance degree matrix for a set of vectors.
pymoo/functions/standard/non_dominated_sorting.py