Graph displayer is now displaying nodes. Edges remain still undisplayed yet.
5 #include "list_graph.h"
6 //#include "marci_graph_traits.hh"
7 //#include "marci_property_vector.hh"
8 #include "preflow_push.hh"
10 using namespace lemon;
13 int main (int, char*[])
16 typedef ListGraph::Node Node;
17 typedef ListGraph::Edge Edge;
25 NodeIt s=graph.addNode();
26 NodeIt v1=graph.addNode();
27 NodeIt v2=graph.addNode();
28 NodeIt v3=graph.addNode();
29 NodeIt v4=graph.addNode();
30 NodeIt t=graph.addNode();
33 EdgeIt s_v1=graph.addEdge(s, v1);
34 EdgeIt s_v2=graph.addEdge(s, v2);
35 EdgeIt v1_v2=graph.addEdge(v1, v2);
36 EdgeIt v2_v1=graph.addEdge(v2, v1);
37 EdgeIt v1_v3=graph.addEdge(v1, v3);
38 EdgeIt v3_v2=graph.addEdge(v3, v2);
39 EdgeIt v2_v4=graph.addEdge(v2, v4);
40 EdgeIt v4_v3=graph.addEdge(v4, v3);
41 EdgeIt v3_t=graph.addEdge(v3, t);
42 EdgeIt v4_t=graph.addEdge(v4, t);
44 ListGraph::EdgeMap<int> length(graph);
48 length.set(v1_v2, 10);
50 length.set(v1_v3, 12);
52 length.set(v2_v4, 14);
61 Node s=graph.addNode();
62 Node v2=graph.addNode();
63 Node v3=graph.addNode();
64 Node v4=graph.addNode();
65 Node v5=graph.addNode();
66 Node t=graph.addNode();
68 Edge s_v2=graph.addEdge(s, v2);
69 Edge s_v3=graph.addEdge(s, v3);
70 Edge v2_v4=graph.addEdge(v2, v4);
71 Edge v2_v5=graph.addEdge(v2, v5);
72 Edge v3_v5=graph.addEdge(v3, v5);
73 Edge v4_t=graph.addEdge(v4, t);
74 Edge v5_t=graph.addEdge(v5, t);
77 //edge_iterator v2_s=graph.add_edge(v2, s);
79 ListGraph::EdgeMap<int> length(graph);
90 //length.put(v2_s, 100);
94 std::cout << "preflow-push algorithm test..." << std::endl;
97 preflow_push<ListGraph, int> preflow_push_test(graph, s, t, length);
98 cout << preflow_push_test.run()<<endl;
101 //cout << preflow_push_test.run()<<endl;