public void AddPredecessor(IReactiveNode node) { ValidatePredecessor(node); if (Predecessors.Contains(node) == false) { Predecessors.Add(node); } }
/// <summary> /// Returns the path leading to the vertex v. /// </summary> /// <param name="v">end of the path</param> /// <returns>path leading to v</returns> public EdgeCollection Path(IVertex v) { EdgeCollection path = new EdgeCollection(); IVertex vc = v; while (Predecessors.Contains(v)) { IEdge e = Predecessors[v]; path.Insert(0, e); v = e.Source; } return(path); }