Control of Communication and Energy Networks