diff options
Diffstat (limited to 'content/graph')
| -rw-r--r-- | content/graph/bitonicTSP.cpp | 2 | ||||
| -rw-r--r-- | content/graph/matching.cpp | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/content/graph/bitonicTSP.cpp b/content/graph/bitonicTSP.cpp index eee5082..f025bca 100644 --- a/content/graph/bitonicTSP.cpp +++ b/content/graph/bitonicTSP.cpp @@ -1,6 +1,6 @@ vector<vector<double>> dist; // Initialisiere mit Entfernungen zwischen Punkten. -auto bitonicTSP() { +auto bitonicTSP() { // n >= 2! vector<double> dp(sz(dist), HUGE_VAL); vector<int> pre(sz(dist)); // nur für Tour dp[0] = 0; dp[1] = 2 * dist[0][1]; pre[1] = 0; diff --git a/content/graph/matching.cpp b/content/graph/matching.cpp index dcaea8c..1e450c0 100644 --- a/content/graph/matching.cpp +++ b/content/graph/matching.cpp @@ -1,4 +1,4 @@ -constexpr int MOD=1'000'000'007, I=10; +constexpr int mod=1'000'000'007, I=10; vector<vector<ll>> adj, mat; int max_matching() { @@ -9,10 +9,10 @@ int max_matching() { mat[v].assign(sz(adj), 0); for (int u : adj[v]) { if (u < v) { - mat[v][u] = rand() % (MOD - 1) + 1; - mat[u][v] = MOD - mat[v][u]; + mat[v][u] = rand() % (mod - 1) + 1; + mat[u][v] = mod - mat[v][u]; }}} - gauss(sz(adj), MOD); //LGS @\sourceref{math/lgsFp.cpp}@ + gauss(sz(mat), sz(mat[0])); //LGS @\sourceref{math/lgsFp.cpp}@ int rank = 0; for (auto& row : mat) { if (*max_element(all(row)) != 0) rank++; |
