summaryrefslogtreecommitdiffstats
path: root/Graph.cs
diff options
context:
space:
mode:
authorToby Vincent <tobyv13@gmail.com>2021-03-26 18:15:57 +0000
committerToby Vincent <tobyv13@gmail.com>2021-03-26 18:15:57 +0000
commit1c2b72905bb59c911ddbbb99075eaa19f601decb (patch)
tree499b2bddcb20fe42f21365a55759cd4d476e69e3 /Graph.cs
parent55516440aa3a41b91963bbf97dfa17cbb1e1dcca (diff)
added constructors
Diffstat (limited to 'Graph.cs')
-rw-r--r--Graph.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Graph.cs b/Graph.cs
index 59fa004..5841035 100644
--- a/Graph.cs
+++ b/Graph.cs
@@ -7,6 +7,13 @@ namespace Graph
{
public List<Vertex<T>> Vertices { get; set; } = new List<Vertex<T>>();
+ public Graph() { }
+
+ public Graph(List<Vertex<T>> vertices)
+ {
+ Vertices = vertices;
+ }
+
public void AddEdge(Edge<T> edge)
{
Vertex<T> vertex = Vertices.Find(u => u.Id == edge.U);