Transposition() public method

public Transposition ( ) : DGraph
return DGraph
Exemplo n.º 1
0
        public KosarajuAlgorithm(DGraph G)
        {
            TopologicalSorting Gts = new TopologicalSorting(G);

            DGraph Gtr = G.Transposition();

            int[] mark = new int[G.VerticesCount];
            for (int i = 0; i < G.VerticesCount; ++i)
                mark[i] = -1;
            SCCEdg = new List<List<DEdge>>();
            SCCVrt = new List<List<int>>();

            for (int i = Gtr.VerticesCount - 1; i >= 0; --i)
                if (mark[Gts[i]] == -1)
                {
                    List<DEdge> tscce = new List<DEdge>();
                    SCCEdg.Add(tscce);

                    List<int> tsccv = new List<int>();
                    SCCVrt.Add(tsccv);

                    AddSCC(Gts[i], ref mark, Gtr);

                    SCCVrt[SCCCount].Sort();
                    ++SCCCount;
                }
        }