Esempio n. 1
0
 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);
 }
Esempio n. 2
0
 public void EndVertexRemoved(IVertex endVertex)
 {
     if (!ArcHelper.DoesArcExist(this, endVertex, OutboundArcs))
     {
         throw new NoArcException();
     }
     ArcHelper.DeleteArc(this, endVertex, OutboundArcs);
 }
Esempio n. 3
0
 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);
 }
Esempio n. 4
0
 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);
 }
Esempio n. 5
0
 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);
 }
Esempio n. 6
0
        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);
        }