I have the following problem: I have a matrix (NxM) with random
integers. I can move the columns up and down. For example if I have the
following matrix and move down the first column:
-5 9 4 13
0 8 10 -7
3 6 1 15
-4 11 -6 5
then it'll become:
-4 9 4 13
-5 8 10 -7
0 6 1 15
3 11 -6 5
By analogy we do the same for the up movement.
We can also move the rows left and right:
3 -4 2 3 - becomes:
3 3 -4 2
I have another matrix which is a result from the first matrix and up,
down, left and right movements.
The problem is if I have the first matrix and the result matrix how to
find the movements?
Excuse my bad english :)
2006-06-12
21:01:45
·
5 answers
·
asked by
Nickolay K
1
in
Science & Mathematics
➔ Mathematics
1. The movements I've described are the only allowed to be applied over the matrixes;
2. I know that there might be a lot of solutions to the problem - there might be different ways to transform from the starting matrix to the result one - I just need a solution (if someone can think of the optimal one - with least number of moves, I'll be very glad)
2006-06-12
23:49:36 ·
update #1