Helper. * Sends an amount of flow through an arc, changing the flow balance of the * nodes connected by the arc and the [residual] capacity of the arc and its * dual. */
| 205 | * nodes connected by the arc and the [residual] capacity of the arc and its |
| 206 | * dual. */ |
| 207 | static void sendflow(const struct graph *graph, const struct arc arc, |
| 208 | const s64 flow, s64 *arc_capacity, s64 *node_balance) |
| 209 | { |
| 210 | const struct arc dual = arc_dual(graph, arc); |
| 211 | |
| 212 | arc_capacity[arc.idx] -= flow; |
| 213 | arc_capacity[dual.idx] += flow; |
| 214 | |
| 215 | if (node_balance) { |
| 216 | const struct node src = arc_tail(graph, arc), |
| 217 | dst = arc_tail(graph, dual); |
| 218 | |
| 219 | node_balance[src.idx] -= flow; |
| 220 | node_balance[dst.idx] += flow; |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | /* Augment a `flow` amount along the path defined by `prev`.*/ |
| 225 | static void augment_flow(const struct graph *graph, |
no test coverage detected