Changeset 769:eb61fbc64c16 in lemon0.x for src/work/marci/leda/comparison.cc
 Timestamp:
 08/23/04 13:26:09 (19 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@1032
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

src/work/marci/leda/comparison.cc
r768 r769 15 15 //#include <dimacs.h> 16 16 #include <hugo/time_measure.h> 17 #include < hugo/for_each_macros.h>17 #include <for_each_macros.h> 18 18 #include <hugo/graph_wrapper.h> 19 19 #include <bipartite_graph_wrapper.h> 20 20 #include <hugo/maps.h> 21 #include < max_flow.h>21 #include <hugo/max_flow.h> 22 22 23 /** 24 * Inicializalja a veletlenszamgeneratort. 25 * Figyelem, ez nem jo igazi random szamokhoz, 26 * erre ne bizzad a titkaidat! 27 */ 28 void random_init() 29 { 30 unsigned int seed = getpid(); 31 seed = seed << 15; 32 seed ^= time(0); 33 34 srand(seed); 35 } 36 37 /** 38 * Egy veletlen intet ad vissza 0 es m1 kozott. 39 */ 40 int random(int m) 41 { 42 return int( double(m) * rand() / (RAND_MAX + 1.0) ); 43 } 23 using std::cout; 24 using std::endl; 44 25 45 26 using namespace hugo; … … 66 47 67 48 int a; 68 std::cout << "number of nodes in the first color class=";49 cout << "number of nodes in the first color class="; 69 50 std::cin >> a; 70 51 int b; 71 std::cout << "number of nodes in the second color class=";52 cout << "number of nodes in the second color class="; 72 53 std::cin >> b; 73 54 int m; 74 std::cout << "number of edges=";55 cout << "number of edges="; 75 56 std::cin >> m; 76 57 int k; 77 std::cout << "A bipartite graph is a random group graph if the color classes \nA and B are partitiones to A_0, A_1, ..., A_{k1} and B_0, B_1, ..., B_{k1} \nas equally as possible \nand the edges from A_i goes to A_{i1 mod k} and A_{i+1 mod k}.\n";78 std::cout << "number of groups in LEDA random group graph=";58 cout << "A bipartite graph is a random group graph if the color classes \nA and B are partitiones to A_0, A_1, ..., A_{k1} and B_0, B_1, ..., B_{k1} \nas equally as possible \nand the edges from A_i goes to A_{i1 mod k} and A_{i+1 mod k}.\n"; 59 cout << "number of groups in LEDA random group graph="; 79 60 std::cin >> k; 80 std::cout << std::endl;61 cout << endl; 81 62 82 63 leda_list<leda_node> lS; … … 110 91 max_flow_test(stgw, stgw.S_NODE, stgw.T_NODE, const1map, flow/*, true*/); 111 92 max_flow_test.run(); 112 std::cout << "HUGO max matching algorithm based on preflow." << std::endl93 cout << "HUGO max matching algorithm based on preflow." << endl 113 94 << "Size of matching: " 114 << max_flow_test.flowValue() << std::endl;115 std::cout << "elapsed time: " << ts << std::endl << std::endl;95 << max_flow_test.flowValue() << endl; 96 cout << "elapsed time: " << ts << endl << endl; 116 97 117 98 ts.reset(); 118 99 leda_list<leda_edge> ml=MAX_CARD_BIPARTITE_MATCHING(lg); 119 std::cout << "LEDA max matching algorithm." << std::endl100 cout << "LEDA max matching algorithm." << endl 120 101 << "Size of matching: " 121 << ml.size() << std::endl;122 std::cout << "elapsed time: " << ts << std::endl << std::endl;102 << ml.size() << endl; 103 cout << "elapsed time: " << ts << endl << endl; 123 104 124 105 // ts.reset(); … … 126 107 // typedef SageGraph MutableGraph; 127 108 // while (max_flow_test.augmentOnBlockingFlow<MutableGraph>()) { } 128 // std::cout << "HUGO max matching algorithm based on blocking flow augmentation."129 // << std::endl << "Matching size: "130 // << max_flow_test.flowValue() << std::endl;131 // std::cout << "elapsed time: " << ts << std::endl << std::endl;109 // cout << "HUGO max matching algorithm based on blocking flow augmentation." 110 // << endl << "Matching size: " 111 // << max_flow_test.flowValue() << endl; 112 // cout << "elapsed time: " << ts << endl << endl; 132 113 133 114 { … … 160 141 max_flow_test(hg, s, t, cm, flow); 161 142 max_flow_test.run(); 162 std::cout << "HUGO max matching algorithm on SageGraph by copying the graph, based on preflow."163 << std::endl143 cout << "HUGO max matching algorithm on SageGraph by copying the graph, based on preflow." 144 << endl 164 145 << "Size of matching: " 165 << max_flow_test.flowValue() << std::endl;166 std::cout << "elapsed time: " << ts << std::endl << std::endl;146 << max_flow_test.flowValue() << endl; 147 cout << "elapsed time: " << ts << endl << endl; 167 148 } 168 149
Note: See TracChangeset
for help on using the changeset viewer.