public void AddVertex(long id, T data) { if (AllVertex.ContainsKey(id)) { return; } Vertex <T> v = new Vertex <T>(id, data); AllVertex.Add(id, v); NumberOfVertices++; }
/// <summary> /// /// </summary> /// <param name="vertex"></param> public void AddVertex(Vertex <T> vertex) { if (AllVertex.ContainsKey(vertex.Id)) { return; } AllVertex.Add(vertex.Id, vertex); foreach (var e in vertex.GetAdjEdges()) { AllEdges.Add(e); NumberOfEdges++; } NumberOfVertices++; }