Exemple #1
0
        public Topological(DirectGraph G)
        {
            DirectCycle cycle = new DirectCycle(G);

            if (!cycle.hasCycle())
            {
                DFSOrder dfsOrder = new DFSOrder(G);
                order = dfsOrder.ReversePost;
            }
        }
Exemple #2
0
 public Topological(DirectGraph G)
 {
     DirectCycle cycle = new DirectCycle(G);
     if (!cycle.hasCycle())
     {
         DFSOrder dfsOrder = new DFSOrder(G);
         order = dfsOrder.ReversePost;
     }
 }