|
@@ -23,9 +23,9 @@ struct Node
|
|
|
|
|
|
|
|
struct Edge
|
|
struct Edge
|
|
|
{
|
|
{
|
|
|
- Edge(Node *n1, Node *n2, int cap):n1{n1}, n2{n2}, flow{0}
|
|
|
|
|
|
|
+ Edge(Node *n1, Node *n2, int cap):n1{n1}, n2{n2}, capacity{cap}, flow{0}
|
|
|
{
|
|
{
|
|
|
- capacity = min(min(n1->capacity, n2->capacity), cap);
|
|
|
|
|
|
|
+ //capacity = min(min(n1->capacity, n2->capacity), cap);
|
|
|
|
|
|
|
|
n1->neighbours.push_back(this);
|
|
n1->neighbours.push_back(this);
|
|
|
n2->neighbours.push_back(this);
|
|
n2->neighbours.push_back(this);
|
|
@@ -99,6 +99,9 @@ int edmonds_karp(vector<Node> &m, Node *source, Node *sink)
|
|
|
push_flow = min(push_flow, (e->capacity - e->flow) );
|
|
push_flow = min(push_flow, (e->capacity - e->flow) );
|
|
|
|
|
|
|
|
curr = other_node(e, curr);
|
|
curr = other_node(e, curr);
|
|
|
|
|
+
|
|
|
|
|
+ push_flow = min(push_flow, (curr->capacity - curr->flow) );
|
|
|
|
|
+
|
|
|
e = parent[curr->id];
|
|
e = parent[curr->id];
|
|
|
}
|
|
}
|
|
|
|
|
|