Design And Analysis Of Distributed Algorithms With Applications To Networked Traffic Systems