コード例 #1
0
        public void DirectedCycle_hasCycle_true()
        {
            var g   = initDG();
            var dc  = new DirectedCycle(g);
            var res = dc.hasCycle();

            Assert.True(res);
        }
コード例 #2
0
        public Topological(Digraph G)
        {
            DirectedCycle cycleFinder = new DirectedCycle(G);

            if (!cycleFinder.hasCycle())
            {
                DepthFirstOrder dfs = new DepthFirstOrder(G);
                order = dfs.getReversePost();
            }
        }