Changeset 642:e812963087f0 in lemon-0.x
- Timestamp:
- 05/14/04 20:28:57 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@840
- Location:
- src/work
- Files:
-
- 1 added
- 1 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/marci/bfsit_vs_byhand.cc
r640 r642 3 3 #include <fstream> 4 4 5 #include < list_graph.h>5 #include <sage_graph.h> 6 6 //#include <smart_graph.h> 7 7 #include <hugo/dimacs.h> … … 13 13 14 14 int main() { 15 typedef ListGraph Graph;15 typedef SageGraph Graph; 16 16 typedef Graph::Node Node; 17 17 typedef Graph::NodeIt NodeIt; -
src/work/marci/bipartite_graph_wrapper_test.cc
r640 r642 4 4 #include <vector> 5 5 6 #include < list_graph.h>6 #include <sage_graph.h> 7 7 //#include <smart_graph.h> 8 8 //#include <dimacs.h> … … 18 18 19 19 int main() { 20 typedef Undir ListGraph Graph;20 typedef UndirSageGraph Graph; 21 21 typedef Graph::Node Node; 22 22 typedef Graph::NodeIt NodeIt; -
src/work/marci/bipartite_matching_try.cc
r640 r642 5 5 #include <cstdlib> 6 6 7 #include < list_graph.h>7 #include <sage_graph.h> 8 8 //#include <smart_graph.h> 9 9 //#include <dimacs.h> … … 41 41 42 42 int main() { 43 typedef Undir ListGraph Graph;43 typedef UndirSageGraph Graph; 44 44 typedef Graph::Node Node; 45 45 typedef Graph::NodeIt NodeIt; … … 167 167 max_flow_test(stgw, stgw.S_NODE, stgw.T_NODE, const1map, max_flow); 168 168 // while (max_flow_test.augmentOnShortestPath()) { } 169 typedef ListGraph MutableGraph;169 typedef SageGraph MutableGraph; 170 170 // while (max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) { 171 171 while (max_flow_test.augmentOnBlockingFlow2()) { -
src/work/marci/bipartite_matching_try_3.cc
r640 r642 4 4 #include <vector> 5 5 6 #include < list_graph.h>6 #include <sage_graph.h> 7 7 //#include <smart_graph.h> 8 8 //#include <dimacs.h> … … 20 20 int main() { 21 21 //typedef UndirListGraph Graph; 22 typedef BipartiteGraph< ListGraph> Graph;22 typedef BipartiteGraph<SageGraph> Graph; 23 23 24 24 typedef Graph::Node Node; -
src/work/marci/iterator_bfs_demo.cc
r602 r642 4 4 #include <string> 5 5 6 #include < list_graph.h>6 #include <sage_graph.h> 7 7 //#include <smart_graph.h> 8 8 #include <bfs_dfs.h> … … 30 30 { 31 31 //typedef SmartGraph Graph; 32 typedef ListGraph Graph;32 typedef SageGraph Graph; 33 33 34 34 typedef Graph::Node Node; -
src/work/marci/lg_vs_sg.cc
r640 r642 4 4 #include <string> 5 5 6 #include <list_graph.h> 6 #include <sage_graph.h> 7 #include <hugo/list_graph.h> 7 8 #include <hugo/smart_graph.h> 8 9 #include <hugo/dimacs.h> … … 19 20 20 21 std::string in=argv[1]; 21 typedef ListGraph MutableGraph;22 typedef SageGraph MutableGraph; 22 23 23 24 { 24 typedef ListGraph Graph;25 typedef SageGraph Graph; 25 26 typedef Graph::Node Node; 26 27 typedef Graph::EdgeIt EdgeIt; … … 38 39 max_flow_test(g, s, t, cap, flow/*, true*/); 39 40 40 std::cout << " ListGraph ..." << std::endl;41 std::cout << "SageGraph ..." << std::endl; 41 42 42 43 { … … 93 94 } 94 95 95 96 96 { 97 97 typedef SmartGraph Graph; … … 113 113 // max_flow_test(g, s, t, cap, flow); 114 114 115 std::cout << "Sma trGraph ..." << std::endl;115 std::cout << "SmartGraph ..." << std::endl; 116 116 117 117 { … … 169 169 } 170 170 171 { 172 typedef ListGraph Graph; 173 typedef Graph::Node Node; 174 typedef Graph::EdgeIt EdgeIt; 175 176 Graph g; 177 Node s, t; 178 Graph::EdgeMap<int> cap(g); 179 std::ifstream ins(in.c_str()); 180 //readDimacsMaxFlow(ins, g, s, t, cap); 181 readDimacs(ins, g, cap, s, t); 182 183 Timer ts; 184 Graph::EdgeMap<int> flow(g); //0 flow 185 MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > 186 max_flow_test(g, s, t, cap, flow/*, true*/); 187 // MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> > 188 // max_flow_test(g, s, t, cap, flow); 189 190 std::cout << "ListGraph ..." << std::endl; 191 192 { 193 std::cout << "preflow ..." << std::endl; 194 FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0); 195 ts.reset(); 196 max_flow_test.run(); 197 std::cout << "elapsed time: " << ts << std::endl; 198 std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl; 199 } 200 201 { 202 std::cout << "physical blocking flow augmentation ..." << std::endl; 203 FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0); 204 ts.reset(); 205 int i=0; 206 while (max_flow_test.augmentOnBlockingFlow<MutableGraph>()) { ++i; } 207 std::cout << "elapsed time: " << ts << std::endl; 208 std::cout << "number of augmentation phases: " << i << std::endl; 209 std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl; 210 } 211 212 // { 213 // std::cout << "faster physical blocking flow augmentation ..." << std::endl; 214 // FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0); 215 // ts.reset(); 216 // int i=0; 217 // while (max_flow_test.augmentOnBlockingFlow1<MutableGraph>()) { ++i; } 218 // std::cout << "elapsed time: " << ts << std::endl; 219 // std::cout << "number of augmentation phases: " << i << std::endl; 220 // std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl; 221 // } 222 223 { 224 std::cout << "on-the-fly blocking flow augmentation ..." << std::endl; 225 FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0); 226 ts.reset(); 227 int i=0; 228 while (max_flow_test.augmentOnBlockingFlow2()) { ++i; } 229 std::cout << "elapsed time: " << ts << std::endl; 230 std::cout << "number of augmentation phases: " << i << std::endl; 231 std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl; 232 } 233 234 { 235 std::cout << "on-the-fly shortest path augmentation ..." << std::endl; 236 FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0); 237 ts.reset(); 238 int i=0; 239 while (max_flow_test.augmentOnShortestPath()) { ++i; } 240 std::cout << "elapsed time: " << ts << std::endl; 241 std::cout << "number of augmentation phases: " << i << std::endl; 242 std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl; 243 } 244 } 245 171 246 172 247 -
src/work/marci/macro_test.cc
r640 r642 3 3 #include <fstream> 4 4 5 #include < list_graph.h>5 #include <sage_graph.h> 6 6 #include <hugo/for_each_macros.h> 7 7 … … 10 10 int main() 11 11 { 12 typedef ListGraph Graph;12 typedef SageGraph Graph; 13 13 Graph g; 14 14 Graph::Node n1=g.addNode(); -
src/work/marci/max_bipartite_matching_demo.cc
r198 r642 10 10 11 11 #include <leda_graph_wrapper.h> 12 #include < list_graph.h>12 #include <sage_graph.h> 13 13 #include <dimacs.h> 14 14 #include <time_measure.h> -
src/work/marci/max_flow_1.cc
r640 r642 3 3 #include <fstream> 4 4 5 #include < list_graph.h>5 #include <sage_graph.h> 6 6 #include <hugo/smart_graph.h> 7 7 #include <hugo/dimacs.h> … … 20 20 int main(int, char **) { 21 21 22 typedef ListGraph MutableGraph;22 typedef SageGraph MutableGraph; 23 23 24 24 typedef SmartGraph Graph; -
src/work/marci/max_flow_demo.cc
r640 r642 3 3 #include <fstream> 4 4 5 #include < list_graph.h>5 #include <sage_graph.h> 6 6 #include <hugo/smart_graph.h> 7 7 #include <hugo/dimacs.h> … … 35 35 int main(int, char **) { 36 36 37 typedef ListGraph MutableGraph;37 typedef SageGraph MutableGraph; 38 38 39 39 typedef SmartGraph Graph; 40 // typedef ListGraph Graph;40 // typedef SageGraph Graph; 41 41 typedef Graph::Node Node; 42 42 typedef Graph::EdgeIt EdgeIt; -
src/work/marci/top_sort_test.cc
r640 r642 6 6 #include <hugo/dimacs.h> 7 7 #include <bfs_dfs_misc.h> 8 #include < list_graph.h>8 #include <sage_graph.h> 9 9 #include <hugo/graph_wrapper.h> 10 10 #include <hugo/maps.h> … … 17 17 18 18 int main() { 19 typedef ListGraph Graph;19 typedef SageGraph Graph; 20 20 Graph g; 21 21 readDimacs(std::cin, g);
Note: See TracChangeset
for help on using the changeset viewer.