public AcyclicSP(EdgeWeightedDigraph G, int s) { edgeTo = new DirectedEdge[G.V]; distTo = new double[G.V]; for (int v = 0; v < G.V; v++) distTo[v] = double.PositiveInfinity; distTo[s] = 0.0; Topological top = new Topological(G); foreach (int v in top.Order) relax(G, v); }
public AcyclicSP(EdgeWeightedDigraph G, int s) { edgeTo = new DirectedEdge[G.V]; distTo = new double[G.V]; for (int v = 0; v < G.V; v++) { distTo[v] = double.PositiveInfinity; } distTo[s] = 0.0; Topological top = new Topological(G); foreach (int v in top.Order) { relax(G, v); } }