-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Squashed commit of the following: commit 83f90d5ba5856f695cba8c764c8e021ad42ec2fc Author: ZigRazor <[email protected]> Date: Fri Sep 9 09:47:48 2022 +0000 Include Correction Signed-off-by: ZigRazor <[email protected]> commit f5321cd473949c6fabb3bc7aae5e02cf60515793 Author: ZigRazor <[email protected]> Date: Fri Sep 9 09:44:03 2022 +0000 Removed large file storage Signed-off-by: ZigRazor <[email protected]> commit 21a91340546b289d33558325d31b29de4ede7d5b Author: ZigRazor <[email protected]> Date: Fri Sep 9 09:36:37 2022 +0000 Added git large files storage (lfs) for dataset Signed-off-by: ZigRazor <[email protected]> commit d0b1c64710b7aca9c4dbb352b71e5f489e08c744 Author: ZigRazor <[email protected]> Date: Fri Sep 9 09:30:25 2022 +0000 Upgraded Node Constructor Added Unordered_Set for NodeSet Signed-off-by: ZigRazor <[email protected]> Signed-off-by: ZigRazor <[email protected]> * Added benchmark for all, and tested Signed-off-by: ZigRazor <[email protected]> Signed-off-by: ZigRazor <[email protected]>
- Loading branch information
Showing
45 changed files
with
755 additions
and
188 deletions.
There are no files selected for viewing
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include <benchmark/benchmark.h> | ||
#include "CXXGraph.hpp" | ||
#include "Utilities.hpp" | ||
|
||
|
||
static void BellmanFord_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.bellmanford(*(range_start->second->getNodePair().first), *(range_end->second->getNodePair().second)); | ||
} | ||
} | ||
BENCHMARK(BellmanFord_X)->RangeMultiplier(16)->Range((unsigned long)1, (unsigned long)1 << 16); | ||
|
||
static void BellmanFord_FromReadedCitHep(benchmark::State &state) | ||
{ | ||
auto edgeSet = cit_graph_ptr->getEdgeSet(); | ||
for (auto _ : state) | ||
{ | ||
|
||
auto &result = cit_graph_ptr->bellmanford(*((*(edgeSet.begin()))->getNodePair().first), *((*(++edgeSet.begin()))->getNodePair().second)); | ||
} | ||
} | ||
|
||
BENCHMARK(BellmanFord_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,34 @@ | ||
#include <benchmark/benchmark.h> | ||
#include "CXXGraph.hpp" | ||
#include "Utilities.hpp" | ||
|
||
|
||
static void Boruvka_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.boruvka(); | ||
} | ||
} | ||
BENCHMARK(Boruvka_X)->RangeMultiplier(16)->Range((unsigned long)1, (unsigned long)1 << 16); | ||
|
||
static void Boruvka_FromReadedCitHep(benchmark::State &state) | ||
{ | ||
auto edgeSet = cit_graph_ptr->getEdgeSet(); | ||
for (auto _ : state) | ||
{ | ||
|
||
auto &result = cit_graph_ptr->boruvka(); | ||
} | ||
} | ||
|
||
BENCHMARK(Boruvka_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,64 @@ | ||
#include <benchmark/benchmark.h> | ||
#include "CXXGraph.hpp" | ||
#include "Utilities.hpp" | ||
|
||
|
||
static void Connectivity_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.isConnectedGraph(); | ||
} | ||
} | ||
BENCHMARK(Connectivity_X)->RangeMultiplier(16)->Range((unsigned long)1, (unsigned long)1 << 16); | ||
|
||
static void Connectivity_FromReadedCitHep(benchmark::State &state) | ||
{ | ||
auto edgeSet = cit_graph_ptr->getEdgeSet(); | ||
for (auto _ : state) | ||
{ | ||
|
||
auto result = cit_graph_ptr->isConnectedGraph(); | ||
} | ||
} | ||
|
||
BENCHMARK(Connectivity_FromReadedCitHep); | ||
|
||
static void StrongConnectivity_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.isConnectedGraph(); | ||
} | ||
} | ||
BENCHMARK(StrongConnectivity_X)->RangeMultiplier(16)->Range((unsigned long)1, (unsigned long)1 << 16); | ||
|
||
static void StrongConnectivity_FromReadedCitHep(benchmark::State &state) | ||
{ | ||
auto edgeSet = cit_graph_ptr->getEdgeSet(); | ||
for (auto _ : state) | ||
{ | ||
|
||
auto result = cit_graph_ptr->isConnectedGraph(); | ||
} | ||
} | ||
|
||
BENCHMARK(StrongConnectivity_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,64 @@ | ||
#include <benchmark/benchmark.h> | ||
#include "CXXGraph.hpp" | ||
#include "Utilities.hpp" | ||
|
||
|
||
static void CycleCheckBFS_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.isCyclicDirectedGraphBFS(); | ||
} | ||
} | ||
BENCHMARK(CycleCheckBFS_X)->RangeMultiplier(16)->Range((unsigned long)1, (unsigned long)1 << 16); | ||
|
||
static void CycleCheckBFS_FromReadedCitHep(benchmark::State &state) | ||
{ | ||
auto edgeSet = cit_graph_ptr->getEdgeSet(); | ||
for (auto _ : state) | ||
{ | ||
|
||
auto result = cit_graph_ptr->isCyclicDirectedGraphBFS(); | ||
} | ||
} | ||
|
||
BENCHMARK(CycleCheckBFS_FromReadedCitHep); | ||
|
||
static void CycleCheckDFS_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.isCyclicDirectedGraphDFS(); | ||
} | ||
} | ||
BENCHMARK(CycleCheckDFS_X)->RangeMultiplier(16)->Range((unsigned long)1, (unsigned long)1 << 16); | ||
|
||
static void CycleCheckDFS_FromReadedCitHep(benchmark::State &state) | ||
{ | ||
auto edgeSet = cit_graph_ptr->getEdgeSet(); | ||
for (auto _ : state) | ||
{ | ||
|
||
auto result = cit_graph_ptr->isCyclicDirectedGraphDFS(); | ||
} | ||
} | ||
|
||
BENCHMARK(CycleCheckDFS_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#include <benchmark/benchmark.h> | ||
#include "CXXGraph.hpp" | ||
#include "Utilities.hpp" | ||
|
||
static void Dial_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.dial(*(range_start->second->getNodePair().first),1); | ||
} | ||
} | ||
BENCHMARK(Dial_X)->RangeMultiplier(16)->Range((unsigned long)1, (unsigned long)1 << 16); | ||
|
||
static void Dial_FromReadedCitHep(benchmark::State &state) | ||
{ | ||
auto edgeSet = cit_graph_ptr->getEdgeSet(); | ||
for (auto _ : state) | ||
{ | ||
|
||
auto &result = cit_graph_ptr->dial(*((*(edgeSet.begin()))->getNodePair().first), 1); | ||
} | ||
} | ||
|
||
BENCHMARK(Dial_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,35 @@ | ||
#include <benchmark/benchmark.h> | ||
#include "CXXGraph.hpp" | ||
#include "Utilities.hpp" | ||
|
||
|
||
static void Dijkstra_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.dijkstra(*(range_start->second->getNodePair().first), *(range_end->second->getNodePair().second)); | ||
} | ||
} | ||
BENCHMARK(Dijkstra_X)->RangeMultiplier(16)->Range((unsigned long)1, (unsigned long)1 << 16); | ||
|
||
static void Dijkstra_FromReadedCitHep(benchmark::State &state) | ||
{ | ||
auto edgeSet = cit_graph_ptr->getEdgeSet(); | ||
for (auto _ : state) | ||
{ | ||
|
||
auto &result = cit_graph_ptr->dijkstra(*((*(edgeSet.begin()))->getNodePair().first),*((*(++edgeSet.begin()))->getNodePair().second)); | ||
} | ||
} | ||
|
||
BENCHMARK(Dijkstra_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,22 @@ | ||
#include <benchmark/benchmark.h> | ||
#include "CXXGraph.hpp" | ||
#include "Utilities.hpp" | ||
|
||
|
||
static void EulerPath_X(benchmark::State &state) | ||
{ | ||
CXXGRAPH::Graph<int> g; | ||
auto range_start = undirectedEdges.begin(); | ||
auto range_end = undirectedEdges.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.eulerianPath(); | ||
} | ||
} | ||
BENCHMARK(EulerPath_X)->RangeMultiplier(16)->Range((unsigned long)1, (unsigned long)1 << 16); |
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.