LINQ, creating unique collection of a collection

Posted by Wish on Stack Overflow See other posts from Stack Overflow or by Wish
Published on 2012-03-27T17:18:54Z Indexed on 2012/03/27 17:29 UTC
Read the original article Hit count: 175

Filed under:
|
|

I have class Vertex and a class Edge (Edge holds 2 properties - Vertex Source and Vertex Target);

Edges and Vertexes are collected into lists

Some example:

A-->B // edge from vertex A to B
B-->C // edge from vertex B to C
C-->A // edge from vertex C to A
A-->C // edge from vertex A to C  -- this is two way edge

So I would like to make IDictionary<Edge, bool> which would hold edges (A-->B and B-->A would be like 1), and bool - if it is two way or no.

I need it because when I draw them now, it draws 2 arrows under one another. I would better make 1 arrow.

So I'm pretty stuck right here... May anybody help me a bit ?

© Stack Overflow or respective owner

Related posts about c#

Related posts about LINQ