Consumers need heat and electricity for the allocation of different energy services. Energy supply companies usually provide and distribute this heat and electricity, while it depends on the consumers to decide which energy services they ask for. The different technologies, which can provide certain energy services,compete against each other under most circumstances. This work aims at identifying and understanding factors which have an influence on the optimal provision of heat and electricity to an urban development area, from an economical perspective. Therefore, a mixed-integer linear optimization model has been developed which calculates the cost-optimal distribution network structure, based on the energy consumption and the physical characteristics of a district. Under consideration of the revenues from the energy sales, the energy generation costs and the building and operation costs, the model calculates the distribution network development as well as the net present values for an economically optimal supply situation. The model is applied to the region of Reininghaus, which is an area in the austrian city of Graz, and is configured with measured consumption data to evaluate the optimal solution under different scenarios. Regarding the profitability, the electricity and natural gas grids are showing the best prospects. The usage of heat pumps exhibits a positive effect on the profitability of the local energy infrastructure, contrary to local district heating and electricity generation which decreases the turnover of energy sales and distribution. The profitability of the distribution networks largely depends on influence factors out of the utility companies- control. Natural gas distributionis very profitable in the moment due to the low price of natural gas on the market, the electricity supply will be pressured by distributed energy production and the district heating grid could be more competitive if the heat production costs would decrease. For further analysis, the distribution networks can be described in a technically more detailed way and the temporal resolution can be increased.