public void RemoveEdge(TwinVertex tvFrom, TwinVertex tvTo, bool inMatching) { if (inMatching) { if (!ArcHelper.DoesArcExist(tvFrom.A, tvTo.B, Arcs)) { throw new NoArcException(); } if (!ArcHelper.DoesArcExist(tvTo.A, tvFrom.B, Arcs)) { throw new NoArcException(); } } else { if (!ArcHelper.DoesArcExist(tvFrom.B, tvTo.A, Arcs)) { throw new NoArcException(); } if (!ArcHelper.DoesArcExist(tvTo.B, tvFrom.A, Arcs)) { throw new NoArcException(); } } Log.Info("Removing edge " + tvFrom + " <-> " + tvTo + " M?: " + inMatching + " from TwinGraph"); RemoveArc(tvFrom, tvTo, inMatching); RemoveArc(tvTo, tvFrom, inMatching); }
public void EndVertexRemoved(IVertex endVertex) { if (!ArcHelper.DoesArcExist(this, endVertex, OutboundArcs)) { throw new NoArcException(); } ArcHelper.DeleteArc(this, endVertex, OutboundArcs); }
public void RemoveInboundArc(IVertex startVertex) { Log.Info("Removing inbound arc from vertex " + Name); if (!ArcHelper.DoesArcExist(startVertex, this, InboundArcs)) { throw new NoArcException(); } ArcHelper.DeleteArc(startVertex, this, InboundArcs); }
public void RemoveArc(IVertex vertex) { Log.Info("Removing outbound arc from vertex " + Name); if (!ArcHelper.DoesArcExist(this, vertex, OutboundArcs)) { throw new NoArcException(); } vertex.RemoveInboundArc(this); ArcHelper.DeleteArc(this, vertex, OutboundArcs); }
public void RemoveEdge(Vertex v1, Vertex v2) { if (!ArcHelper.DoesArcExist(v1, v2, Arcs)) { throw new NoArcException(); } if (!ArcHelper.DoesArcExist(v2, v1, Arcs)) { throw new NoArcException(); } RemoveArc(v1, v2); RemoveArc(v2, v1); }
public Arc AddOutboundArc(IVertex endVertex, bool inMatching, double weight) { if (ArcHelper.DoesArcExist(this, endVertex, OutboundArcs)) { throw new NoMultiedgePermitedException(); } var newArc = new Arc(Graph, this, endVertex, inMatching, weight); OutboundArcs.AddLast(newArc); if (inMatching) { AddToMatching(); } Log.Info("Added outbound arc " + newArc + " to vertex " + Name + " with weight " + newArc.Weight); endVertex.AddInboundArc(newArc, inMatching); return(newArc); }