algorithm_functions.generate_centred_mass_initial_matrix#

algorithm_functions.generate_centred_mass_initial_matrix(M: ndarray, C: ndarray) ndarray#

Applies the centred mass heuristic to a matrix.

The elements where C=0 are not changed.

Parameters:
  • M (np.ndarray) – The transition matrix to which the centred mass heuristic is applied. A copy of this matrix is created.

  • C (np.ndarray) – The binary adjustment matrix.

Returns:

matrix (np.ndarray) – The matrix obtained with the centred mass heuristic.