Energy cost minimization and network management for data centers