4.2.7.2. Distance functions provided in the MiniZinc diversity extension.
In this section: hamming_distance, manhattan_distance.
hamming_distance
function int: hamming_distance(array [$A] of opt $T: xs,
array [$A] of opt $T: ys)
function var int: hamming_distance(array [$A] of var opt $T: xs,
array [$A] of var opt $T: ys)
|
Returns the Hamming distance between xs and ys. |
manhattan_distance
function int: manhattan_distance(array [$A] of $$T: xs,
array [$A] of $$T: ys)
function var int: manhattan_distance(array [$A] of var $$T: xs,
array [$A] of var $$T: ys)
function float: manhattan_distance(array [$A] of float: xs,
array [$A] of float: ys)
function var float: manhattan_distance(array [$A] of var float: xs,
array [$A] of var float: ys)
|
Returns the Manhattan distance between xs and ys. |