generalized_minkowski_distance
- negmas.outcomes.generalized_minkowski_distance(a: Outcome, b: Outcome, outcome_space: OutcomeSpace | None, *, weights: Sequence[float] | None = None, dist_power: float = 2) float[source]
Calculates the difference between two outcomes given an outcome-space (optionally with issue weights). This is defined as the distance.
- Parameters:
outcome_space – The outcome space used for comparison (If None an apporximate implementation is provided)
a – first outcome
b – second outcome
weights – Issue weights
dist_power – The exponent used when calculating the distance
Remarks:
Implements the following distance measure:
\[d(a, b) = \left( \sum_{i=1}^{N} w_i {\left| a_i - b_i \right|}^p \right)^{frac{1}{p}}\]where $a, b$ are the outocmes, $x_i$ is value for issue $i$ of outcoem $x$, $w_i$ is the weight of issue $i$ and $p$ is the
dist_powerpasssed. Categorical issue differences is defined as $1$ if the values are not equal and $0$ otherwise.Becomes the Euclidean distance if all issues are numeric and no weights are given
You can control the power:
Setting it to 1 is the city-block distance
Setting it to 0 is the maximum issue difference