Accurate maps of wastewater networks in cities are mandatory for an integrated management of water resources. However, in many countries around the world this information is unavailable or inaccurate. A new mapping method is put forward to create maps using manhole cover locations which could be available via ground surveys, remote sensing techniques or stakeholder's databases. A new algorithm is developed which considers manhole covers as the nodes of the network and connects them automatically by minimizing cost functions defined by industry rules thus generating an optimized network. The various input data and rules used to build the deterministic tree-shaped graph being uncertain, a stochastic version of the algorithm is also proposed t...