示例#1
0
        public void RunScc(string path)
        {
            Digraph G   = new Digraph(path);
            SCC     scc = new KosarajuSCC(G);

            Bag <int>[] components = new Bag <int> [scc.Count()];
            for (int i = 0; i < scc.Count(); i++)
            {
                components[i] = new Bag <int>();
            }
            for (int i = 0; i < G.V(); i++)
            {
                components[scc.Id(i)].Add(i);
            }
            for (int i = 0; i < scc.Count(); i++)
            {
                Console.WriteLine(string.Join(",", components[i]));
            }
        }
示例#2
0
 public SCC(Digraph G)
 {
 }
示例#3
0
 public DirectedDFS(Digraph G, int s) : this(G, (IEnumerable <int>) new[] { s })
 {
 }