1 #ifndef GRAPH_BENCHMARK_H
2 #define GRAPH_BENCHMARK_H
19 : time_cap (std::numeric_limits<double>::max())
33 auto movievertex = moviegraph.
getVertex(ma.getMovieURI());
34 if (movievertex ==
nullptr) {
35 moviegraph.
addVertex(ma.getMovieURI(), ma.getMovieName());
36 movievertex = moviegraph.
getVertex(ma.getMovieURI());
41 auto actorvertex = moviegraph.
getVertex(ma.getActorURI());
42 if (actorvertex ==
nullptr) {
43 moviegraph.
addVertex(ma.getActorURI(), ma.getActorName());
44 actorvertex = moviegraph.
getVertex(ma.getActorURI());
49 moviegraph.
addEdge(ma.getMovieURI(), ma.getActorURI());
50 moviegraph.
addEdge(ma.getActorURI(), ma.getMovieURI());
54 return std::make_tuple(vertexCount, edgeCount);
61 for (
auto k : gr.
keySet()) {
65 if (degree > maxdegree) {
74 template<
typename GraphType>
76 return gr.getVertices()->size();
79 template<
typename GraphType>
82 for (
auto k : gr.keySet())
83 for (
auto e : gr.outgoingEdgeSetOf(k))
This class provides an API to various data sources used in BRIDGES.
Definition: DataSource.h:64
std::vector< MovieActorWikidata > getWikidataActorMovie(int yearbegin, int yearend)
This function returns the Movie and Actors playing in them between two years.
Definition: DataSource.h:1611
Base class for a variety of graph based benchmark.
Definition: GraphBenchmark.h:15
long countEdges(const GraphType &gr)
Definition: GraphBenchmark.h:80
double getTimeCap() const
Return time limit of a run.
Definition: GraphBenchmark.h:112
std::tuple< long, long > generateWikidataMovieActor(int yearmin, int yearmax, GraphAdjList< std::string > &moviegraph)
Definition: GraphBenchmark.h:23
void setTimeCap(double cap_in_s)
sets an upper bound to the time of a run.
Definition: GraphBenchmark.h:99
double time_cap
Definition: GraphBenchmark.h:17
GraphBenchmark()
Definition: GraphBenchmark.h:18
std::string highestDegreeVertex(GraphAdjList< std::string > &gr)
Definition: GraphBenchmark.h:57
long countVertices(const GraphType &gr)
Definition: GraphBenchmark.h:75
This class provides methods to represent adjacency list based graphs.
Definition: GraphAdjList.h:110
KeySet_helper keySet() const
Definition: GraphAdjList.h:810
void addVertex(const K &k, const E1 &e=E1())
Adds a vertex to the graph.
Definition: GraphAdjList.h:175
SLelement< Edge< K, E2 > >::SLelement_listhelper outgoingEdgeSetOf(K const &k)
This method is useful for iterating through a set of outgoing edges from a vertex.
Definition: GraphAdjList.h:819
void addEdge(const K &src, const K &dest, const E2 &data=E2())
Definition: GraphAdjList.h:198
const Element< E1 > * getVertex(const K &key) const
Return the vertex corresponding to a key.
Definition: GraphAdjList.h:405
Support for drawing Bar charts.
Definition: alltypes.h:4