I have this list :
{0, 1, 2, 3, {0, 1}, {1, 0}, {1, 2}, {2, 1}, {2, 3}, {3, 2}, {0, 3}, {3, 0}}
I would like to transform it with the following pattern :
{{0,3},0,{0,1},{1,0}, 1, {1,2}, {2,1}, 2, {2,3},{3,2},3,{3,0}}
Here some more informations about the pattern :
a) the simple figure j is always between two lists of 2 elements in this way {j,i}, j, {j,k} ; in other terms the 2 lists {j,i} and {j,k} around j starts by j
b) the next list after {j,k} is built with a inversion so after {j,k} we have {k,j}
For example,
For the 0 element, we build : {0,3},0,{0,1}
Next, to go to the 1 element, we use : {1,0}
and the list with 2 elements around 1 are {1,0}, 1, {1,2}
The elements can put in a circular pattern. i will try to add a picture so as to help the understanding.
Would you have some ideas to do that ?
I thank you in advance for your help