lengths, with a set of possible algorithms to perform the matching.
Stream 1: {0;0;0} {0;0;1} {0;1;0} {0;1;1} {0;1;2}
Stream 2: {0;0} {0;1}
"trim end" and "trim start" matching could be applied between the paths - applying either an {A;B;C} -> {A;B} mapping to stream one, or {A;B;C} -> {A;B}.
In a more complex situation:
Stream 1: {0;0;0} {0;0;1} {0;1;0} {0;1;1} {0;2;0} {0;2;1}{0;2;2}{0;2;3}
Stream 2: {0} {1} {2}
Stream 3: {0;0;0;0} {0;0;1;0}{0;0;1;1} {0;0;1;2} {0;0;2;0}
This could conceivably include all kinds of ambiguous cases, but here's a stab at an algorithm that might sort them appropriately most of the time:
Find the highest value for each path index in each stream - so 1 has {0;2;3}, 2 has {2} and 3 has {0;0;2;2}
Find the shortest path length N across all paths - in this case N=1
find the highest (leftmost) shared pattern of N sequential values across all paths (here just {2})
Simplify all streams to the matching set of indices. (Stream 1: {A;B;C} -> {B}, Stream 2 {A} -> {A}, Stream 3: {A;B;C;D} -> {C})
Not sure if this makes sense - (either because I've explained it poorly or because the idea itself is bad.) But hopefully at least the goal is clear - to find a most-of-the-time routine to reconcile paths of different lengths according to their overlap. …
nce to graft:
{A}(i) --> {A;i}
becomes
{0}(0) --> {0;0}
{0}(1) --> {0;1}
{0}(2) --> {0;2}
...
{0}(n) --> {0;n}
So now to apply this to any complex situation that the Path Mapper might be able to do. A recent post here on the Forum asked about duplicating every branch to the next branch. For example:
{0;0} = 1
{0;1} = 2
{0;2} = 3
needs to be
{0;0} = 1
{0;1} = 1
{0;2} = 2
{0;3} = 2
{0;4} = 3
{0;5} = 3
First we need to make a gap for the duplicated data to be slotted into.
{A;B} --> {A;2*B}
becomes
{0;0} --> {0;2*0} = {0;0}
{0;1} --> {0;2*1} = {0;2}
{0;2} --> {0;2*2} = {0;4}
Then we need to map the same branches into the next branch
{A;B} --> {A;2*B+1}
becomes
{0;0} --> {0;2*0+1} = {0;1}
{0;1} --> {0;2*1+1} = {0;3}
{0;2} --> {0;2*2+1} = {0;5}
Now when these two paths structures are combined you will get the desired results.
So it comes down to how you wish to map your paths and coming up with a formula to do so.
…
Added by Danny Boyes at 2:50pm on October 20, 2011
Are there only two branches that you don't want anything to happen on. {0;1;0;1} and {3;2;0;1} and is this because they don't have any list length 2 on the previous branch?
o three parts:
branch 1:
{0;0} N = 3
{0;1} N = 3
branch 2:
{1;0} N = 5
{1;1} N = 5
branch 3:
{2;0} N = 30
{2;1} N = 30
parthmapper won't change the length of branch, explode tree won't give me two branches in one output
…