Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 641d3d5

Browse files
Fix some bugs
1 parent e267148 commit 641d3d5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎src/graph/edmonds_karp.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
* Edmonds-Karp algorithm
33
*/
44

5+
#include <queue>
6+
#include <vector>
7+
8+
using namespace std;
9+
510
const int MAX_V = 111;
611
const int INF = 1 << 30;
712

@@ -14,7 +19,7 @@ void augment(int v, int min_edge) {
1419
else if (parent[v] != -1) {
1520
augment(parent[v], min(min_edge, graph[parent[v]][v]));
1621
graph[parent[v]][v] -= f;
17-
graph[v][p[v]] += f;
22+
graph[v][parent[v]] += f;
1823
}
1924
}
2025

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /