Optimal Control of a Network of Power Microgrids Using the Pontryagin's Minimum Principle