private bool Visit(SimpleNode v, int childLevel) { int oldLevel = v.Level; if (v.BlackHole) { return(false); } if (v.Level <= childLevel) { v.Level = childLevel + 1; if (v.Incoming.Any(t => !Visit(_graph[t], v.Level))) { v.Level = oldLevel; return(false); } } return(true); }
private bool Visit(SimpleNode v, int childLevel) { int oldLevel = v.Level; if(v.BlackHole) { return false; } if (v.Level <= childLevel) { v.Level = childLevel + 1; if (v.Incoming.Any(t => !Visit(_graph[t], v.Level))) { v.Level = oldLevel; return false; } } return true; }