Move all coincident points across a data tree

Hi all,

I am creating a definition to ‘randomize’ sets of curves (created in Rhino) to make them look more organice. The idea is to explode curves into segments, take the midpoint and endpoints, move them randomly with simplex noise and reconnect using arcs.

Points are often shared between segments, therefore this technique does not work for such points:

How could I group coincident points and move them as one? I know of the ‘group points’ component, but using these makes me lose the data tree thus making it impossible to create the correct arcs afterwards.

Thanks!
Coincident Points.gh (19.0 KB)

Coincident Points Edited v0.gh (24.0 KB)

Great defintion, thank you. Did not know about flatten-unflatten and insert index, which makes this much more elegant.

Do I understand correctly that the issue with coincident points does not arise now, because simplex component returns the same value for coincident points?
Thanks again!