summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGloria Mundi <gloria@gloria-mundi.eu>2025-02-13 22:07:35 +0100
committerGloria Mundi <gloria@gloria-mundi.eu>2025-02-13 22:07:35 +0100
commit04ca8f7bd16c0c855f604188d617a1bf2e8eacfd (patch)
treec0b535dc4635bf7d99c714f030578c73ba023310 /test
parent7dc90ef744cf16ac4b4cb4e7d22f4c4686ae7225 (diff)
rename Dinic to Dinitz
Diffstat (limited to 'test')
-rw-r--r--test/graph/dinitzScaling.cpp (renamed from test/graph/dinicScaling.cpp)14
-rw-r--r--test/graph/pushRelabel.cpp12
2 files changed, 13 insertions, 13 deletions
diff --git a/test/graph/dinicScaling.cpp b/test/graph/dinitzScaling.cpp
index 967d6b1..c06d486 100644
--- a/test/graph/dinicScaling.cpp
+++ b/test/graph/dinitzScaling.cpp
@@ -1,6 +1,6 @@
#include "../util.h"
-namespace dinic {
-#include <graph/dinicScaling.cpp>
+namespace dinitz {
+#include <graph/dinitzScaling.cpp>
}
namespace pushRelabel {
@@ -13,20 +13,20 @@ void stress_test() {
int n = Random::integer<int>(2, 30);
int m = Random::integer<int>(n-1, max<int>(n, min<int>(500, n*(n-1) / 2 + 1)));
- dinic::adj.assign(n, {});
+ dinitz::adj.assign(n, {});
pushRelabel::adj.assign(n, {});
Graph<NoData, true> g(n);
g.erdosRenyi(m);
g.forEdges([](int a, int b){
ll w = Random::integer<ll>(1, 1'000'000'000'000ll);
- dinic::addEdge(a, b, w);
+ dinitz::addEdge(a, b, w);
pushRelabel::addEdge(a, b, w);
});
- ll got = dinic::maxFlow(0, n - 1);
+ ll got = dinitz::maxFlow(0, n - 1);
ll expected = pushRelabel::maxFlow(0, n - 1);
-
+
if (got != expected) cerr << "got: " << got << ", expected: " << expected << FAIL;
queries += n;
}
@@ -36,7 +36,7 @@ void stress_test() {
constexpr int N = 50000;
constexpr int M = 200000;
void performance_test() {
- using namespace dinic;
+ using namespace dinitz;
timer t;
Graph<NoData> g(N);
g.erdosRenyi(M);
diff --git a/test/graph/pushRelabel.cpp b/test/graph/pushRelabel.cpp
index ac3b079..42c2e57 100644
--- a/test/graph/pushRelabel.cpp
+++ b/test/graph/pushRelabel.cpp
@@ -1,6 +1,6 @@
#include "../util.h"
-namespace dinic {
-#include <graph/dinicScaling.cpp>
+namespace dinitz {
+#include <graph/dinitzScaling.cpp>
}
namespace pushRelabel {
@@ -13,20 +13,20 @@ void stress_test() {
int n = Random::integer<int>(2, 30);
int m = Random::integer<int>(n-1, max<int>(n, min<int>(500, n*(n-1) / 2 + 1)));
- dinic::adj.assign(n, {});
+ dinitz::adj.assign(n, {});
pushRelabel::adj.assign(n, {});
Graph<NoData, true> g(n);
g.erdosRenyi(m);
g.forEdges([](int a, int b){
ll w = Random::integer<ll>(1, 1'000'000'000'000ll);
- dinic::addEdge(a, b, w);
+ dinitz::addEdge(a, b, w);
pushRelabel::addEdge(a, b, w);
});
ll got = pushRelabel::maxFlow(0, n - 1);
- ll expected = dinic::maxFlow(0, n - 1);
-
+ ll expected = dinitz::maxFlow(0, n - 1);
+
if (got != expected) cerr << "got: " << got << ", expected: " << expected << FAIL;
queries += n;
}