Iterated edge drawer animation nodes I have a set of lines instanced along a curve using "Replicate Matrix" and "Object Matrix Output." 



My goal is to loop through the instanced lines and, for each one, get a random point on it, find the nearest point on the next instanced line, and make edge between them. The end result I want is edges drawn through all of the instanced lines, looking something like this:



I've tried to do the following way. First, a loop that runs through the lines and finds edge starts and ends:



The "random point" comes from the Random Number that inputs to the Get List Element, which has the vertices from the first line. I then pass these edge starts and ends out of the loop to draw the edges. 



This works to some extent, but I'm having problems achieving the result I want. The result I actually get is more like this:



Edges are drawn between adjacent lines, but only between the two lines currently being compared in the loop. And the number of edges being drawn between adjacent lines increases as the loop runs. I don't understand why that is. And the edges don't accumulate as the loop runs - so the edges drawn on first iteration aren't preserved in the second, etc. 

To try to fix the second, accumulation issue, I tried to make this second loop, which would save all the edges the loop calculates:



But this hasn't worked. The list in the Append gets longer after each iteration, but each element in the list gets written over with a single vector value. You can see that happening, e.g., in the Viewers connected to the Append to List nodes. It's weird.

So, that's where I am. I can't figure out how to turn something like the second drawing into something more like the first. Maybe I'm going about this whole thing the wrong way! But even just figuring out how to get the Append node to hold values across iterations would be awesome. 

Here's the .blend file:
A spiral or a helix is described using the set of parametric equations as follows:

$$
\begin{aligned}
x &amp;= R\cos{t}\\
y &amp;= R\sin{t}\\
z &amp;= \delta t
\end{aligned}
$$

Where $R$ is the radius, and $\delta$ is the vertical frequency of the curve. By implementing this, we get:



Now, we are going to move the points of the helix with a random amount in the direction of your choice, I can see you are offsetting them in the direction of the $x$ axis (This is the equivalent of sampling a random vertex along your instanced paths), so lets do that:



The points we just computed act as the first vertex of each edge, the other vertex can be computed mathematically or just by using the Project Point On Line node, the line starts are defined as the position of the next point and the ends are defined as the position of the next point plus some value in $x$ just to define the direction. To the location of the points of the next points, we simply shift the vector list backward, by doing so, each point is aligned with the one following it. Then we create the edges from the points and their projection. The node tree is as follows:



And the result is as expected (The horizontal lines are just for visual aid, not part of the implementation and they are the lines you originally had in your file):



You may notice that there is an extra edge going from the last vertex to the x axis, this is due to the fact that after shifting, the first vector became aligned with the last, and this is just a normal consequent of doing so. To fix that, just remove the last vector and last edge from the output using the slice  or remove list element node.