Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
        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);
            }
        }