/// <summary> /// Removes all edges from this vertex and removes it from the graph. /// </summary> /// <returns>This</returns> public Vertex <T> Remove() { IncomingEdges.ForEach(x => x.Remove()); OutgoingEdges.ForEach(x => x.Remove()); IncomingEdges.Clear(); OutgoingEdges.Clear(); Graph.Vertices.Remove(this); return(this); }
/// <summary> /// Removes all edges from this vertex and removes it from the graph. /// </summary> /// <returns>This</returns> public Vertex <T> Remove() { for (var x = 0; x < IncomingEdges.Count; ++x) { IncomingEdges[x].Remove(); } for (var x = 0; x < OutgoingEdges.Count; ++x) { OutgoingEdges[x].Remove(); } IncomingEdges.Clear(); OutgoingEdges.Clear(); Graph.Vertices.Remove(this); return(this); }
public void Clear() { IncomingEdges.Clear(); OutgoingEdges.Clear(); }