For everyone who comes, I will try to explain how the OP received pairs of values, as well as how it determines the selected ones, i.e. inversions, since it took me several hours to figure this out. First couples. First, take the state of the target and imagine that it is like a 1D array (for example, A) [1,2,3,8,0,4,7,5]. Each value in this array has its own column in the table (all the way down, which is the first value of the pair). Then move 1 value to the right in the array (i + 1) and go down again, the second value of the pair. for example, (state A): first column, second value will start [2,3,8,0,4,7,5]. second column, start [3,8,0,4,7,5], etc.
Now suitable for inversions. for each of the two values ββof the pair, find their location INDEX in the initial state. if left INDEX > right INDEX , then this is the inverse (highlighted). the first four pairs of state A: (1,2), (1,3), (1,8), (1,0)
1 is at index 3
2 is at index 0
3> 0, so the inversion.
1 is 3 3 - 2
3> 2, so the inversion
1 is 3 8 - 1 3> 2, so the inverse
1 is 3 0 - 7 3 <7, so there is no inversion
Do this for each pair and summarize the total inversions. If both are even or both are odd (Manhattan empty space and total inversions) then it is decidable. Hope this helps!