Some applications of duality and flows : algorithms for network design and deterministic Markov decision processes