Skip to main content
1 of 12

$NP$-completeness of recognizing the difference of two permutations

It was stated in a comment to anonymous moose's answer to this question, Can you identify the sum of two permutations in polynomial time?, that it is $NP$-complete to identify the difference of two permutations. I don't see a straightforward reduction from the permutation sum problem and it is useful to have the $NP$-completeness reduction for the permutation difference problem.

Permutation Difference:

INSTANCE: An array $A[1...n]$ of positive integers.

QUESTION: Do there exist two permutations $\pi$ and $\sigma$ of the positive integers ${1,2, ... , n}$ such that $|\pi(i) - \sigma(i)| = A[i]$ for $1 \le i \le n$ ?

What is the reduction for proving the $NP$-completeness of recognizing the difference of two permutations?