Approximation methods for optimal network coding in a multi-hop control network with packet losses