/// <summary> /// Adds new edges to the graph which connects two vertices. /// Note: this method will not validate the present of vertex1 and vertex2 in the graph. /// </summary> /// <param name="edgeData">Data to store in new edge.</param> /// <param name="vertexId1">Id of the Vertex1.</param> /// <param name="vertexId2">Id of the Vertex2</param> /// <returns>New Edge.</returns> public Edge <U> AddEdge(U edgeData, long vertexId1, long vertexId2) { Edge <U> newedge = new Edge <U>(EdgeArray.Count); newedge.Data = edgeData; newedge.VertexId1 = vertexId1; newedge.VertexId2 = vertexId2; EdgeArray.Add(newedge); return(newedge); }