The choice between centralized and decentralized electricity generation is examined for 150 countries as a function of population distribution, electricity consumption, transmission cost, and the cost difference between decentralized and centralized electricity generation. A network algorithm is developed to find the shortest centralized transmission network that spans a given fraction of the population in a country. The least-cost combination of centralized and decentralized electricity that serves the country is determined.