int main() { graph cityMap; ... // initialization of the map graph::iterator start = cityMap.begin(); graph::iterator stop = cityMap.end(); for ( ; start != stop; ++start) { const char * city = (*start).first; cout << "\nStarting from " << city << "\n"; cityInfo costs; dijkstra(cityMap, city, costs); cityInfo::iterator cstart = costs.begin(); cityInfo::iterator cstop = costs.end(); for ( ; cstart != cstop; ++cstart) { cout << "to " << (*cstart).first << " costs " << (*cstart).second << '\n'; } } return 0;

Previous slide Next slide Back to first slide View graphic version