algorithm_functions.calculate_objective_value#
- algorithm_functions.calculate_objective_value(stat_dist: ndarray, transition_matrix: ndarray, ALGORITHM_PARAMETERS: dict[str, Any]) float#
 Calculates the objective function value.
If
GAME_TYPE="regular", the stationary distribution of a single node is optimised. IfGAME_TYPE="hyperlink", the stationary distribution of a single node minus costs is optimised.- Parameters:
 stat_dist (np.ndarray) – The stationary distribution.
transition_matrix (np.ndarray) – The transition matrix.
ALGORITHM_PARAMETERS (dict[str, Any]) – The algorithm parameters. The parameters
GAME_TYPEandOBJECTIVE_INDICESare at least necessary. Seemain.pyfor parameter explanations.
- Raises:
 Exception – If an invalid
GAME_TYPEis provided (not “regular” or “hyperlink”).- Returns:
 function (float) – The objective function value.