Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions benchmark/BFS_BM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ static void BFS_X(benchmark::State &state) {
auto &result =
g.breadth_first_search(*(range_start->second->getNodePair().first));
}
state.SetComplexityN(2);
}
BENCHMARK(BFS_X)
->RangeMultiplier(18)
Expand All @@ -28,9 +29,11 @@ static void BFS_FromReadedCitHep(benchmark::State &state) {
auto &result = cit_graph_ptr->breadth_first_search(
*((*(edgeSet.begin()))->getNodePair().first));
}
state.SetComplexityN(2);
}

BENCHMARK(BFS_FromReadedCitHep)->Complexity();
// In Error
// BENCHMARK(BFS_FromReadedCitHep)->Complexity();

static void PSEUDO_CONCURRENCY_BFS_X(benchmark::State &state) {
CXXGraph::Graph<int> g;
Expand All @@ -45,6 +48,7 @@ static void PSEUDO_CONCURRENCY_BFS_X(benchmark::State &state) {
auto &result = g.concurrency_breadth_first_search(
*(range_start->second->getNodePair().first), 1);
}
state.SetComplexityN(2);
}
BENCHMARK(PSEUDO_CONCURRENCY_BFS_X)
->RangeMultiplier(18)
Expand All @@ -57,9 +61,10 @@ static void PSEUDO_CONCURRENCY_BFS_FromReadedCitHep(benchmark::State &state) {
auto &result = cit_graph_ptr->concurrency_breadth_first_search(
*((*(edgeSet.begin()))->getNodePair().first), 1);
}
state.SetComplexityN(2);
}

BENCHMARK(PSEUDO_CONCURRENCY_BFS_FromReadedCitHep)->Complexity();
// BENCHMARK(PSEUDO_CONCURRENCY_BFS_FromReadedCitHep)->Complexity();

static void CONCURRENCY_BFS_X(benchmark::State &state) {
CXXGraph::Graph<int> g;
Expand All @@ -74,6 +79,7 @@ static void CONCURRENCY_BFS_X(benchmark::State &state) {
auto &result = g.concurrency_breadth_first_search(
*(range_start->second->getNodePair().first), 8);
}
state.SetComplexityN(2);
}
// BENCHMARK(CONCURRENCY_BFS_X)
// ->RangeMultiplier(18)
Expand All @@ -85,6 +91,7 @@ static void CONCURRENCY_BFS_FromReadedCitHep(benchmark::State &state) {
auto &result = cit_graph_ptr->concurrency_breadth_first_search(
*((*(edgeSet.begin()))->getNodePair().first), 8);
}
state.SetComplexityN(2);
}

// BENCHMARK(CONCURRENCY_BFS_FromReadedCitHep);
4 changes: 3 additions & 1 deletion benchmark/BellmanFord_BM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ static void BellmanFord_X(benchmark::State &state) {
auto &result = g.bellmanford(*(range_start->second->getNodePair().first),
*(range_end->second->getNodePair().second));
}
state.SetComplexityN(2);
}
BENCHMARK(BellmanFord_X)
->RangeMultiplier(16)
Expand All @@ -29,6 +30,7 @@ static void BellmanFord_FromReadedCitHep(benchmark::State &state) {
*((*(edgeSet.begin()))->getNodePair().first),
*((*(++edgeSet.begin()))->getNodePair().second));
}
state.SetComplexityN(2);
}

BENCHMARK(BellmanFord_FromReadedCitHep)->Complexity();
// BENCHMARK(BellmanFord_FromReadedCitHep)->Complexity();
1 change: 1 addition & 0 deletions benchmark/Boruvka_BM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ static void Boruvka_X(benchmark::State &state) {
for (auto _ : state) {
auto &result = g.boruvka();
}
state.SetComplexityN(2);
}
BENCHMARK(Boruvka_X)
->RangeMultiplier(16)
Expand Down
8 changes: 6 additions & 2 deletions benchmark/Connectivity_BM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ static void Connectivity_X(benchmark::State &state) {
for (auto _ : state) {
auto result = g.isConnectedGraph();
}
state.SetComplexityN(2);
}
BENCHMARK(Connectivity_X)
->RangeMultiplier(16)
Expand All @@ -25,10 +26,11 @@ static void Connectivity_FromReadedCitHep(benchmark::State &state) {
auto edgeSet = cit_graph_ptr->getEdgeSet();
for (auto _ : state) {
auto result = cit_graph_ptr->isConnectedGraph();
state.SetComplexityN(2);
}
}

