From 01dec404fb948258f3deb9d7d5c45cd120652c5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tristram=20Gr=C3=A4bener?= Date: Tue, 18 May 2010 14:46:44 +0200 Subject: [PATCH] Reverted the bad commit c2584325b7e32d80c297 --- ch/Makefile | 7 +- ch/bench.cc | 34 +------ ch/graph.h | 1 - ch/main.cc | 15 ++- ch/query.cc | 61 +------------ ch/query.h | 1 - lib/CMakeLists.txt | 8 +- lib/README.CONFIG.txt | 9 ++ lib/benchmark.py | 26 ++---- lib/graph_wrapper.cpp | 208 +++++++----------------------------------- lib/graph_wrapper.h | 9 +- lib/layer.py | 38 +++----- lib/martins.cpp | 1 - lib/martins.h | 2 +- lib/martins_impl.h | 18 +--- lib/tsaggouris.cpp | 1 + 16 files changed, 92 insertions(+), 347 deletions(-) create mode 100644 lib/README.CONFIG.txt diff --git a/ch/Makefile b/ch/Makefile index 08bea7b..3327203 100644 --- a/ch/Makefile +++ b/ch/Makefile @@ -1,5 +1,5 @@ -ch: main.o bench.o test.o dijkstra.o contraction.o query.o tsaggouris.o - g++ -o ch main.o bench.o test.o dijkstra.o contraction.o query.o tsaggouris.o -lpqxx -Wall -lboost_serialization +ch: main.o bench.o test.o dijkstra.o contraction.o query.o + g++ -o ch main.o bench.o test.o dijkstra.o contraction.o query.o -lpqxx -Wall -lboost_serialization main.o: main.cc g++ -O3 -Wall -o main.o -c main.cc @@ -16,8 +16,5 @@ dijkstra.o: dijkstra.cc contraction.o: contraction.cc g++ -O3 -Wall -o contraction.o -c contraction.cc -tsaggouris.o: tsaggouris.cc - g++ -O3 -Wall -o tsaggouris.o -c tsaggouris.cc - query.o: query.cc g++ -O3 -Wall -o query.o -c query.cc diff --git a/ch/bench.cc b/ch/bench.cc index 144eea5..2d9fde2 100644 --- a/ch/bench.cc +++ b/ch/bench.cc @@ -1,6 +1,6 @@ #include "dijkstra.h" #include "query.h" -#include "tsaggouris.h" + #include struct found_goal{}; @@ -58,14 +58,14 @@ void bench(Graph & g, Graph & gc) boost::progress_timer t; for(int i=0; i < runs; i++) { - query_mono(starts[i], dests[i], gc.graph); + //query_mono(starts[i], dests[i], gc.graph); } } } void martins_bench(Graph & g, Graph & gc) { - int runs = 100; + int runs = 10; std::vector starts(runs); std::vector dests(runs); for(int i=0; i < runs; i++) @@ -77,7 +77,7 @@ void martins_bench(Graph & g, Graph & gc) boost::progress_timer t; for(int i=0; i < runs; i++) { - martins(starts[i], dests[i], g); + //martins(starts[i], dests[i], g); } } @@ -90,29 +90,3 @@ void martins_bench(Graph & g, Graph & gc) } } - -void tsaggouris_bench(Graph & g) -{ - int runs = 10; - std::vector starts(runs); - for(int i=0; i < runs; i++) - { - starts[i] = rand() % boost::num_vertices(g.graph); - } - { - boost::progress_timer t; - for(int i=0; i < runs; i++) - { - martins_all(starts[i], g); - } - } - - { - boost::progress_timer t; - for(int i=0; i < runs; i++) - { - ssmosp(g, starts[i]); - } - } - -} diff --git a/ch/graph.h b/ch/graph.h index d9f240e..dbe492d 100644 --- a/ch/graph.h +++ b/ch/graph.h @@ -79,7 +79,6 @@ struct Graph typedef boost::adjacency_list Type; typedef boost::graph_traits::edge_descriptor edge_t; typedef boost::graph_traits::vertex_descriptor node_t; - typedef boost::graph_traits::edge_iterator edge_iterator; struct inc_order { diff --git a/ch/main.cc b/ch/main.cc index b499510..d461d78 100644 --- a/ch/main.cc +++ b/ch/main.cc @@ -8,7 +8,6 @@ void bench(Graph & g, Graph & gc); void martins_bench(Graph & g, Graph & gc); -void tsaggouris_bench(Graph & g); void test(Graph & g, Graph & gc); float secu(int cat, int length) { @@ -26,7 +25,7 @@ float secu(int cat, int length) int main(int, char** argv) { - /* Graph g; +/* Graph g; std::map map; pqxx::connection Conn("dbname=mumoro"); @@ -56,12 +55,12 @@ int main(int, char** argv) g.add_edge(map[source], map[destination], edge_prop); // g.add_edge(map[destination], map[source], edge_prop); ++show_progress; - } - g.save("paris_original"); + }*/ +/* g.save("paris_original"); Graph gc(g); gc.contract(); - gc.save("paris_ch");*/ - + gc.save("paris_ch"); + */ // 51937 nodes // 619894 edges @@ -75,7 +74,7 @@ int main(int, char** argv) // 619894 edges Graph g("paris_original"); - //Graph gc("paris_ch"); + Graph gc("paris_ch"); /* gc.split(); gc.save("paris_ch");*/ // Graph gc(g); @@ -86,7 +85,7 @@ int main(int, char** argv) //test(g,gc); // bench(g, gc); - tsaggouris_bench(g); + martins_bench(g, gc); } diff --git a/ch/query.cc b/ch/query.cc index a14ed4b..6d60cac 100644 --- a/ch/query.cc +++ b/ch/query.cc @@ -157,65 +157,6 @@ bool martins(Graph::node_t start_node, Graph::node_t dest_node, const Graph & g) return false; } -// Algo de martins sur le graphe normal, vers tous les nœuds -bool martins_all(Graph::node_t start_node, const Graph & g) -{ - my_queue::Type Q; - std::vector< std::deque