Distributed Optimization in Networked Systems