Application of Intelligent Techniques for Optimal Management of Weakly Connected Microgrids