public Topological(EdgeWeightedDigraph G)
        {
            DirectedCycle cycleFinder = new DirectedCycle(G);

            if (!cycleFinder.HasCycle())
            {
                DepthFirstOrder dfs = new DepthFirstOrder(G);
                order = dfs.ReversePost();
            }
        }
        private Stack <int> order;  //顶点的拓扑排序
        public Topological(Digraph G)
        {
            DirectedCycle cycleFinder = new DirectedCycle(G);//用于判断有向图G是否有环

            if (!cycleFinder.HasCycle())
            {
                DepthFirstOrder dfs = new DepthFirstOrder(G);
                order = dfs.ReversePost();
            }
        }