Optimal Algorithms for Energy Markets: Allocation and Scheduling of Demand in DeregulatedEnergy Markets 60,31 EUR*