Optimization of smart grids: Opportunities and directions