private void ConstrL(Connection pcur, ABVertex xB, ABVertex lcur, LinkedList <ABVertex> ldef) { var qB = pcur.Start; var zB = qB; while (zB.Value != xB) { if (zB.Value.Type == VertexType.A) { if (!_l.Contains(zB.Value)) { lcur.AddToD(zB.Value); zB.Value.L = lcur; AddToL(zB.Value); zB.Value.P = pcur; Log.Info("Vertex " + zB.Value.Name + " gets P " + pcur.Arc); ldef.AddLast(zB.Value); } else { var rB = FindCurrentDContaining(zB.Value); lcur.AddAnotherDtoD(rB.Value.D); zB = rB; continue; } } zB = zB.Ancestor; } }
public TwinGraph() { _startVertex = new ABVertex(VertexType.A, "s", this); _endVertex = new ABVertex(VertexType.B, "t", this); Vertices = new LinkedList <TwinVertex>(); Arcs = new LinkedList <Arc>(); }
public IStackableVertex Push(ABVertex vertex, Arc arcFromAncestor) { vertex.Pushed(_top, arcFromAncestor); if (_top != null) { _top.AddDescendant(vertex); } _top = vertex; CurrentStack.AddLast(vertex); MDFS._step++; Log.Info("(" + MDFS._step + ") Pushed vertex " + vertex.Name + " and arc " + arcFromAncestor); return(vertex); }
public TwinVertex(Vertex precursor, TwinGraph tg) { Precursor = precursor; Graph = tg; if (precursor != null) { A = new ABVertex(VertexType.A, precursor.Name, Graph); B = new ABVertex(VertexType.B, precursor.Name, Graph); } else { A = new ABVertex(VertexType.A, Graph); B = new ABVertex(VertexType.B, Graph); } A.SetTwin(B); B.SetTwin(A); }
private IStackableVertex FindCurrentDContaining(ABVertex v) { return(v.L); }
private void AddToL(ABVertex v) { _l.AddLast(v); v.AddedToL(); }
public bool Contains(ABVertex vertex) { return(VertexHelper.DoesABVertexExist(vertex.Guid, CurrentStack)); }
public void AddToD(ABVertex v) { D.AddLast(v); }
public void SetTwin(ABVertex twin) { Twin = twin; }