The program loads a set of verticies an edges from a file in to this. Then I have to use Dijkstra's shortest path algorithm, given a starting an ending node in the Graph. In order to do this, you need to store certain attributes for each vertex, such as the min_distance and a pointer to the previous_node (so that you can trace the path after the algorithm finishes). The question is, how do I make it so that the keys' attributes in the vertex map are modifiable?
map<Vertex, map<Vertex, double> > m;
map<Vertex, map<Vertex,double> >::iterator i; i = m.find(Vertex); Vertex v = i->first; v.min_dist = 2; v.prevNode = pnode; // this would point to a vertex obtained in a similar fashon to v
From novice to tech pro — start learning today.