Artificial Intelligence and Heuristics for Smart Energy Efficiency in Smart Cities