Optimal capacity allocation for a failure resilient electrical infrastructure