-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_dimension.cpp
More file actions
61 lines (40 loc) · 1.44 KB
/
Copy pathtest_dimension.cpp
File metadata and controls
61 lines (40 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include "src/graph.hpp"
#include "src/lattice.hpp"
#include "src/highway.hpp"
#include "src/road_networks.hpp"
#include "src/data.hpp"
#include <cmath>
#include <stdio.h>
int main()
{
// // print non-state names
// for (const auto& name : get_non_state_names())
// {
// printf("%s\n", name.c_str());
// }
// std::exit(0);
// auto ch = get_contraction_hierarchy("HI");
// WallTimer timer;
// timer.start("Initializing highway");
// // Highway h("HI", ch, 1, 1, 2.0);
// Highway h("HI", ch, std::lround(std::log2(ch.node_count())), 1, 1.5);
// h.initialize();
// timer.print();
// timer.start("Computing best clustering exponent");
// unsigned batch_size = 600;
// // double total_path_length = h.get_total_greedy_path_length(batch_size);
// // double average_path_length = total_path_length / batch_size;
// // double average_path_length = h.get_average_greedy_path_length(batch_size);
// double clustering_exponent = h.estimate_optimal_clustering_exponent(1.5, batch_size);
// timer.print();
// // printf("Average greedy path length: %f\n", average_path_length);
// printf("Optimal clustering exponent: %f\n", clustering_exponent);
// Lattice g(150, 3, true);
// Lattice g(150, 3, true);
Graph g = get_graph("HI");
// // // Graph g("CA");
// // printf("Num nodes: %u\n", g.size());
// // printf("Num edges: %u\n", g.num_edges());
double alpha = g.estimate_optimal_dimension(1.5, 0);
printf("Optimal alpha: %f\n", alpha);
}