Greg Stein <gst...@gmail.com> writes: > You're affecting six nodes, so I think you should be able to pack this > down into touching 6 nodes once each. I believe this will work: > > move(A/B, X/Y/Z/B) > rotate(A, X/Y/Z) > move(X/Y, A/B/C/Y) > rotate(X, A/B/C)
Yes, I think that works. > Insert appropriate alter() calls. Each operation can be performed as > it arrives, as the later calls depend upon those moves/rotates. alter(A) alter(X/Y/Z) move(A/B, X/Y/Z/B) alter(.) alter(X/Y) rotate(A, X/Y/Z) alter(X) alter(A/B/C) was A/B/C move(X/Y, A/B/C/Y) alter(.) elided ? alter(A/B) was A/B rotate(X, A/B/C) In this instance when the alters affect moved nodes the nodes have been moved back to their original position. I wonder if we can do the same with Daniel's 9 node example? It has an odd number of elements so either one node occurs in two operations or one node doesn't need an operation at all. We need a client algorithm that converts an arbitrary sequence of moves into this minimal sequence of moves and rotates. We also need a server algorithm that combines an arbitrary sequence of moves and rotates into a minimal sequence so that the server can combine multiple revisions. The two algorithms are essentially the same. -- Philip Martin | Subversion Committer WANdisco | Non-Stop Data www.wandisco.com