// // Follows Procedure in CLRS on page 648: // Initializes all weights to a specified upper bound: positive infinity // void InitializeSingleSource(int upperBound) { int numVerts = graph.NumVertices(); shortPathEst = new VertexValue[numVerts]; for (int i = 0; i < numVerts; i++) { shortPathEst[i] = new VertexValue(upperBound, NIL); } // Gives us a starting point to begin search at the start node shortPathEst[startNode].d = 0; // start-node.d = 0 }
// // Basic Path constructor // public Suurballe(PathGraph g) { graph = g; startNode = 0; // Default path starts at the first vertex: 0 goalNode = g.NumVertices() - 1; // Default goal is the last vertex }