Programming assignment 5, due Wednesday, May 26, 10AM.
--------------- finding dhortest paths with vertex weights --------
Instructions:
1. Your assignment is to complete the file ./find_vertex_shortest_paths.cc .
In that file, you will need to finish the function find_vertex_shortest_paths().
The input is a graph, a start vertex S, and a hash table with weights for each vertex.
The routine should return a hash table of distances where, for each vertex id v,
distances[v] is the minimum, over all paths p from S to v, of the sum
of the weights of the vertices on p.
2. When you complete step 4, run "make" to compile, then run "make test" to test it.
3. Turn in the single file find_vertex_shortest_paths.cc.
If you want, you can also turn in any of the class definition files
in ./Include that you modify.
Helpful hints:
The file already contains an implementation of Dijkstra's algorithm
that finds shortest paths in digraphs, given a digraph and a hash table
of edge weights. A recommended method for solving this problem
is to create a digraph G' and a set of edge weights to pass to Dijkstra's
algorithm, so that from the answer returned by Dijkstra's algorithm
(the edge-weighted shortest path lengths in the digraph G')
you can easily compute the vertex-weighted shortest path lengths
in the original graph.
The Include directory contains a Heap data structure.