Improving the rational use of water and energy resources by optimising the heat supply system using P-Graph tools and additional analysis is discussed in this paper. The proposed approach is based on the decomposition of the heat supply system of a city/settlement into separate districts and optimisation of the thermal energy network between consumers and energy sources. The determination of the optimal structure for the distribution of thermal energy between consumers in each district is carried out using the P-Graph approach and accounting import/export of energy and water resources. An additional analysis of the structure of heat supply systems allows for determining the structure with minimum operating cost, water consumption and emissions. The proposed approach was applied to optimise the heat supply system of Tomsk city. Three configurations of the heat supply system, characterized by different objective functions, were determined as a result of the study. The structure of the heat supply system obtained based on the operating cost minimisation reduces operating costs by 69 million RUB/y; water consumption minimisation decreases water consumption by 27.3 thousand m3/y; emission minimisation has cut emissions by 6,000 tCO2/y and 517 tSO2/y compared to the base case. The approach proposed may be used for the design of heat supply systems by finding the trade-off between the operating cost and the environmental footprint of the heat supply system. It makes it possible to optimise heat supply systems based on the economic and environmental capabilities of the region.