1.1 --- a/src/work/athos/suurballe.cc Sun Apr 17 18:57:22 2005 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,128 +0,0 @@
1.4 -// -*- c++ -*-
1.5 -//#include <iostream>
1.6 -//#include <vector>
1.7 -//#include <string>
1.8 -
1.9 -#include <list_graph.h>
1.10 -#include <minlengthpaths.h>
1.11 -
1.12 -using namespace lemon;
1.13 -
1.14 -
1.15 -int main()
1.16 -{
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 -
1.98 - /*Egyszerű példa
1.99 - NodeIt s=flow_test.add_node();
1.100 - NodeIt v1=flow_test.add_node();
1.101 - NodeIt v2=flow_test.add_node();
1.102 - NodeIt t=flow_test.add_node();
1.103 -
1.104 - node_property_vector<list_graph, std::string> node_name(flow_test);
1.105 - node_name.put(s, "s");
1.106 - node_name.put(v1, "v1");
1.107 - node_name.put(v2, "v2");
1.108 - node_name.put(t, "t");
1.109 -
1.110 - edge_iterator s_v1=flow_test.add_edge(s, v1);
1.111 - edge_iterator v1_v2=flow_test.add_edge(v1, v2);
1.112 - edge_iterator v2_t=flow_test.add_edge(v2, t);
1.113 -
1.114 - edge_property_vector<list_graph, int> length(flow_test);
1.115 -
1.116 - length.put(s_v1, 16);
1.117 - length.put(v1_v2, 10);
1.118 - length.put(v2_t, 4);
1.119 - */
1.120 -
1.121 - std::cout << "Suurballe algorithm test..." << std::endl;
1.122 -
1.123 -
1.124 - int k=3;
1.125 - MinLengthPaths<ListGraph, ListGraph::EdgeMap<int> >
1.126 - surb_test(graph, length);
1.127 - std::cout << surb_test.run(s,t,k) << std::endl;
1.128 -
1.129 -
1.130 - return 0;
1.131 -}