-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Converted std::list to std::deque for edgeList * Enhanced add Edge to the graph converted std::list to std::deque for edgeSet and nodeSet * Created BFS benchmark Enhanced getAdjMatrix function * Removed Old Implementation of addElementToAdjMatrix Converted to a lambda function * Introduced Set, for node and edge of the graph * Created first benchmark with real dataset. * Added some benchmarks, partially closed Optimization * Introduced Citations for Graph Dataset
- Loading branch information
Showing
36 changed files
with
448,577 additions
and
833 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#include <benchmark/benchmark.h> | ||
#include "CXXGraph.hpp" | ||
#include "Utilities.hpp" | ||
|
||
static auto nodes = generateRandomNodes(100000, 2); | ||
static auto edges = generateRandomEdges(100000, nodes); | ||
static auto graph_ptr = readGraph("CitHepPh"); | ||
|
||
static void BFS_X(benchmark::State &state) | ||
{ | ||
CXXGRAPH::Graph<int> g; | ||
auto range_start = edges.begin(); | ||
auto range_end = edges.find(state.range(0)); | ||
std::unordered_map<unsigned long, CXXGRAPH::Edge<int> *> edgesX; | ||
edgesX.insert(range_start, range_end); | ||
for (auto e : edgesX) | ||
{ | ||
g.addEdge(&(*e.second)); | ||
} | ||
for (auto _ : state) | ||
{ | ||
auto &result = g.breadth_first_search(*(range_start->second->getNodePair().first)); | ||
} | ||
} | ||
BENCHMARK(BFS_X)->RangeMultiplier(16)->Range((unsigned long)1, (unsigned long)1 << 16); | ||
|
||
static void BFS_FromReadedCitHep(benchmark::State &state) | ||
{ | ||
auto edgeSet = graph_ptr->getEdgeSet(); | ||
for (auto _ : state) | ||
{ | ||
|
||
auto &result = graph_ptr->breadth_first_search(*((*(edgeSet.begin()))->getNodePair().first)); | ||
} | ||
} | ||
|
||
BENCHMARK(BFS_FromReadedCitHep); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include <benchmark/benchmark.h> | ||
#include "CXXGraph.hpp" | ||
#include "Utilities.hpp" | ||
|
||
static auto nodes = generateRandomNodes(100000, 2); | ||
static auto edges = generateRandomEdges(100000, nodes); | ||
static auto graph_ptr = readGraph("CitHepPh"); | ||
|
||
static void DFS_X(benchmark::State &state) | ||
{ | ||
CXXGRAPH::Graph<int> g; | ||
auto range_start = edges.begin(); | ||
auto range_end = edges.find(state.range(0)); | ||
std::unordered_map<unsigned long, CXXGRAPH::Edge<int> *> edgesX; | ||
edgesX.insert(range_start, range_end); | ||
for (auto e : edgesX) | ||
{ | ||
g.addEdge(&(*e.second)); | ||
} | ||
for (auto _ : state) | ||
{ | ||
auto &result = g.depth_first_search(*(range_start->second->getNodePair().first)); | ||
} | ||
} | ||
|
||
|
||
BENCHMARK(DFS_X)->RangeMultiplier(16)->Range((unsigned long)1, (unsigned long)1 << 16); | ||
|
||
static void DFS_FromReadedCitHep(benchmark::State &state) | ||
{ | ||
auto edgeSet = graph_ptr->getEdgeSet(); | ||
for (auto _ : state) | ||
{ | ||
|
||
auto &result = graph_ptr->depth_first_search(*((*(edgeSet.begin()))->getNodePair().first)); | ||
} | ||
} | ||
|
||
BENCHMARK(DFS_FromReadedCitHep); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.