private void dfsB(PKNode n, ref List <PKNode> B, int lb) { n.Visited = true; B.Add(n); foreach (var w in n.Incoming) { if (!w.Visited && lb < w.Ord) { dfsB(w, ref B, lb); } } }
private bool dfsF(PKNode n, ref List <PKNode> F, int ub) { n.Visited = true; F.Add(n); foreach (var w in n.Outgoing) { if (w.Ord == ub) { return(false); } if (!w.Visited && w.Ord < ub) { if (dfsF(w, ref F, ub) == false) { return(false); } } } return(true); }
private bool dfsF(PKNode n, ref List<PKNode> F, int ub) { n.Visited = true; F.Add(n); foreach (var w in n.Outgoing) { if (w.Ord == ub) return false; if (!w.Visited && w.Ord < ub) { if (dfsF(w, ref F, ub) == false) return false; } } return true; }
private void dfsB(PKNode n, ref List<PKNode> B, int lb) { n.Visited = true; B.Add(n); foreach (var w in n.Incoming) { if(!w.Visited && lb < w.Ord) dfsB(w, ref B, lb); } }