Ejemplo n.º 1
0
        public IDiGraph Reverse()
        {
            IDiGraph R = new DiGraph(V);

            for (int v = 0; v < V; v++)
            {
                foreach (int w in Adj(v))
                {
                    R.AddEdge(w, v);
                }
            }
            return(R);
        }
        public Topological(IEdgeWeightedDIgraph G)
        {
            IDiGraph g = new DiGraph(G.V);

            for (int i = 0; i < G.V; i++)
            {
                foreach (var e in G.Adj(i))
                {
                    g.AddEdge(e.From, e.To);
                }
            }
            Order = Init(g);
        }