Economic Models and Algorithms for Distributed Systems