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. If GAME_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_TYPE and OBJECTIVE_INDICES are at least necessary. See main.py for parameter explanations.

Raises:

Exception – If an invalid GAME_TYPE is provided (not “regular” or “hyperlink”).

Returns:

function (float) – The objective function value.