/// <summary> /// Adds Edge to nodeOne of nodeTwo and weight /// </summary> /// <param name="nodeOne"></param> /// <param name="nodeTwo"></param> /// <param name="weight"></param> public void AddEdge(Node nodeOne, Node nodeTwo, int weight) { Node node = Vertecies.Where(n => n.ID == nodeOne.ID).FirstOrDefault(); Tuple <Node, int> edge = Tuple.Create(nodeTwo, weight); node.AdjList.Add(edge); }
/// <summary> /// Add Node to Verticies property /// </summary> /// <param name="value"></param> /// <returns>Added Node</returns> public Node AddNode(int value) { Node node = new Node(value); Vertecies.Add(node); return(node); }