BENCHMARK(Connectivity_FromReadedCitHep)->Complexity();
// BENCHMARK(Connectivity_FromReadedCitHep)->Complexity();

static void StrongConnectivity_X(benchmark::State &state) {
CXXGraph::Graph<int> g;
Expand All @@ -42,6 +44,7 @@ static void StrongConnectivity_X(benchmark::State &state) {
for (auto _ : state) {
auto result = g.isConnectedGraph();
}
state.SetComplexityN(2);
}
BENCHMARK(StrongConnectivity_X)
->RangeMultiplier(16)
Expand All @@ -53,6 +56,7 @@ static void StrongConnectivity_FromReadedCitHep(benchmark::State &state) {
for (auto _ : state) {
auto result = cit_graph_ptr->isConnectedGraph();
}
state.SetComplexityN(2);
}

BENCHMARK(StrongConnectivity_FromReadedCitHep)->Complexity();
// BENCHMARK(StrongConnectivity_FromReadedCitHep)->Complexity();
4 changes: 4 additions & 0 deletions benchmark/CycleCheck_BM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ static void CycleCheckBFS_X(benchmark::State &state) {
for (auto _ : state) {
auto result = g.isCyclicDirectedGraphBFS();
}
state.SetComplexityN(2);
}
BENCHMARK(CycleCheckBFS_X)
->RangeMultiplier(16)
Expand All @@ -26,6 +27,7 @@ static void CycleCheckBFS_FromReadedCitHep(benchmark::State &state) {
for (auto _ : state) {
auto result = cit_graph_ptr->isCyclicDirectedGraphBFS();
}
state.SetComplexityN(2);
}

BENCHMARK(CycleCheckBFS_FromReadedCitHep)->Complexity();
Expand All @@ -42,6 +44,7 @@ static void CycleCheckDFS_X(benchmark::State &state) {
for (auto _ : state) {
auto result = g.isCyclicDirectedGraphDFS();
}
state.SetComplexityN(2);
}
BENCHMARK(CycleCheckDFS_X)
->RangeMultiplier(16)
Expand All @@ -53,6 +56,7 @@ static void CycleCheckDFS_FromReadedCitHep(benchmark::State &state) {
for (auto _ : state) {
auto result = cit_graph_ptr->isCyclicDirectedGraphDFS();
}
state.SetComplexityN(2);
}

BENCHMARK(CycleCheckDFS_FromReadedCitHep)->Complexity();
4 changes: 3 additions & 1 deletion benchmark/DFS_BM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ static void DFS_X(benchmark::State &state) {
auto &result =
g.depth_first_search(*(range_start->second->getNodePair().first));
}
state.SetComplexityN(2);
}

BENCHMARK(DFS_X)
Expand All @@ -29,6 +30,7 @@ static void DFS_FromReadedCitHep(benchmark::State &state) {
auto &result = cit_graph_ptr->depth_first_search(
*((*(edgeSet.begin()))->getNodePair().first));
}
state.SetComplexityN(2);
}

BENCHMARK(DFS_FromReadedCitHep)->Complexity();
// BENCHMARK(DFS_FromReadedCitHep)->Complexity();
4 changes: 3 additions & 1 deletion benchmark/Dial_BM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ static void Dial_X(benchmark::State &state) {
for (auto _ : state) {
auto &result = g.dial(*(range_start->second->getNodePair().first), 1);
}
state.SetComplexityN(2);
}
BENCHMARK(Dial_X)
->RangeMultiplier(16)
Expand All @@ -27,6 +28,7 @@ static void Dial_FromReadedCitHep(benchmark::State &state) {
auto &result =
cit_graph_ptr->dial(*((*(edgeSet.begin()))->getNodePair().first), 1);
}
state.SetComplexityN(2);
}

