jacint@159: #include jacint@160: #include jacint@159: jacint@159: #include jacint@160: #include jacint@159: #include jacint@160: #include jacint@159: jacint@159: using namespace hugo; jacint@159: jacint@160: int main(int, char **) { jacint@159: typedef ListGraph::NodeIt NodeIt; jacint@159: typedef ListGraph::EachEdgeIt EachEdgeIt; jacint@160: jacint@160: ListGraph G; jacint@160: NodeIt s, t; jacint@160: ListGraph::EdgeMap cap(G); jacint@160: readDimacsMaxFlow(std::cin, G, s, t, cap); jacint@160: jacint@160: std::cout << "dijkstra demo ..." << std::endl; jacint@159: jacint@160: double pre_time=currTime(); jacint@160: Dijkstra dijkstra_test(G, s, cap); jacint@160: double post_time=currTime(); jacint@160: jacint@160: std::cout << "running time: " << post_time-pre_time << " sec"<< std::endl; jacint@159: jacint@160: EachEdgeIt e; jacint@159: jacint@160: for ( G.getFirst(e) ; G.valid(e); G.next(e) ) { jacint@160: NodeIt u=G.tail(e); jacint@160: NodeIt v=G.head(e); jacint@160: assert ( dijkstra_test.dist(v) - dijkstra_test.dist(u) <= cap.get(e) ); jacint@159: } jacint@159: jacint@159: return 0; jacint@159: }