Finding unique edges in a list of edges
Posted: Thu May 12, 2016 1:06 pm
Hi
I am creating a procedural graph made up of points and lines connecting the said points.
I have created a list of edges/lines as;
Now I want to find all the unique edges.
Ie. remove all edges that have same starting point and ending point.
For example,
is same as
(same edges coming up more than once in the list)
which is same as (points flipped to give essentially the same line)
I dont know how to go about this. Any ideas?
I am not really looking for the fastest way of doing it. Just the simplest so that i can understand it (not much of a programmer )
I am creating a procedural graph made up of points and lines connecting the said points.
I have created a list of edges/lines as;
Code: Select all
{
{{a1, b1}, {x1, y1} },
{{a2, b2}, {x2, y2} },
...
...
{{an, bn}, {xn, yn} }
}
Ie. remove all edges that have same starting point and ending point.
For example,
Code: Select all
{{a7, b19}, {x12, y15}}
Code: Select all
{{a7, b19}, {x12, y15}}
which is same as
Code: Select all
{{x12, y15}, {a7, b19}}
I dont know how to go about this. Any ideas?
I am not really looking for the fastest way of doing it. Just the simplest so that i can understand it (not much of a programmer )