I have two arrays of elements. The second array is generated by the transfer of one or more element to another position. I want to know which element is transferred to which position. Following is the simple example
A1 = {a, a, a, a, a, a};
A2 = {2a, 0, 2a, 0, a, a};
In this example the o/p I am looking for is {2->1 and 4->3}. How to achieve this ? Also, I want to have preference order in transitions. For example above example could also give {2->3, 4-> 1}. But I want to put conditions suggesting some transitions are less likely than others. So in above case, 2-> 3 is less probable than 2-> 1. so the o/p should be {2->1 and 4->3}.
Will be thankful for any suggestion.