public FastDepthFirstSearchNode(TNode node, int?discoverTime, int?finishTime, FastDepthFirstSearchNode <TNode> predecessor)
        {
            this.m_Value = node;

            this.m_Predecessor = predecessor;

            this.m_DiscoverTime = discoverTime;

            this.m_FinishTime = finishTime;
        }
Beispiel #2
0
        public List <List <TNode> > GetComponents()
        {
            int tempIndex = 0;

            int tempGraphNumber = -1;

            List <List <TNode> > result = new List <List <TNode> >();

            for (int i = 1; i < 2 * searchResult.NumberOfNodes * 2; i++)
            {
                for (int j = 0; j < searchResult.NumberOfNodes; j++)
                {
                    //NodeInfo<TNode, TimeStamp> tempInfo = this.labels[this.searchResult[j]];
                    FastDepthFirstSearchNode <TNode> tempInfo = this.labels[this.searchResult[j]];

                    //if (tempInfo.Value.DiscoverTime == i)
                    if (tempInfo.DiscoverTime == i)
                    {
                        if (tempIndex == 0)
                        {
                            result.Add(new List <TNode>());

                            tempGraphNumber++;
                        }

                        tempIndex++;
                    }
                    //else if (tempInfo.Value.FinishTime == i)
                    else if (tempInfo.FinishTime == i)
                    {
                        tempIndex--;

                        result[tempGraphNumber].Add(this.searchResult[j]);
                    }
                }
            }

            return(result);
        }