コード例 #1
0
        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);
        }
コード例 #2
0
        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;
        }