Ejemplo n.º 1
0
 public virtual void AddUndirectedEdge(Node u, Node v, int cost)
 {
     if (!nodes.ContainsKey(u.Key) || !nodes.ContainsKey(v.Key))
     {
         throw new ArgumentException("One or both of the nodes supplied were not members of the graph.");
     }
     u.AddDirected(v, cost);
     v.AddDirected(u, cost);
 }
Ejemplo n.º 2
0
 public virtual void AddUndirectedEdge(Node u, Node v, int cost)
 {
     if (!nodes.ContainsKey(u.Key) || !nodes.ContainsKey(v.Key))
     {
         throw new ArgumentException("One or both of the nodes supplied were not members of the graph.");
     }
     u.AddDirected(v, cost);
     v.AddDirected(u, cost);
 }