mirror of
https://github.com/boostorg/graph.git
synced 2026-01-31 08:12:14 +00:00
minor edit
[SVN r8261]
This commit is contained in:
@@ -154,11 +154,12 @@ namespace boost {
|
||||
edges_size_type m = num_edges(g);
|
||||
nm = alpha() * n + m;
|
||||
|
||||
out_edge_iterator ei, e_end;
|
||||
for (tie(u_iter, u_end) = vertices(g); u_iter != u_end; ++u_iter)
|
||||
for (tie(ei, e_end) = out_edges(*u_iter, g); ei != e_end; ++ei)
|
||||
// f[e] = 0 and r[e] = c[e] - f[e]
|
||||
residual_capacity[*ei] = capacity[*ei];
|
||||
// Initialize flow to zero which means initializing
|
||||
// the residual capacity to equal the capacity.
|
||||
out_edge_iterator ei, e_end;
|
||||
for (tie(u_iter, u_end) = vertices(g); u_iter != u_end; ++u_iter)
|
||||
for (tie(ei, e_end) = out_edges(*u_iter, g); ei != e_end; ++ei)
|
||||
residual_capacity[*ei] = capacity[*ei];
|
||||
|
||||
for (tie(u_iter, u_end) = vertices(g); u_iter != u_end; ++u_iter) {
|
||||
vertex_descriptor u = *u_iter;
|
||||
@@ -559,19 +560,19 @@ namespace boost {
|
||||
f_vu = capacity[uv] - residual_capacity[reverse_edge[uv]];
|
||||
|
||||
if (capacity[uv] > 0
|
||||
&& (f_uv > capacity[uv] // capacity constraint
|
||||
|| f_uv != -f_vu)) // skew symmetry
|
||||
&& (f_uv > capacity[uv] // capacity constraint
|
||||
|| f_uv != -f_vu)) // skew symmetry
|
||||
return false;
|
||||
|
||||
sum -= f_uv;
|
||||
|
||||
sum -= f_uv;
|
||||
}
|
||||
vertex_descriptor u = *u_iter;
|
||||
// check flow conservation
|
||||
if (u != src && u != sink && sum != 0)
|
||||
return false;
|
||||
}
|
||||
if (excess_flow[src] != excess_flow[sink])
|
||||
return false;
|
||||
if (excess_flow[src] != excess_flow[sink])
|
||||
return false;
|
||||
|
||||
return true;
|
||||
} // is_flow()
|
||||
|
||||
Reference in New Issue
Block a user