Complex energy networks optimization: Part i - Development and validation of a software for optimal load allocation