Algorithms for load balancing in electricity markets and data centers