コード例 #1
0
        protected override void InternalCompute()
        {
            if (this.VisitedGraph.VertexCount == 0)
            {
                return;
            }

            this.Initialize();

            TVertex rootVertex;

            if (!this.TryGetRootVertex(out rootVertex))
            {
                // enqueue roots
                foreach (var root in AlgoUtility.Roots(this.VisitedGraph))
                {
                    this.EnqueueRoot(root);
                }
            }
            else // enqueue select root only
            {
                this.Visit(rootVertex);
            }
            this.FlushVisitQueue();
        }
コード例 #2
0
        protected override void InternalCompute()
        {
            this.Initialize();

            TVertex rootVertex;

            if (!this.TryGetRootVertex(out rootVertex))
            {
                // enqueue all roots
                foreach (var root in AlgoUtility.Roots(this.VisitedGraph))
                {
                    this.EnqueueRoot(root);
                }
            }
            else
            {
                this.EnqueueRoot(rootVertex);
            }

            this.FlushVisitQueue();
        }