BENCHMARK(Dial_FromReadedCitHep)->Complexity();
// BENCHMARK(Dial_FromReadedCitHep)->Complexity();
4 changes: 3 additions & 1 deletion benchmark/Dijkstra_BM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ static void Dijkstra_X(benchmark::State &state) {
auto &result = g.dijkstra(*(range_start->second->getNodePair().first),
*(range_end->second->getNodePair().second));
}
state.SetComplexityN(2);
}
BENCHMARK(Dijkstra_X)
->RangeMultiplier(16)
Expand All @@ -29,6 +30,7 @@ static void Dijkstra_FromReadedCitHep(benchmark::State &state) {
*((*(edgeSet.begin()))->getNodePair().first),
*((*(++edgeSet.begin()))->getNodePair().second));
}
state.SetComplexityN(2);
}

BENCHMARK(Dijkstra_FromReadedCitHep)->Complexity();
// BENCHMARK(Dijkstra_FromReadedCitHep)->Complexity();
4 changes: 4 additions & 0 deletions benchmark/Edge_BM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ static void BM_EdgeCreation(benchmark::State &state) {
for (auto _ : state) {
CXXGraph::Edge<int> e(1, n1, n2);
}
state.SetComplexityN(2);
}

BENCHMARK(BM_EdgeCreation)->Complexity();
Expand All @@ -23,6 +24,7 @@ static void EdgeCreationDestruction_new_delete(benchmark::State &state) {
e = new CXXGraph::Edge<int>(1, n1, n2);
delete e;
}
state.SetComplexityN(2);
}

BENCHMARK(EdgeCreationDestruction_new_delete)->Complexity();
Expand All @@ -35,6 +37,7 @@ static void EdgeGetId(benchmark::State &state) {
for (auto _ : state) {
e.getId();
}
state.SetComplexityN(2);
}
BENCHMARK(EdgeGetId)->Complexity();

Expand All @@ -46,5 +49,6 @@ static void NodeGetNodePair(benchmark::State &state) {
for (auto _ : state) {
e.getNodePair();
}
state.SetComplexityN(2);
}
BENCHMARK(NodeGetNodePair)->Complexity();
1 change: 1 addition & 0 deletions benchmark/EulerPath_BM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ static void EulerPath_X(benchmark::State &state) {
for (auto _ : state) {
auto result = g.eulerianPath();
}
state.SetComplexityN(2);
}
BENCHMARK(EulerPath_X)
->RangeMultiplier(16)
Expand Down
4 changes: 4 additions & 0 deletions benchmark/FloydWarshall_BM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ static void BM_FWDirected(benchmark::State &state) {
for (auto _ : state) {
CXXGraph::FWResult res = graph.floydWarshall();
}
state.SetComplexityN(2);
}
BENCHMARK(BM_FWDirected)->Complexity();

Expand All @@ -50,6 +51,7 @@ static void BM_FWNegCycle(benchmark::State &state) {
for (auto _ : state) {
CXXGraph::FWResult res = graph.floydWarshall();
}
state.SetComplexityN(2);
}
BENCHMARK(BM_FWNegCycle)->Complexity();

Expand All @@ -70,6 +72,7 @@ static void BM_FWUndirectedWeighted(benchmark::State &state) {
for (auto _ : state) {
CXXGraph::FWResult res = graph.floydWarshall();
}
state.SetComplexityN(2);
}
BENCHMARK(BM_FWUndirectedWeighted)->Complexity();

Expand All @@ -90,6 +93,7 @@ static void BM_FWNoWeighted(benchmark::State &state) {
for (auto _ : state) {
CXXGraph::FWResult res = graph.floydWarshall();
}
state.SetComplexityN(2);
}

BENCHMARK(BM_FWNoWeighted)->Complexity();
4 changes: 3 additions & 1 deletion benchmark/FordFulkerson_BM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ static void FordFulkerson_X(benchmark::State &state) {
g.fordFulkersonMaxFlow(*(range_start->second->getNodePair().first),
*(range_end->second->getNodePair().second));
}
state.SetComplexityN(2);
}
BENCHMARK(FordFulkerson_X)
->RangeMultiplier(16)
Expand All @@ -30,6 +31,7 @@ static void FordFulkerson_FromReadedCitHep(benchmark::State &state) {
*((*(edgeSet.begin()))->getNodePair().first),
*((*(++edgeSet.begin()))->getNodePair().second));
}
state.SetComplexityN(2);
}

