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))
std::vector< MovieActorWikidata > getWikidataActorMovie(int yearbegin, int yearend)
This function returns the Movie and Actors playing in them between two years.
Definition: DataSource.h:1226
This class provides methods to represent adjacency list based graphs.
Definition: Element.h:19
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:801
double getTimeCap() const
Return time limit of a run.
Definition: GraphBenchmark.h:113
std::tuple< long, long > generateWikidataMovieActor(int yearmin, int yearmax, GraphAdjList< std::string > &moviegraph)
Definition: GraphBenchmark.h:23
const Element< E1 > * getVertex(const K &key) const
Return the vertex corresponding to a key.
Definition: GraphAdjList.h:383
Base class for a variety of graph based benchmark.
Definition: GraphBenchmark.h:15
void addVertex(const K &k, const E1 &e=E1())
Adds a vertex to the graph.
Definition: GraphAdjList.h:174
these methods convert byte arrays in to base64 codes and are used in BRIDGES to represent the color a...
Definition: alltypes.h:4
This class provides an API to various data sources used in BRIDGES.
Definition: DataSource.h:59
void setTimeCap(double cap_in_s)
sets an upper bound to the time of a run.
Definition: GraphBenchmark.h:100
GraphBenchmark()
Definition: GraphBenchmark.h:18
long countEdges(const GraphType &gr)
Definition: GraphBenchmark.h:80
long countVertices(const GraphType &gr)
Definition: GraphBenchmark.h:75
KeySet_helper keySet() const
Definition: GraphAdjList.h:792
double time_cap
Definition: GraphBenchmark.h:17
std::string highestDegreeVertex(GraphAdjList< std::string > &gr)
Definition: GraphBenchmark.h:57
void addEdge(const K &src, const K &dest, const E2 &data=E2())
Add an edge with data.
Definition: GraphAdjList.h:197