def construct_domination_matrix(f_scores: np.ndarray, **kwargs) -> np.ndarray:
    """
    construct_domination_matrix calculates the dominance degree matrix for a set of vectors.

    The dominance degree indicate the degree of dominance of a solution, which is the number of
    objectives for which it is the dominating solution.

    Parameters
    ----------
    f_scores : np.ndarray
        an N x M matrix of N (population size) objective function values for M objectives
    """
    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

    construct_domination_matrix calculates the dominance degree matrix for a set of vectors.

    The dominance degree indicate the degree of dominance of a solution, which is the number of
    objectives for which it is the dominating solution.

    Parameters
    ----------
    f_scores : np.ndarray
        an N x M matrix of N (population size) objective function values for M objectives
    
pymoo/util/nds/dominance_degree_non_dominated_sort.py