BENCHMARK(FordFulkerson_FromReadedCitHep)->Complexity();
// BENCHMARK(FordFulkerson_FromReadedCitHep)->Complexity();
1 change: 1 addition & 0 deletions benchmark/GraphSlicing_BM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ static void GraphSlicing_X(benchmark::State &state) {
for (auto _ : state) {
auto &result = g.graph_slicing(*(range_start->second->getNodePair().first));
}
state.SetComplexityN(2);
}
BENCHMARK(GraphSlicing_X)
->RangeMultiplier(16)
Expand Down
10 changes: 10 additions & 0 deletions benchmark/Graph_BM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ static void GraphCreation(benchmark::State &state) {
for (auto _ : state) {
CXXGraph::Graph<int> g;
}
state.SetComplexityN(2);
}

BENCHMARK(GraphCreation)->Complexity();
Expand All @@ -21,6 +22,7 @@ static void AddEdge(benchmark::State &state) {
for (auto _ : state) {
g.addEdge(&e);
}
state.SetComplexityN(2);
}
BENCHMARK(AddEdge)->Complexity();

Expand All @@ -35,6 +37,7 @@ static void AddEdgeX(benchmark::State &state) {
g.addEdge(&(*e.second));
}
}
state.SetComplexityN(2);
}
BENCHMARK(AddEdgeX)
->RangeMultiplier(16)
Expand All @@ -46,6 +49,7 @@ static void ReadGraphCitHep(benchmark::State &state) {
auto g = readGraph("CitHepPh");
delete g;
}
state.SetComplexityN(2);
}

BENCHMARK(ReadGraphCitHep)->Complexity();
Expand All @@ -62,6 +66,7 @@ static void getEdgeSetX(benchmark::State &state) {
for (auto _ : state) {
auto edgeSet = g.getEdgeSet();
}
state.SetComplexityN(2);
}

BENCHMARK(getEdgeSetX)
Expand All @@ -81,6 +86,7 @@ static void getNodeSetX(benchmark::State &state) {
for (auto _ : state) {
auto nodeSet = g.getNodeSet();
}
state.SetComplexityN(2);
}

BENCHMARK(getNodeSetX)
Expand All @@ -92,6 +98,7 @@ static void getEdgeSetCitHep(benchmark::State &state) {
for (auto _ : state) {
auto edgeSet = cit_graph_ptr->getEdgeSet();
}
state.SetComplexityN(2);
}

BENCHMARK(getEdgeSetCitHep)->Complexity();
Expand All @@ -100,6 +107,7 @@ static void getNodeSetCitHep(benchmark::State &state) {
for (auto _ : state) {
auto nodeSet = cit_graph_ptr->getNodeSet();
}
state.SetComplexityN(2);
}

BENCHMARK(getNodeSetCitHep)->Complexity();
Expand All @@ -116,6 +124,7 @@ static void getAdjMatrixX(benchmark::State &state) {
for (auto _ : state) {
auto adjMatrix = g.getAdjMatrix();
}
state.SetComplexityN(2);
}

BENCHMARK(getAdjMatrixX)
Expand All @@ -127,6 +136,7 @@ static void getAdjMatrixCitHep(benchmark::State &state) {
for (auto _ : state) {
auto adjMatrix = cit_graph_ptr->getAdjMatrix();
}
state.SetComplexityN(2);
}

BENCHMARK(getAdjMatrixCitHep)->Complexity();
2 changes: 2 additions & 0 deletions benchmark/Kosaraju_BM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ static void Kosaraju_X(benchmark::State &state) {
for (auto _ : state) {
const auto &result = g.kosaraju();
}
state.SetComplexityN(2);
}
BENCHMARK(Kosaraju_X)
->RangeMultiplier(16)
Expand All @@ -26,6 +27,7 @@ static void Kosaraju_FromReadedCitHep(benchmark::State &state) {
for (auto _ : state) {
const auto &result = cit_graph_ptr->kosaraju();
}
state.SetComplexityN(2);
}

BENCHMARK(Kosaraju_FromReadedCitHep)->Complexity();
Loading
Loading