public bool Disconnect(IEdge edge) { bool success = this.RemoveEdge(edge); success = success && edge.GetOtherNode(this).RemoveEdge(edge); return(success); }
public IEdge ConnectTo(INode otherNode, IEdge edge) { if (edge.GetOtherNode(this) != otherNode) { logger.Error("Other node is not valid when connecting to it."); throw new InvalidNodeException(otherNode); } // add edge to nodes this.AddEdge(edge); otherNode.AddEdge(edge); return(edge); }