  We prove several geometric theorems using tools from the theory of convex
optimization. In the Riemannian setting, we prove the max flow-min cut theorem
for boundary regions, applied recently to develop a "bit-thread" interpretation
of holographic entanglement entropies. We also prove various properties of the
max flow and min cut, including respective nesting properties. In the
Lorentzian setting, we prove the analogous min flow-max cut theorem, which
states that the volume of a maximal slice equals the flux of a minimal flow,
where a flow is defined as a divergenceless timelike vector field with norm at
least 1. This theorem includes as a special case a continuum version of
Dilworth's theorem from the theory of partially ordered sets. We include a
brief review of the necessary tools from the theory of convex optimization, in
particular Lagrangian duality and convex relaxation.
