diff options
Diffstat (limited to 'Graph.cs')
-rw-r--r-- | Graph.cs | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -18,8 +18,10 @@ namespace Graph { Vertex<T> vertex = Vertices.Find(u => u.Id == edge.U); - if (vertex == null) + if (vertex == null) { Vertices.Add(vertex = new Vertex<T>(edge.U)); + vertex = Vertices[Vertices.Count - 1]; + } vertex.Edges.Add(edge); } |