1.1 --- a/src/work/athos/pf_demo.cc Sun Apr 17 18:57:22 2005 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,104 +0,0 @@
1.4 -#include <iostream>
1.5 -#include <vector>
1.6 -#include <string>
1.7 -
1.8 -#include "list_graph.h"
1.9 -//#include "marci_graph_traits.hh"
1.10 -//#include "marci_property_vector.hh"
1.11 -#include "preflow_push.hh"
1.12 -
1.13 -using namespace lemon;
1.14 -
1.15 -
1.16 -int main (int, char*[])
1.17 -{
1.18 -
1.19 - typedef ListGraph::Node Node;
1.20 - typedef ListGraph::Edge Edge;
1.21 -
1.22 - ListGraph graph;
1.23 -
1.24 - /*
1.25 - //Marci példája
1.26 -
1.27 -
1.28 - NodeIt s=graph.addNode();
1.29 - NodeIt v1=graph.addNode();
1.30 - NodeIt v2=graph.addNode();
1.31 - NodeIt v3=graph.addNode();
1.32 - NodeIt v4=graph.addNode();
1.33 - NodeIt t=graph.addNode();
1.34 -
1.35 -
1.36 - EdgeIt s_v1=graph.addEdge(s, v1);
1.37 - EdgeIt s_v2=graph.addEdge(s, v2);
1.38 - EdgeIt v1_v2=graph.addEdge(v1, v2);
1.39 - EdgeIt v2_v1=graph.addEdge(v2, v1);
1.40 - EdgeIt v1_v3=graph.addEdge(v1, v3);
1.41 - EdgeIt v3_v2=graph.addEdge(v3, v2);
1.42 - EdgeIt v2_v4=graph.addEdge(v2, v4);
1.43 - EdgeIt v4_v3=graph.addEdge(v4, v3);
1.44 - EdgeIt v3_t=graph.addEdge(v3, t);
1.45 - EdgeIt v4_t=graph.addEdge(v4, t);
1.46 -
1.47 - ListGraph::EdgeMap<int> length(graph);
1.48 -
1.49 - length.set(s_v1, 16);
1.50 - length.set(s_v2, 13);
1.51 - length.set(v1_v2, 10);
1.52 - length.set(v2_v1, 4);
1.53 - length.set(v1_v3, 12);
1.54 - length.set(v3_v2, 9);
1.55 - length.set(v2_v4, 14);
1.56 - length.set(v4_v3, 7);
1.57 - length.set(v3_t, 20);
1.58 - length.set(v4_t, 4);
1.59 - */
1.60 -
1.61 -
1.62 - //Ahuja könyv példája
1.63 -
1.64 - Node s=graph.addNode();
1.65 - Node v2=graph.addNode();
1.66 - Node v3=graph.addNode();
1.67 - Node v4=graph.addNode();
1.68 - Node v5=graph.addNode();
1.69 - Node t=graph.addNode();
1.70 -
1.71 - Edge s_v2=graph.addEdge(s, v2);
1.72 - Edge s_v3=graph.addEdge(s, v3);
1.73 - Edge v2_v4=graph.addEdge(v2, v4);
1.74 - Edge v2_v5=graph.addEdge(v2, v5);
1.75 - Edge v3_v5=graph.addEdge(v3, v5);
1.76 - Edge v4_t=graph.addEdge(v4, t);
1.77 - Edge v5_t=graph.addEdge(v5, t);
1.78 -
1.79 - //Kis modositas
1.80 - //edge_iterator v2_s=graph.add_edge(v2, s);
1.81 -
1.82 - ListGraph::EdgeMap<int> length(graph);
1.83 -
1.84 - length.set(s_v2, 10);
1.85 - length.set(s_v3, 10);
1.86 - length.set(v2_v4, 5);
1.87 - length.set(v2_v5, 8);
1.88 - length.set(v3_v5, 5);
1.89 - length.set(v4_t, 8);
1.90 - length.set(v5_t, 8);
1.91 -
1.92 - //Kis modositas
1.93 - //length.put(v2_s, 100);
1.94 -
1.95 -
1.96 -
1.97 - std::cout << "preflow-push algorithm test..." << std::endl;
1.98 -
1.99 -
1.100 - preflow_push<ListGraph, int> preflow_push_test(graph, s, t, length);
1.101 - cout << preflow_push_test.run()<<endl;
1.102 -
1.103 - //cap.put(v5_t, 9);
1.104 - //cout << preflow_push_test.run()<<endl;
1.105 -
1.106 - return 0;
1.107 -}