author | alpar |
Fri, 07 May 2004 06:58:24 +0000 | |
changeset 568 | ed0a4de23923 |
child 570 | eec0a62979c9 |
permissions | -rw-r--r-- |
1 #include <test_tools.h>
2 #include <hugo/smart_graph.h>
3 #include <hugo/dijkstra.h>
5 using namespace hugo;
7 const int PET_SIZE =5;
9 int main()
10 {
12 typedef SmartGraph Graph;
14 typedef Graph::Edge Edge;
15 typedef Graph::Node Node;
16 typedef Graph::EdgeIt EdgeIt;
17 typedef Graph::NodeIt NodeIt;
18 typedef Graph::EdgeMap<int> LengthMap;
20 Graph G;
21 Node s, t;
22 LengthMap cap(G);
24 PetStruct<Graph> ps = addPetersen(G,PET_SIZE);
26 for(int i=0;i<PET_SIZE;i++) {
27 cap[ps.outcir[i]]=4;
28 cap[ps.incir[i]]=1;
29 cap[ps.chords[i]]=10;
30 }
31 s=ps.outer[0];
32 t=ps.inner[1];
34 Dijkstra<Graph, LengthMap>
35 dijkstra_test(G, cap);
36 dijkstra_test.run(s);
38 check(dijkstra_test.dist(t)==13,"Dijkstra found a wrong path.");
40 }