/// <summary> /// Removes an edge, if the edge doesn't exist then nothing happens. /// </summary> /// <param name="edge">edge reference</param> virtual public void RemoveEdge(Edge edge) { if (edge == null) { return; } if (!Edges.Contains(edge)) { return; } Node source = edge.SourceNode; Node target = edge.TargetNode; if (source != target) { source.RemoveOutEdge(edge); target.RemoveInEdge(edge); } else { source.RemoveSelfEdge(edge); } Edges.Remove(edge); GeometryGraph.RemoveEdge(edge.GeometryObject as Msagl.Edge); }