1 #ifndef PAGERANK_BENCHMARK_H
2 #define PAGERANK_BENCHMARK_H
47 p.setXLabel(
"Number of Edges");
48 p.setYLabel(
"Runtime (in s)");
58 void run(std::string algoName,
60 std::unordered_map<std::string, double>& out)) {
61 std::vector<double> time;
62 std::vector<double> vtxCounts;
63 std::vector<double> edgeCounts;
65 for (
int years = 0; years < 120; years = 1.2 * years + 1) {
66 int year = 2019 - years;
67 std::cerr <<
"*" << std::flush;
71 std::tie(vertexCount, edgeCount) = generateWikidataMovieActor(year, 2019, graph);
73 std::unordered_map<std::string, double> pr;
75 std::chrono::time_point<std::chrono::system_clock> start = std::chrono::system_clock::now();
79 std::chrono::time_point<std::chrono::system_clock> end = std::chrono::system_clock::now();
81 std::chrono::duration<double> elapsed_seconds = end - start;
83 time.push_back ((
double)elapsed_seconds.count() );
84 vtxCounts.push_back ( (
double)vertexCount );
85 edgeCounts.push_back ( (
double)edgeCount );
87 if (elapsed_seconds.count() > time_cap) {
93 std::cerr <<
"\n" << std::flush;
Base class for a variety of graph based benchmark.
Definition: GraphBenchmark.h:15
Benchmarks Page Rank algorithms.
Definition: PageRankBenchmark.h:40
void run(std::string algoName, void(*pralgo)(const GraphAdjList< std::string > &gr, std::unordered_map< std::string, double > &out))
benchmark one implementation
Definition: PageRankBenchmark.h:58
PageRankBenchmark(LineChart &p)
Definition: PageRankBenchmark.h:45
This class provides methods to represent adjacency list based graphs.
Definition: GraphAdjList.h:110
Show series of data or functions using a line chart.
Definition: LineChart.h:43
void setYData(string series, vector< double > ydata)
Changes the Y data for a series.
Definition: LineChart.h:234
void setXData(string series, vector< double > xdata)
Changes the X data for a series.
Definition: LineChart.h:214
Support for drawing Bar charts.
Definition: alltypes.h:4