public void RemoveEdge(EdgeDescriptor <V, E> edgeDesciptor) { if (EdgeItems != null) { EdgeItems.Remove(new Tuple <V, V>(edgeDesciptor.Vertex1, edgeDesciptor.Vertex2)); } }
public void AddEdge(EdgeDescriptor <V, E> edgeDesciptor) { if (EdgeItems == null) { EdgeItems = new SortedDictionary <Tuple <V, V>, EdgeDescriptor <V, E> >(); } edgeDesciptor.GetInvertedVertex(Vertex); // Validate whether any of edge's vertices are equal to this vertex EdgeItems.Add(new Tuple <V, V>(edgeDesciptor.Vertex1, edgeDesciptor.Vertex2), edgeDesciptor); }
public bool TryFindEdge(V vertex1, V vertex2, out EdgeDescriptor <V, E> edgeDesciptor) { if (EdgeItems != null) { return(EdgeItems.TryGetValue(new Tuple <V, V>(vertex1, vertex2), out edgeDesciptor)); } else { edgeDesciptor = default(EdgeDescriptor <V, E>); return(false); } }