# variable declarations:
# we have one variable for each arc of the network,
# representing the amount of flow along that arc.
var x_su >= 0;
var x_sv >= 0;
var x_uv >= 0;
var x_ut >= 0;
var x_vt >= 0;
# objective function: maximize the total flow into the sink node t.
maximize TotalFlow: x_ut + x_vt;
# flow conservation constraints for the inner nodes u and v
subject to FlowCons_u: x_su = x_uv + x_ut;
subject to FlowCons_v: x_sv + x_uv = x_vt;
# constraints for upper capacities on the flow value;
# lower capacities (nonnegativity of the flow) are enforced
# as bound constraints along with the variable declarations
subject to UpperCap_su: x_su <= 4;
subject to UpperCap_sv: x_sv <= 2;
subject to UpperCap_uv: x_uv <= 4;
subject to UpperCap_ut: x_ut <= 3;
subject to UpperCap_vt: x_vt <= 5;