public void RemoveEdge(Node <T> from, Node <T> to) { from.RemoveNeighbor(to); if (!_isDirected) { to.RemoveNeighbor(from); } }
public bool RemoveEdge(T value1, T value2) { Node <T> node1 = Find(value1); Node <T> node2 = Find(value2); if (node1 == null || node2 == null) { return(false); } else if (!node1.Neighbors.Contains(node2)) { return(false); } else { node1.RemoveNeighbor(node2); node2.RemoveNeighbor(node1); return(true); } }