//public bool Remove(T value) //{ // // Locate the node in the node set // var node = (GraphNode<T>)Nodes.FindByValue(value); // if (node == null) // return false; // Nodes.Remove(node); // // Remove all the edges // foreach (var gn in Nodes) // { // int i = gn.Neighbors.IndexOf(node); // if (i != -1) // { // gn.Neighbors.RemoveAt(i); // gn.Costs.RemoveAt(i); // } // } // return true; //} public Graph() { Nodes = new NodeListCollection <T>(); }
public Graph(NodeListCollection <T> nodes) { Nodes = nodes ?? new NodeListCollection <T>(); }
public GraphNode(T value, NodeListCollection <T> neighbors) : base(value, neighbors) { Costs = new List <int>(); }