Optimal Management of Microgrid Using Heuristic Search Algorithm