Distributed Programming Framework for Fast Iterative Optimization in Networked Cyber-physical Systems