Example #1
0
        public KosarajuCC(Digraph G)
        {
            mark = new bool[G.v()];
            id   = new int[G.v()];
            DepthFirstOrder order = new DepthFirstOrder(G.reverse());

            foreach (int s in order.getReversePost())
            {
                if (!mark[s])
                {
                    dfs(G, s);
                    count++;
                }
            }
        }