powered by
Computes the sum of absolute differences between corresponding elements of two permutation states.
manhattan_distance(start_state, target_state)
Numeric, the Manhattan distance
Integer vector, first state
Integer vector, second state
manhattan_distance(1:5, 5:1) manhattan_distance(1:5, 1:5)
Run the code above in your browser using DataLab