iterate over edge indices list and remove the non unique pairs
Here is the node tree:
The tricky part for me was the &quot;recursion&quot; which AN does with this reassign parameter.

and here is the result in action:
https://youtu.be/9Fdx1kxaJgE