Exemplo n.º 1
0
        /// <inheritdoc />
        protected override void InternalCompute()
        {
            if (VisitedGraph.VertexCount == 0)
            {
                return;
            }

            if (TryGetRootVertex(out TVertex rootVertex))
            {
                AssertRootInGraph(rootVertex);

                // Enqueue select root only
                EnqueueRoot(rootVertex);
            }
            else
            {
                // Enqueue roots
                foreach (TVertex root in VisitedGraph.Roots())
                {
                    EnqueueRoot(root);
                }
            }

            FlushVisitQueue();
        }